You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by zchen <zh...@twcable.com> on 2013/05/16 02:45:54 UTC

NPE when upgrade cxf-codegen-plugin from 2.3.5 to 2.7.4

My Maven build runs wsdl2java by loading a wsdl from the maven repository.
Using cxf-codegen-plugin 2.3.5 works (even 2.7.0 works). But 2.7.4 (in fact,
starts with 2.7.1) give me NPE. I downloaded the latest
apache-cxf-2.7.4-src. The stack trace seemed indicating a
System.getProperty("java.class.path") is not set. Is there any new settings
that is needed starting 2.7.1? Thank you for your help!

[ERROR] Failed to execute goal
org.apache.cxf:cxf-codegen-plugin:2.7.4:wsdl2java (generate-sources) on
project Execution generate-sources of goal
org.apache.cxf:cxf-codegen-plugin:2.7.4:wsdl2java failed.
NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute
goal org.apache.cxf:cxf-codegen-plugin:2.7.4:wsdl2java (generate-sources) on
project mas-wsmodel-lineup-v2: Execution generate-sources of goal
org.apache.cxf:cxf-codegen-plugin:2.7.4:wsdl2java failed.
	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.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:319)
	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:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	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
generate-sources of goal org.apache.cxf:cxf-codegen-plugin:2.7.4:wsdl2java
failed.
	at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
	at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
	... 19 more
Caused by: java.lang.NullPointerException
	at java.util.Hashtable.put(Hashtable.java:394)
	at java.util.Properties.setProperty(Properties.java:143)
	at java.lang.System.setProperty(System.java:729)
	at
org.apache.cxf.maven_plugin.ClassLoaderSwitcher.restoreClassLoader(ClassLoaderSwitcher.java:121)
	at
org.apache.cxf.maven_plugin.AbstractCodegenMoho.execute(AbstractCodegenMoho.java:325)
	at
org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:524)
	at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)

Here is my parent pom snippet:

               <artifactId>cxf-codegen-plugin</artifactId>
               <groupId>org.apache.cxf</groupId>
               <version>2.7.4</version>
...
               <configuration>
                  <defaultOptions>
                     <extraargs>
                        <extraarg>-verbose</extraarg>
                        <extraarg>-validate</extraarg>
                        
                       
<extraarg>-xjc-Xts:style:org.apache.commons.lang.builder.ToStringStyle.DEFAULT_STYLE</extraarg>
                     </extraargs>
                  </defaultOptions>
               </configuration>
               <executions>
                  <execution>
                     <id>generate-sources</id>
                     <phase>generate-sources</phase>
                     <goals>
                        <goal>wsdl2java</goal>
                     </goals>
                  </execution>
               </executions>

Here is a snippet of child pom:

            <configuration>
               
               <wsdlOptions>
                  <wsdlOption>
                    
<wsdlLocation>http://${webserviceHost}:${webservicePort}/${webserviceWSDLLocationSuffix}</wsdlLocation>
                     <wsdlArtifact>
                       
<groupId>com.twc.mystro.mas.webservices.beans</groupId>
                        <artifactId>${webserviceArtifactID}</artifactId>
                        <version>${project.version}</version>
                        <type>wsdl</type>
                     </wsdlArtifact>
                  </wsdlOption>
               </wsdlOptions>
            </configuration>




--
View this message in context: http://cxf.547215.n5.nabble.com/NPE-when-upgrade-cxf-codegen-plugin-from-2-3-5-to-2-7-4-tp5727752.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Re: NPE when upgrade cxf-codegen-plugin from 2.3.5 to 2.7.4

Posted by "Chen, Zhongming" <zh...@twcable.com>.
Hi Dan,

I tried "mvn install -Djava.class.path=/home/zchen" just want to see if it
will let me pass the NPE. But I am getting the same NPE. I tried a few
different way for the command but all of them arrive to NPE:

mvn install -D"java.class.path=/home/zchen"
mvn install -D"java.class.path"="/home/zchen"
mvn install -Djava.class.path=/home/zchen

Not sure how I can get java.class.path set. Thanks!

Zhongming

On 5/16/13 11:36 AM, "Daniel Kulp" <dk...@apache.org> wrote:

>
>On May 16, 2013, at 12:45 PM, zchen <zh...@twcable.com> wrote:
>
>> Is there a way for me I set "java.class.path" in my MVN build?
>>
>> Or did I miss any new settings that required by 2.7.1+ ?
>
>Honestly, I've never seen java.class.path be null.   Not sure how that's
>happening for you.  :-(
>
>You may be able to set it as a system property passed to maven, not
>really sure.
>
>Dan
>
>
>
>>
>> Thanks!
>>
>>
>>
>> --
>> View this message in context:
>>http://cxf.547215.n5.nabble.com/NPE-when-upgrade-cxf-codegen-plugin-from-
>>2-3-5-to-2-7-4-tp5727752p5727781.html
>> Sent from the cxf-dev mailing list archive at Nabble.com.
>
>--
>Daniel Kulp
>dkulp@apache.org - http://dankulp.com/blog
>Talend Community Coder - http://coders.talend.com
>


This E-mail and any of its attachments may contain Time Warner Cable proprietary information, which is privileged, confidential, or subject to copyright belonging to Time Warner Cable. This E-mail is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient of this E-mail, you are hereby notified that any dissemination, distribution, copying, or action taken in relation to the contents of and attachments to this E-mail is strictly prohibited and may be unlawful. If you have received this E-mail in error, please notify the sender immediately and permanently delete the original and any copy of this E-mail and any printout.

Re: NPE when upgrade cxf-codegen-plugin from 2.3.5 to 2.7.4

Posted by Daniel Kulp <dk...@apache.org>.
On May 16, 2013, at 12:45 PM, zchen <zh...@twcable.com> wrote:

> Is there a way for me I set "java.class.path" in my MVN build? 
> 
> Or did I miss any new settings that required by 2.7.1+ ? 

Honestly, I've never seen java.class.path be null.   Not sure how that's happening for you.  :-(

You may be able to set it as a system property passed to maven, not really sure.

Dan



> 
> Thanks!
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/NPE-when-upgrade-cxf-codegen-plugin-from-2-3-5-to-2-7-4-tp5727752p5727781.html
> Sent from the cxf-dev mailing list archive at Nabble.com.

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


Re: NPE when upgrade cxf-codegen-plugin from 2.3.5 to 2.7.4

Posted by zchen <zh...@twcable.com>.
Is there a way for me I set "java.class.path" in my MVN build? 

Or did I miss any new settings that required by 2.7.1+ ? 

Thanks!



--
View this message in context: http://cxf.547215.n5.nabble.com/NPE-when-upgrade-cxf-codegen-plugin-from-2-3-5-to-2-7-4-tp5727752p5727781.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Re: NPE when upgrade cxf-codegen-plugin from 2.3.5 to 2.7.4

Posted by Freeman Fang <fr...@gmail.com>.
We need add NPE guard before we restore original java.class.path system property, create CXF-5020[1] to track it.

[1]https://issues.apache.org/jira/browse/CXF-5020
-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

www.camelone.org : The open source integration conference: 

On 2013-5-16, at 上午8:45, zchen wrote:

> My Maven build runs wsdl2java by loading a wsdl from the maven repository.
> Using cxf-codegen-plugin 2.3.5 works (even 2.7.0 works). But 2.7.4 (in fact,
> starts with 2.7.1) give me NPE. I downloaded the latest
> apache-cxf-2.7.4-src. The stack trace seemed indicating a
> System.getProperty("java.class.path") is not set. Is there any new settings
> that is needed starting 2.7.1? Thank you for your help!
> 
> [ERROR] Failed to execute goal
> org.apache.cxf:cxf-codegen-plugin:2.7.4:wsdl2java (generate-sources) on
> project Execution generate-sources of goal
> org.apache.cxf:cxf-codegen-plugin:2.7.4:wsdl2java failed.
> NullPointerException -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute
> goal org.apache.cxf:cxf-codegen-plugin:2.7.4:wsdl2java (generate-sources) on
> project mas-wsmodel-lineup-v2: Execution generate-sources of goal
> org.apache.cxf:cxf-codegen-plugin:2.7.4:wsdl2java failed.
> 	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.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:319)
> 	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:39)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	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
> generate-sources of goal org.apache.cxf:cxf-codegen-plugin:2.7.4:wsdl2java
> failed.
> 	at
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
> 	at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
> 	... 19 more
> Caused by: java.lang.NullPointerException
> 	at java.util.Hashtable.put(Hashtable.java:394)
> 	at java.util.Properties.setProperty(Properties.java:143)
> 	at java.lang.System.setProperty(System.java:729)
> 	at
> org.apache.cxf.maven_plugin.ClassLoaderSwitcher.restoreClassLoader(ClassLoaderSwitcher.java:121)
> 	at
> org.apache.cxf.maven_plugin.AbstractCodegenMoho.execute(AbstractCodegenMoho.java:325)
> 	at
> org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:524)
> 	at
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
> 
> Here is my parent pom snippet:
> 
>               <artifactId>cxf-codegen-plugin</artifactId>
>               <groupId>org.apache.cxf</groupId>
>               <version>2.7.4</version>
> ...
>               <configuration>
>                  <defaultOptions>
>                     <extraargs>
>                        <extraarg>-verbose</extraarg>
>                        <extraarg>-validate</extraarg>
> 
> 
> <extraarg>-xjc-Xts:style:org.apache.commons.lang.builder.ToStringStyle.DEFAULT_STYLE</extraarg>
>                     </extraargs>
>                  </defaultOptions>
>               </configuration>
>               <executions>
>                  <execution>
>                     <id>generate-sources</id>
>                     <phase>generate-sources</phase>
>                     <goals>
>                        <goal>wsdl2java</goal>
>                     </goals>
>                  </execution>
>               </executions>
> 
> Here is a snippet of child pom:
> 
>            <configuration>
> 
>               <wsdlOptions>
>                  <wsdlOption>
> 
> <wsdlLocation>http://${webserviceHost}:${webservicePort}/${webserviceWSDLLocationSuffix}</wsdlLocation>
>                     <wsdlArtifact>
> 
> <groupId>com.twc.mystro.mas.webservices.beans</groupId>
>                        <artifactId>${webserviceArtifactID}</artifactId>
>                        <version>${project.version}</version>
>                        <type>wsdl</type>
>                     </wsdlArtifact>
>                  </wsdlOption>
>               </wsdlOptions>
>            </configuration>
> 
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/NPE-when-upgrade-cxf-codegen-plugin-from-2-3-5-to-2-7-4-tp5727752.html
> Sent from the cxf-dev mailing list archive at Nabble.com.