IllegalArgumentException: Null InputStream is not a valid argument when loading
axis client from URLClassLoader
---------------------------------------------------------------------------------------------------------------
Key: AXIS2-2484
URL: https://issues.apache.org/jira/browse/AXIS2-2484
Project: Axis 2.0 (Axis2)
Issue Type: Bug
Components: kernel
Affects Versions: 1.1.1
Environment: Sun JDK 1.4.2, Axis 1.1.1, Windows 2000, ADB data binding
Reporter: Jacques Desmazieres
I have a application with a plugin feature. I have implemented an Axis 2
service and generated both service and client using java2wsdl and wsdl2java.
When invoking the service using the generated client, loaded in the classpath,
everything is ok.
But when I load the client in an URLClassloader, with all the Axis2 libraries
specified in the url[] parameter, I have the following message:
java.lang.IllegalArgumentException: Null InputStream is not a valid argument
at
com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:602)
at
com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:305)
at
org.apache.axiom.om.util.StAXUtils.createXMLStreamReader(StAXUtils.java:129)
at
org.apache.axis2.deployment.DescriptionBuilder.buildOM(DescriptionBuilder.java:86)
at
org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:58)
at
org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:690)
at
org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:109)
After some investigation, it appears that the exception is raised beacause the
FileSystemConfigurator class cannot find the default axis2.xml configuration
file.
I have found that the issue comes from the loading of the default axis2.xml
config file in the org.apache.axis2.deployment.getAxisConfiguration() method
line 106:
ClassLoader cl = Thread.currentThread().getContextClassLoader();
In my case, the classloader retrieved is the one of the calling application
(not the plugin's classloader) and so the axis2 (and mainly
axis2-kernel-1.1.1.jar) is not found.
Why retrieving the context classloader ? Is there a reason for that ? Can I fix
that with a proper configuration ? Deploying the axis2 kernel jar at
application level is not an option.
If you replace the source code line by the following fixes the problem:
ClassLoader cl = getClass().getClassLoader();
As we retrieve the service client's classloader, Axis is able to find the
default configuration file.
Jacques Desmazières
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]