cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Grandmaison <java97...@yahoo.com>
Subject Re: 2.6.2-SNAPSHOT:wsdl2java - null pointer
Date Thu, 23 Aug 2012 07:42:16 GMT
Works.  Thank you.

One of the reasons why I was trying to upgrade to 2.6.2 was that I was under the impression
that this would somehow allow m2e and eclipse to figure out that the source generated by cxf
was to be included as a source directory.

Apparently netbeans treats all directories under target/generated-sources as source directory
such that independant of how many maven plugins are added to the pom file if the plugin does
the correct thing and write the generated source to this known directory then maven/the ide
know about it and use it.  Rumor had it that this could be solved and was solved in 2.6.2
by the addition of some lifecycle notifications or something.

I tried removing the source directory that i manually declared for cxf /target/generated-sources/cxf
from my project and running a build but eclipse didn't seem to pick up on it.

Am I under false impressions?

The comment under this bug that talks about lifecycle mapping is what had me thinking this
would automatically address the generated sources issue.  Unfortunately the ASF always seems
to be down when I try to access the cxf bug report.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=350081


https://issues.apache.org/jira/browse/CXF-4152


Thank you,

Mike


----- Original Message -----
From: Daniel Kulp <dkulp@apache.org> 
To: dev@cxf.apache.org; Mike Grandmaison <java97301@yahoo.com>
Cc: 
Sent: Tuesday, August 21, 2012 9:19 AM
Subject: Re: 2.6.2-SNAPSHOT:wsdl2java - null pointer


I think I know what caused this and just committed a fix.   Should be in tomorrows 2.6.3-SNAPSHOT.

Basically, to support m2e, we started sending all the warnings and errors into the BuildContext
object that m2e will provide.  That way, the warnings and errors and such can properly be
marked in eclipse editors and such.  However, that API requires a "File" object.   We were
taking the systemId of the WSDL and pretty much just creating a File object from it.   In
your case, the systemId is an HTTP URL and thus a File is not usable so the file ends up as
null.   m2e is apparently not liking the null file object.

I *THINK* I now have it fixed enough.   It kind of creates a fake File object for the HTTP
url that allows the proper warning to display on the command line maven.  Not 100% sure in
m2e right now.     If you could give it a try, that would be great.

That said, you could also add <fork>true</fork> to the config for the plugin and
it should just fork it in which case we cannot really pass the errors back to m2e anyway. 
That may work around it.

Dan




On Aug 17, 2012, at 4:59 PM, Mike Grandmaison <java97301@yahoo.com> wrote:

> Hopefully this helps.  
> 
> To get the full stack trace in eclipse I just added:  gwt:debug -e -X package to the
run configuration goal instead of just package.
> 
> 
> [ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.6.2-SNAPSHOT:wsdl2java
(myproject-generate-sources) on project cope: Executionmyproject-generate-sources of goal
org.apache.cxf:cxf-codegen-plugin:2.6.2-SNAPSHOT:wsdl2java failed: java.lang.NullPointerException
-> [Help 1]
> 
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.6.2-SNAPSHOT:wsdl2java
(myproject-generate-sources) on project cope: Execution myproject-generate-sources of goal
org.apache.cxf:cxf-codegen-plugin:2.6.2-SNAPSHOT:wsdl2java failed: java.lang.NullPointerException
> 
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
> at org.apache.maven.lifecycle.internal.MojoExecutor.executeForkedExecutions(MojoExecutor.java:365)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:199)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
> at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
> at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
> at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:601)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
> at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
> at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
> Caused by: org.apache.maven.plugin.PluginExecutionException: Execution oim-generate-sources
of goal org.apache.cxf:cxf-codegen-plugin:2.6.2-SNAPSHOT:wsdl2java failed: java.lang.NullPointerException
> at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
> ... 23 more
> Caused by: org.apache.cxf.tools.common.ToolException: java.lang.NullPointerException
> at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:308)
> at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
> at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
> at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
> at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.generate(WSDL2JavaMojo.java:280)
> at org.apache.cxf.maven_plugin.AbstractCodegenMoho.execute(AbstractCodegenMoho.java:257)
> at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:377)
> at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
> ... 24 more
> Caused by: java.lang.NullPointerException
> at org.sonatype.plexus.build.incremental.DefaultBuildContext.getMessage(DefaultBuildContext.java:88)
> at org.sonatype.plexus.build.incremental.DefaultBuildContext.addMessage(DefaultBuildContext.java:113)
> at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo$2.addWarning(WSDL2JavaMojo.java:277)
> at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBBindErrorListener.warning(JAXBBindErrorListener.java:93)
> at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.warning(SchemaCompilerImpl.java:311)
> at com.sun.tools.xjc.api.impl.s2j.DowngradingErrorHandler.warning(DowngradingErrorHandler.java:60)
> at com.sun.tools.xjc.reader.internalizer.DOMForest.weakSchemaCorrectnessCheck(DOMForest.java:489)
> at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:259)
> at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:94)
> at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:411)
> at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:603)
> at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:248)
> at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:142)
> at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:300)
> ... 31 more
> 
> 
> 
> 
> ________________________________
> From: Freeman Fang <freeman.fang@gmail.com>
> To: dev@cxf.apache.org; Mike Grandmaison <java97301@yahoo.com> 
> Sent: Wednesday, August 15, 2012 7:50 PM
> Subject: Re: 2.6.2-SNAPSHOT:wsdl2java - null pointer
> 
> 
> Hi,
> 
> If you can append a more detailed stack trace, it would be more helpful.
> Also if you can append a simple wsdl which can reproduce this NPE, we can do a quick
test from our side.
> 
> Freeman
> -------------
> Freeman Fang
> 
> FuseSource
> Email:ffang@fusesource.com
> Web: fusesource.com
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
> http://blog.sina.com.cn/u/1473905042
> weibo: http://weibo.com/u/1473905042
> 
> On 2012-8-16, at 上午8:22, Mike Grandmaison wrote:
> 
> Hi,
>> 
>> I am using the 2.6.2-SNAPSHOT:
>> 
>> 2.6.2-20120813.071134-43
>> 
>> 
>> in Eclipse with m2e but I get the following error when I run package.
>> 
>> [ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.6.2-SNAPSHOT:wsdl2java
(myproject-generate-sources) on project cope: Execution myproject-generate-sources of goal
org.apache.cxf:cxf-codegen-plugin:2.6.2-SNAPSHOT:wsdl2java failed: java.lang.NullPointerException
-> [Help 1]
>> 
>> Here is my pom.xml section for cxf:
>> 
>> <plugin>
>>                 <groupId>org.apache.cxf</groupId>
>>                 <artifactId>cxf-codegen-plugin</artifactId>
>>                 <version>${cxf.version}</version>
>>                 <executions> 
>>                     <execution>
>>                         <id>myproject-generate-sources</id>
>>                         <phase>generate-sources</phase>
>>                         <configuration>
>>                             <sourceRoot>${basedir}/target/generated-sources/cxf-codegen-plugin</sourceRoot>
>>                             <wsdlOptions>
>>                                 <wsdlOption>
>>                                     <wsdl>http://mydomain.com:23000/webapps/webservicesimulator/service/MyService?wsdl</wsdl>
>>                                     <extraargs>
>>                                         <extraarg>-client</extraarg>
>>                                     </extraargs>
>>                                 </wsdlOption>
>>                             </wsdlOptions>
>>                         </configuration>
>>                         <goals>
>>                             <goal>wsdl2java</goal>
>>                         </goals>
>>                     </execution>
>>                 </executions>
>>           </plugin>
>> 
>> This works fine with cxf 2.6.1
>> 
>> Is there something that changed in the pom.xml requirements for 2.6.2?
>> 
>> Thank you,
>> 
>> Mike
>> 

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Mime
View raw message