JAXWS : Problem loading JAXB classes from a directory which has spaces in its
name
----------------------------------------------------------------------------------
Key: AXIS2-5205
URL: https://issues.apache.org/jira/browse/AXIS2-5205
Project: Axis2
Issue Type: Bug
Components: jaxws
Affects Versions: 1.6.1
Environment: OS : Windows XP
Server : WebSphere 8.0.0.1
Axis 2 : 1.6.1
Reporter: Vinay Sarwate
Priority: Minor
In my case, I have a JAXWS service packaged inside MyService.jar. It requires
two supporting jars (model.jar, rules.jar), these jars are also packaged inside
MyService.jar (under lib folder).
I am trying to deploy this web service in WebSphere 8.0.0.1 using axis web
application. I have placed this MyService.jar inside "servicejars" folder as
set and required by Axis2 JAX-WS deployment.
After all recommended setting of classloader and disabling WebSphere supplied
JAXWS engine, I was able to deploy my service properly, however when client
tries to execute a call it receives following exception -
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException:
javax.xml.bind.JAXBException: com.xxx.Message is not known to this context
at
com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(Unknown Source)
at
com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown
Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown
Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)
at $Proxy31.process(Unknown Source)
at com.xxx.MainClient.main(MainClient.java:46)
I did some debugging based on this message to know why required classes are no
there in JAXB context. Seems like problem is with
org.apache.axis2.jaxws.message.databinding.impl.ClassFinderImpl. The method
getClassesFromJarFile(String pkg, ClassLoader cl) is responsible for loading
classes for a given package using given class loader. Inside this method, all
URLs from classloader are picked and are iterated one by one to find classes of
given package.
During this process, if URL is for a location which has spaces in its name (or
in its complete path) then it results in URISyntaxException and no classes are
loaded.
Line throwing exception is : File f = new File(url.toURI().getPath());
In my case, ClassFinderImpl.getClassesFromJarFile is getting a classloader (as
parameter) which has following five values for URLs -
0 -
file:/C:/DOCUME~1/userLOCALS~1/Temp/axis2-tmp-1224404954365087102.tmp/axis23975540858234400924MyService.jar
1-
file:/C:/DOCUME~1/user/LOCALS~1/Temp/axis2-tmp-1224404954365087102.tmp/axis28187536653718477252model.jar
2-
file:/C:/DOCUME~1/user/LOCALS~1/Temp/axis2-tmp-1224404954365087102.tmp/axis28055770004335999009rules.jar
3- file:/D:/Program
Files/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/e669730Node01Cell/axis2_war.ear/axis2.war/WEB-INF/
4- file:/D:/Program
Files/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/e669730Node01Cell/axis2_war.ear/axis2.war/
When iteration is for forth values, its results in exception (dues to space in
"Program Files") and no classes for package are loaded in context.
I know WebSphere should be installed in directories having no spaces in name
but this is existing setup and I have no control to change this currently. And
moreover I think this problem is related to ability to handle space in URL by
ClassFinderImpl class.
Thanks.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]