cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maomaode <maoma...@gmail.com>
Subject Re: [jira] Created: (CXF-1446) null pointer in java2wsld
Date Fri, 22 Feb 2008 07:32:17 GMT
You have wierd target namespace address, why not use /

James

> null pointer in java2wsld
> -------------------------
>
>                  Key: CXF-1446
>                  URL: https://issues.apache.org/jira/browse/CXF-1446
>              Project: CXF
>           Issue Type: Bug
>           Components: Tooling
>     Affects Versions: 2.0.4
>          Environment: ubuntu linux
>             Reporter: Sean Bridges
>             Priority: Minor
>
>
> The default output directory lookup for java2wsdl is not optimal.
>
> If I have a web interface that looks like,
>
> @WebService(name="service",
>     targetNamespace="http:\\\\soap.example.com",
>     wsdlLocation="http:\\\\soap.example.com\trinityService?wsdl")
> public interface Example {
>
>
> And run java2wsdl without the -d param, I get an exception,
>
> java.lang.NullPointerException
> 	at java.io.File.<init>(File.java:194)
> 	at org.apache.cxf.tools.java2wsdl.processor.JavaToProcessor.getOutputDir(JavaToProcessor.java:196)
> 	at org.apache.cxf.tools.java2wsdl.processor.JavaToProcessor.process(JavaToProcessor.java:95)
> 	at org.apache.cxf.tools.java2wsdl.JavaToWSDLContainer.execute(JavaToWSDLContainer.java:58)
> 	at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
> 	at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:52)
> 	at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:39)
> 	at org.apache.cxf.tools.java2wsdl.JavaToWSDL.run(JavaToWSDL.java:74)
> 	at org.apache.cxf.tools.java2wsdl.JavaToWSDL.main(JavaToWSDL.java:42)
> 	at t.Run.main(Run.java:7)
> JavaToWSDL Error : null
>
> org.apache.cxf.tools.common.ToolException
> 	at org.apache.cxf.tools.java2wsdl.JavaToWSDLContainer.execute(JavaToWSDLContainer.java:75)
> 	at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
> 	at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:52)
> 	at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:39)
> 	at org.apache.cxf.tools.java2wsdl.JavaToWSDL.run(JavaToWSDL.java:74)
> 	at org.apache.cxf.tools.java2wsdl.JavaToWSDL.main(JavaToWSDL.java:42)
> 	at t.Run.main(Run.java:7)
>
>
> This is caused by JavaToProcessor,
>
>     protected File getOutputDir(File wsdlLocation) {
>         String dir = (String)context.get(ToolConstants.CFG_OUTPUTDIR);
>         if (dir == null) {
>             if (wsdlLocation == null) {
>                 dir = "./";
>             } else {
>                 dir = wsdlLocation.getParent();
>             }
>         }
>         return new File(dir);
>     }
>
> dir is null, since no output dir was specified.  The wsdl location param is a File with
path, "http:\\soap.example.com	service?wsdl", and this has no valid parent.
>
> I would not expect the wsld location specified in @WebService to be a valid output directory
for java2wsdl.  wsdl location will usually be an http url.
>
>   


Mime
View raw message