Saturday 15 June 2013

java - "No context factory" exception thrown when using JBoss' VFS -


I am trying to get ressource contained in a jar file. This jar is used as a dependency of webproject MyWebApp I am using JBOSS 5.1.0

The jar file contains the code:

  // My The client's / / / class part of the functions ... count & lt; URL & gt; ConfigEnum; ConfigEnum = this.getClass (). GetClassLoader (). GetResources ("MyFile"); While (configEnum.hasMoreElements ()) {URL configURL = configEnum.nextElement (); VirtualFile File = VFS .getRoot (configURL); ...  

But when I import this jar into a web application (myWebApp) and I use this function, I get an exception:

  java Io.IOException: There is no reference factory for vfszip: / ... path ... / MyWeb Web / Web-NF / Lib / MyArzager / MySource / Path / at org.jboss.virtual.VFS.getVFS ( 

If someone knows how to fix this It would be very useful.

I found out what was the problem org on my jar and server. Jboss.virtual.VirtualFile was not using the same version (found that when I found:

"org.jboss.virtual.VirtualFile can not be inserted into the organization .jboss.virtual.VirtualFile )

Hope this will be useful for anyone.


No comments:

Post a Comment