You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Martin Atkins <ma...@degeneration.co.uk> on 2006/03/29 18:32:07 UTC
Java2WSDL throws NullPointerException
I'm attempting to use Java2WSDL to create a WSDL file for a web service
class that will eventually be deployed under Axis. However, Java2WSDL is
just throwing a NullPointerException. I've tried tweaking the parameters
to no avail. My command line is (summarized):
java -cp $AXIS_CLASSPATH
org.apache.axis.wsdl.Java2WSDL
-X classes/
-o EntityBeanManagement.wsdl
-l http://localhost:8080/DFTService/ManagerService
-n "http://services.dft.mycompany.com"
-p"com.mycompany.dft.beans"="http://beans.dfd.mycompany.com"
-p"com.mycompany.dft.maps"="http://maps.dft.mycompany.com"
com.mycompany.dft.services.ManagerService
I've tried various permutations with no -p, one -p no -n, etc. All
generate this exception:
java.lang.NullPointerException
at
org.apache.axis.utils.ClassUtils.createClassLoader(ClassUtils.java:291)
at org.apache.axis.wsdl.Java2WSDL.parseOption(Java2WSDL.java:491)
at org.apache.axis.wsdl.Java2WSDL.run(Java2WSDL.java:564)
at org.apache.axis.wsdl.Java2WSDL.main(Java2WSDL.java:682)
I'm using a binary distribution of Axis 1.3 downloaded from the official
site.
What might be causing this?
Cheers,
-Martin
Re: Java2WSDL throws NullPointerException
Posted by Dies Koper <di...@jp.fujitsu.com>.
Hello Martin,
I'm glad to hear you found the cause of the error.
Please do not hesitate to open a JIRA bug with your suggestion and a patch.
Regards,
Dies
Martin Atkins wrote:
> Dies Koper wrote:
>> Hello Martin,
>>
>> Judging from your stacktrace the NPE occurs in the following line:
>>
>> URL[] urls = new URL[names.length];
>>
>> "names" is an array of strings that should contain the path entries in
>> your classpath. I do not know under what circumstances it could be
>> null, but you could try tweaking your classpath setting (-X classes/).
>> Maybe it's the slash?
>>
>
> Your message prompted me to go for a little look through the source code
> myself. It turns out that this error is caused by including a space
> between the -X and the classpath value.
>
> I'd like to politely suggest that either this create a more sensible
> error (by checking if option.getArgument() is null at about line 491 of
> Java2WSDL.java?) or ideally the tool support the space, for consistency
> with most other utilities which have single-letter options.
Re: Java2WSDL throws NullPointerException
Posted by Martin Atkins <ma...@degeneration.co.uk>.
Dies Koper wrote:
> Hello Martin,
>
> Judging from your stacktrace the NPE occurs in the following line:
>
> URL[] urls = new URL[names.length];
>
> "names" is an array of strings that should contain the path entries in
> your classpath. I do not know under what circumstances it could be null,
> but you could try tweaking your classpath setting (-X classes/). Maybe
> it's the slash?
>
Your message prompted me to go for a little look through the source code
myself. It turns out that this error is caused by including a space
between the -X and the classpath value.
I'd like to politely suggest that either this create a more sensible
error (by checking if option.getArgument() is null at about line 491 of
Java2WSDL.java?) or ideally the tool support the space, for consistency
with most other utilities which have single-letter options.
Re: Java2WSDL throws NullPointerException
Posted by Dies Koper <di...@jp.fujitsu.com>.
Hello Martin,
Judging from your stacktrace the NPE occurs in the following line:
URL[] urls = new URL[names.length];
"names" is an array of strings that should contain the path entries in
your classpath. I do not know under what circumstances it could be null,
but you could try tweaking your classpath setting (-X classes/). Maybe
it's the slash?
Good luck,
Dies
Martin Atkins wrote:
>
> I'm attempting to use Java2WSDL to create a WSDL file for a web service
> class that will eventually be deployed under Axis. However, Java2WSDL is
> just throwing a NullPointerException. I've tried tweaking the parameters
> to no avail. My command line is (summarized):
>
> java -cp $AXIS_CLASSPATH
> org.apache.axis.wsdl.Java2WSDL
> -X classes/
> -o EntityBeanManagement.wsdl
> -l http://localhost:8080/DFTService/ManagerService
> -n "http://services.dft.mycompany.com"
> -p"com.mycompany.dft.beans"="http://beans.dfd.mycompany.com"
> -p"com.mycompany.dft.maps"="http://maps.dft.mycompany.com"
> com.mycompany.dft.services.ManagerService
>
> I've tried various permutations with no -p, one -p no -n, etc. All
> generate this exception:
>
> java.lang.NullPointerException
> at
> org.apache.axis.utils.ClassUtils.createClassLoader(ClassUtils.java:291)
> at org.apache.axis.wsdl.Java2WSDL.parseOption(Java2WSDL.java:491)
> at org.apache.axis.wsdl.Java2WSDL.run(Java2WSDL.java:564)
> at org.apache.axis.wsdl.Java2WSDL.main(Java2WSDL.java:682)
>
> I'm using a binary distribution of Axis 1.3 downloaded from the official
> site.
>
> What might be causing this?
>
>
> Cheers,
> -Martin