You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "laudio.info" <la...@gmail.com> on 2013/01/27 02:58:58 UTC

maven jax-ws and jdk7. help please

hello
i have made several Ws using maven, jaxws and jdk6
usin jdk 7 appears one privilegedActionException
i am working with this problem 7 days and i don't know how to solve it.
Can you help me please?
thanks

my pom is this:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.caf.ws</groupId>
  <artifactId>myWS</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>
  <build>
<plugins>
 <plugin>
 <artifactId>maven-war-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>1.12</version>
<executions>
<execution>
<id>wsgen</id>
<goals>
<goal>wsgen</goal>
</goals>
<configuration>
<sei>
com.myproject.mywsimpl
</sei>
<genWsdl>true</genWsdl>
<keep>true</keep>
<verbose>true</verbose>
</configuration>
</execution>
</executions>
</plugin>
    </plugins>
  </build>
  <dependencies>
  <dependency>
  <groupId>com.sun.xml.ws</groupId>
  <artifactId>jaxws-rt</artifactId>
  <version>2.2.7</version>
  </dependency>
  </dependencies>
</project>

And the error is this:
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2.150s
[INFO] Finished at: Sun Jan 27 02:52:58 CET 2013
[INFO] Final Memory: 20M/182M
[INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.codehaus.mojo:jaxws-maven-plugin:1.12:wsgen (wsgen) on project
MyWebServiceWar: Failed to execute wsgen: Unable to create JAXBContext:
PrivilegedActionException: 1 counts of IllegalAnnotationExceptions -> [Help
1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute
goal org.codehaus.mojo:jaxws-maven-plugin:1.12:wsgen (wsgen) on project
MyWebServiceWar: Failed to execute wsgen
 at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
 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.MojoExecutionException: Failed to
execute wsgen
 at
org.codehaus.mojo.jaxws.AbstractWsGenMojo.execute(AbstractWsGenMojo.java:102)
 at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
 at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
 ... 19 more
Caused by: javax.xml.ws.WebServiceException: Unable to create JAXBContext
 at
com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:164)
 at
com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:94)
 at
com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:255)
 at com.sun.tools.ws.wscompile.WsgenTool.buildModel(WsgenTool.java:240)
 at com.sun.tools.ws.wscompile.WsgenTool.run(WsgenTool.java:123)
 at com.sun.tools.ws.WsGen.doMain(WsGen.java:69)
 at
org.codehaus.mojo.jaxws.AbstractWsGenMojo.execute(AbstractWsGenMojo.java:97)
 ... 21 more
Caused by: java.security.PrivilegedActionException:
com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of
IllegalAnnotationExceptions
java.lang.StackTraceElement does not have a no-arg default constructor.
 this problem is related to the following location:
  at java.lang.StackTraceElement
  at public java.lang.StackTraceElement[]
java.lang.Throwable.getStackTrace()
  at java.lang.Throwable
  at private java.lang.Throwable[]
com.myproject.jaxws.ExceptionBean.suppressed
  at com.myproject.prototype.ws.impl.jaxws.ExceptionBean
 at java.security.AccessController.doPrivileged(Native Method)
 at
com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:151)
 ... 27 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1
counts of IllegalAnnotationExceptions
java.lang.StackTraceElement does not have a no-arg default constructor.
 this problem is related to the following location:
  at java.lang.StackTraceElement
  at public java.lang.StackTraceElement[]
java.lang.Throwable.getStackTrace()
  at java.lang.Throwable
  at private java.lang.Throwable[]
com.myproject.prototype.ws.impl.jaxws.ExceptionBean.suppressed
  at com.myproject.prototype.ws.impl.jaxws.ExceptionBean
 at
com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102)
 at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:447)
 at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:288)
 at
com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1111)
 at
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
 at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:106)
 at
com.sun.xml.ws.developer.JAXBContextFactory$1.createJAXBContext(JAXBContextFactory.java:109)
 at
com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:159)
 at
com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:152)
 ... 29 more

AW: maven jax-ws and jdk7. help please

Posted by Stadelmann Josef <jo...@axa-winterthur.ch>.
I fully support that! 
I had a nightmare with Axis2-1.6.2 and JDK1.6.0_30
when it comes to use jax-ws and jaxb with "ALLOWED ANNOTATIONS";

Axis-1.6.2 has a jax-ws interface which knows about 4 args to some annotations,
so the compiler had absolute no problem. But then JDK 1.6.0_30 RT.jar has only 
an implementation for 3 args to be set on a annotation class, hence 
calling through the interface the 4 arg to be set, returnd a class not found 
exception.

The cure was to endorse from JDK 1.7 into JDK1.6.0_30/jre/lib/endorsed 
the proper jar files; This works now for us very well for Vista and OpenVMS

Josef 



-----Ursprüngliche Nachricht-----
Von: Jörg Schaible [mailto:Joerg.Schaible@scalaris.com] 
Gesendet: Montag, 28. Januar 2013 10:37
An: users@maven.apache.org
Betreff: Re: maven jax-ws and jdk7. help please

laudio.info wrote:

> Thanks
> 
> I have seen that, using the same java code and the same configuration, 
> the problem appears if i use the jdk7. Using the jdk there is not 
> problem

The jaxws plugin does not respect the compiler settings for source/target. 
On top of it, the exception has additional info since JDK 7, so any code that uses reflection to map an exception class to something else, will be affected by the different Java runtime. AFAICS JAXB is such a tool.

Nothing of this has to do with Maven directly though.

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven jax-ws and jdk7. help please

Posted by Jörg Schaible <Jo...@scalaris.com>.
laudio.info wrote:

> Thanks
> 
> I have seen that, using the same java code and the same configuration, the
> problem appears if i use the jdk7. Using the jdk there is not problem

The jaxws plugin does not respect the compiler settings for source/target. 
On top of it, the exception has additional info since JDK 7, so any code 
that uses reflection to map an exception class to something else, will be 
affected by the different Java runtime. AFAICS JAXB is such a tool.

Nothing of this has to do with Maven directly though.

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven jax-ws and jdk7. help please

Posted by Anders Hammar <an...@hammar.net>.
Most likely due to different version of some framework (jaxb?) being used.

/Anders


On Mon, Jan 28, 2013 at 8:58 AM, laudio.info <la...@gmail.com> wrote:

> Thanks
>
> I have seen that, using the same java code and the same configuration, the
> problem appears if i use the jdk7. Using the jdk there is not problem
>
>
> 2013/1/27 Wayne Fay <wa...@gmail.com>
>
> > > Caused by: java.security.PrivilegedActionException:
> > > com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of
> > > IllegalAnnotationExceptions
> > > java.lang.StackTraceElement does not have a no-arg default constructor.
> >
> > This seems to be the root cause of your problem. I would start
> > removing your Webservices one by one until you figure out which one is
> > causing this error to be thrown. Then compare it to the others you are
> > building with no issues.
> >
> > Also I'd take this question to a Java Webservices forum or mailing
> > list, as this really has nothing to do with Maven.
> >
> > Wayne
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: maven jax-ws and jdk7. help please

Posted by "laudio.info" <la...@gmail.com>.
Thanks

I have seen that, using the same java code and the same configuration, the
problem appears if i use the jdk7. Using the jdk there is not problem


2013/1/27 Wayne Fay <wa...@gmail.com>

> > Caused by: java.security.PrivilegedActionException:
> > com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of
> > IllegalAnnotationExceptions
> > java.lang.StackTraceElement does not have a no-arg default constructor.
>
> This seems to be the root cause of your problem. I would start
> removing your Webservices one by one until you figure out which one is
> causing this error to be thrown. Then compare it to the others you are
> building with no issues.
>
> Also I'd take this question to a Java Webservices forum or mailing
> list, as this really has nothing to do with Maven.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: maven jax-ws and jdk7. help please

Posted by Wayne Fay <wa...@gmail.com>.
> Caused by: java.security.PrivilegedActionException:
> com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of
> IllegalAnnotationExceptions
> java.lang.StackTraceElement does not have a no-arg default constructor.

This seems to be the root cause of your problem. I would start
removing your Webservices one by one until you figure out which one is
causing this error to be thrown. Then compare it to the others you are
building with no issues.

Also I'd take this question to a Java Webservices forum or mailing
list, as this really has nothing to do with Maven.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org