[ 
https://issues.apache.org/jira/browse/CXF-1446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Kulp resolved CXF-1446.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.5
         Assignee: Daniel Kulp

> 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
>            Assignee: Daniel Kulp
>            Priority: Minor
>             Fix For: 2.0.5
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to