You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Stadelmann Josef <jo...@axa-winterthur.ch> on 2012/06/06 18:09:10 UTC
[axis2-1.6.1] jax-ws 2.0 and JavaClassToDBCConverter of axis2-1.6.1
@Webfault is an annotation in use since JDK 6.0 ...
I understand that this class needs enhancements over time.
What I do not understand is that
org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConve
rter
has a method
private void attachWebFaultAnnotation(DescriptionBuilderComposite
composite) {
WebFault webFault = (WebFault)ConverterUtils.getAnnotation(
WebFault.class, serviceClass);
if (webFault != null) {
WebFaultAnnot webFaultAnnot =
WebFaultAnnot.createWebFaultAnnotImpl();
webFaultAnnot.setFaultBean(webFault.faultBean());
webFaultAnnot.setName(webFault.name());
webFaultAnnot.setTargetNamespace(webFault.targetNamespace());
webFaultAnnot.setMessageName(webFault.messageName());
composite.setWebFaultAnnot(webFaultAnnot);
}
which is a show stoper for an JDK 6.0 dependent environment, because the
line in red works only within a JDK 7.0 environment.
I have developed "FileNotFoundExceptionWs", a Wrapper class using the
@Webfault annotation with 3 arguments,
and all builds fine. But depoyment of this service does not work because
I run (un-endorsed) on a JDK 6.0 platform.
where the following error is thrown by Axis2-1.6.1 code as seen above.:
[INFO] Deploying JAXWS annotated class
ch.axa.spezpla.fs1.MtomFile12PortImpl as a service - MtomFileService12
[INFO] Exception creating Axis Service : null
java.lang.NoSuchMethodError:
javax.xml.ws.WebFault.messageName()Ljava/lang/String;
at
org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConve
rter.attachWebFaultAnnotation(JavaClassToDBCConverter.java:384)
at
org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConve
rter.setTypeTargettedAnnotations(JavaClassToDBCConverter.java:247)
at
org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConve
rter.introspectClass(JavaClassToDBCConverter.java:159)
at
org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConve
rter.buildDBC(JavaClassToDBCConverter.java:141)
at
org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConve
rter.produceDBC(JavaClassToDBCConverter.java:97)
at
org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createSer
viceDescription(DescriptionFactoryImpl.java:215)
at
org.apache.axis2.jaxws.description.DescriptionFactory.createAxisService(
DescriptionFactory.java:564)
at
org.apache.axis2.jaxws.framework.JAXWSDeployer.createAxisService(JAXWSDe
ployer.java:257)
at
org.apache.axis2.jaxws.framework.JAXWSDeployer.deployClasses(JAXWSDeploy
er.java:208)
at
org.apache.axis2.jaxws.framework.JAXWSDeployer.deployServicesInWARClassP
ath(JAXWSDeployer.java:106)
at
org.apache.axis2.jaxws.framework.JAXWSDeployer.init(JAXWSDeployer.java:7
8)
at
org.apache.axis2.deployment.DeploymentEngine.initializeDeployers(Deploym
entEngine.java:1166)
at
org.apache.axis2.deployment.DeploymentEngine.setConfigContext(Deployment
Engine.java:1155)
at
org.apache.axis2.deployment.WarBasedAxisConfigurator.setConfigContext(Wa
rBasedAxisConfigurator.java:349)
at
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
Context(ConfigurationContextFactory.java:89)
at
org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServle
t.java:584)
at
org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:454)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav
a:1173)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j
ava:4187)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4496
)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja
va:791)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
at
org.apache.catalina.startup.HostConfig.check(HostConfig.java:1345)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:30
3)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu
pport.java:119)
at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.j
ava:1337)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
essChildren(ContainerBase.java:1601)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
essChildren(ContainerBase.java:1610)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(
ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:662)
google for the red line and wonder how many runs into a similar problem.
endorsing helps but shifts the problem arround, and there is no
guarantee
that endorsing missing jar files adds to the robsutness of the
environment!
is there a chance to have Tomcat using the same automatic endorsment
facility as maven has when it builds and test and runs error free
org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConve
rter
???
Josef
AW: [axis2-1.6.1] jax-ws 2.0 and JavaClassToDBCConverter of axis2-1.6.1
Posted by Stadelmann Josef <jo...@axa-winterthur.ch>.
Hi Martin
I have found the solution to my problem: it is also explained in http://weblogs.java.net/blog/ramapulavarthi/archive/2007/01/problems_using.html
I have found at C:\Program Files\NetBeans 7.1.2\java\modules\ext\jaxws22\api jaxws-api.jar with a Webfault.class providing an interface to 4 attributes.
Maybe we ask NetBeans Engineering why the have put this jaxws-api.jar to C:\Program Files\NetBeans 7.1.2\java\modules\ext\jaxws22\api, maybe
the are faced with the same problem as I am.
So for my solution to work with a @WebFault Annotation and JDK1.6
I have endorsed jaxws-api.jar to JDK1.6.0_30\jre\lib\endorsed and
I am using JAVA_ENDORSED_DIRS=%JAVA_HOME%\jre\lib\endorsed environment variables
CATALINA START then uses %JAVA_ENDORSED_DIRS% to -Djava.endorsed.dirs=. . .
in catalina.bat on my VistaPC, and then Tomcat starts using endorsed dirs prior to using the classpath with the gulty RT.JAR in it.
Longterm: I need OpenJDK on OpenVMS, or find a way to have on my server platform - Itanium - HP rx2800 i2 server (or better)
a VMware installed and have a Guest OS OpenVMS and a GuestLinux running Java e all, then have the axis2-service on Linux creating
a memory channel to am legacy code in OpenVMS Pascal ....
Josef
Von: Stadelmann Josef [mailto:josef.stadelmann@axa-winterthur.ch]
Gesendet: Montag, 11. Juni 2012 18:45
An: java-user@axis.apache.org
Betreff: AW: [axis2-1.6.1] jax-ws 2.0 and JavaClassToDBCConverter of axis2-1.6.1
Hi Martin
or everyone able to help me.
after all I have found what causes me the problem, the stack dump as shown in a previous mail. Understanding is required to develop a solution.
The problem is that rt.jar has a Webfault.calss under javax.xml.ws; (checked using $ jar tf rt.jar | grep Webfault) for both jdk1.6.0_30 and jdk1.7.0_03/jre/lib/rt.jar's
Then I extracted the two classes, one after each other, and then I used $ javap -c Webfault to see a de-compilation without any side effects of high level tools such as NetBeans!!!
The result was as such.
C:\Program Files\Java\jdk1.6.0_30\jre\lib>javap -c WebFault
Compiled from "WebFault.java"
public interface javax.xml.ws.WebFault extends java.lang.annotation.Annotation{
public abstract java.lang.String name();
public abstract java.lang.String targetNamespace();
public abstract java.lang.String faultBean();
}
C:\Program Files\Java\jdk1.7.0_03\jre\lib>javap -c WebFault
Compiled from "WebFault.java"
public interface javax.xml.ws.WebFault extends java.lang.annotation.Annotation{
public abstract java.lang.String name();
public abstract java.lang.String targetNamespace();
public abstract java.lang.String faultBean();
public abstract java.lang.String messageName();
}
As you can see the WebFault of jdk1.7 has one interface to an attribute more, and the relevant implementation WebFaultAnnot.class supports this by getters and setters is called through the use of the proper Interface class residing in rt.jar which is either jdk1.6 or jdk1.7 specific.
Our OpenVMS runs on JDK1.6 and HP does not yet provide JDK1.7, we'r just about to have a meeting tomorrow with the responsible HP Enterprise Account Manager and some experts tomorrow about a clear Java for OpenVMS road map. and other issues.
But until then . . . I think I need to endorse something. But what?
Under C:\Program Files\NetBeans 7.1.2\java\modules\ext\jaxws22\api I have found jaxws-api.jar which has a WebFault.class and extracting the WebFault.class and looking at it with javap -c WebFault shows me that this WebFault.class has 4 interfaces to Attributes while the previous NetBeans 7.1.1 comes with the same file but has a WebFault.class with only 3 interfaces to attributes. This has confused me before I realized that this classes may have some compile time effect only but at run time the class is taken from the active jre/lib/rt.jar.
That is why I can compile great but run into problems when I want to deploy my web service solution into webapps of Catalina/Tomcat, but only if it runs under jdk1.6
Question: would it be sufficient to endorse the api jar file(s) found under C:\Program Files\NetBeans 7.1.2\java\modules\ext\jaxws22\api to a jdk1.6/jre7lib/endorsed directory?
The files are
jaxws-api.jar
jsr181-api.jar
jsr250-api.jar
saaj-api.jar
because I think endorsing the full rt.jar from jdk1.7 to the jre of jdk1.6 does not work, is too much of an endorsement.
I ask this also because I do not understand what you have suggested me by packaging the FileNotFoundWs.class in a jar and endorse only this one. I am really confused with that. Because this FileNotFoundWs.class is just a wrapper which through @WebFault(name, targetnamespace, faultbean, messagename) engages further interfaces and implementations residing at the proper rt.jar or in one of the small api jars such as jaxws-api.jar delivered with NetBeans 7.1.*
Josef - very thanks full for your thoughts - and sorry if I miss a bit of understanding of java.
Von: Martin Gainty [mailto:mgainty@hotmail.com]
Gesendet: Mittwoch, 6. Juni 2012 19:43
An: java-user@axis.apache.org
Betreff: RE: [axis2-1.6.1] jax-ws 2.0 and JavaClassToDBCConverter of axis2-1.6.1
Hi Josef
If you could drop your modified FileNotFoundExceptionWs.jar into endorsed dir you can startup Tomcat with -Djava.endorsed.dirs=C:\Java\jdk1.6.0_01\jre\lib\endorsed
e.g
$CATALINA_HOME/bin/java -Djava.endorsed.dirs=/jdk1.6.0_01/jre/lib/endorsed ........ jar bootstrap.jar
does this help?
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
________________________________
Subject: [axis2-1.6.1] jax-ws 2.0 and JavaClassToDBCConverter of axis2-1.6.1
Date: Wed, 6 Jun 2012 18:09:10 +0200
From: josef.stadelmann@axa-winterthur.ch
To: axis-user@ws.apache.org
@Webfault is an annotation in use since JDK 6.0 ...
I understand that this class needs enhancements over time.
What I do not understand is that
org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter
has a method
private void attachWebFaultAnnotation(DescriptionBuilderComposite composite) {
WebFault webFault = (WebFault)ConverterUtils.getAnnotation(
WebFault.class, serviceClass);
if (webFault != null) {
WebFaultAnnot webFaultAnnot = WebFaultAnnot.createWebFaultAnnotImpl();
webFaultAnnot.setFaultBean(webFault.faultBean());
webFaultAnnot.setName(webFault.name());
webFaultAnnot.setTargetNamespace(webFault.targetNamespace());
webFaultAnnot.setMessageName(webFault.messageName());
composite.setWebFaultAnnot(webFaultAnnot);
}
which is a show stoper for an JDK 6.0 dependent environment, because the line in red works only within a JDK 7.0 environment.
I have developed "FileNotFoundExceptionWs", a Wrapper class using the @Webfault annotation with 3 arguments,
and all builds fine. But depoyment of this service does not work because I run (un-endorsed) on a JDK 6.0 platform.
where the following error is thrown by Axis2-1.6.1 code as seen above.:
[INFO] Deploying JAXWS annotated class ch.axa.spezpla.fs1.MtomFile12PortImpl as a service - MtomFileService12
[INFO] Exception creating Axis Service : null
java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String;
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.attachWebFaultAnnotation(JavaClassToDBCConverter.java:384)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.setTypeTargettedAnnotations(JavaClassToDBCConverter.java:247)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.introspectClass(JavaClassToDBCConverter.java:159)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.buildDBC(JavaClassToDBCConverter.java:141)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.produceDBC(JavaClassToDBCConverter.java:97)
at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(DescriptionFactoryImpl.java:215)
at org.apache.axis2.jaxws.description.DescriptionFactory.createAxisService(DescriptionFactory.java:564)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.createAxisService(JAXWSDeployer.java:257)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.deployClasses(JAXWSDeployer.java:208)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.deployServicesInWARClassPath(JAXWSDeployer.java:106)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.init(JAXWSDeployer.java:78)
at org.apache.axis2.deployment.DeploymentEngine.initializeDeployers(DeploymentEngine.java:1166)
at org.apache.axis2.deployment.DeploymentEngine.setConfigContext(DeploymentEngine.java:1155)
at org.apache.axis2.deployment.WarBasedAxisConfigurator.setConfigContext(WarBasedAxisConfigurator.java:349)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:89)
at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:584)
at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:454)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4187)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4496)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1345)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:662)
google for the red line and wonder how many runs into a similar problem.
endorsing helps but shifts the problem arround, and there is no guarantee
that endorsing missing jar files adds to the robsutness of the environment!
is there a chance to have Tomcat using the same automatic endorsment facility as maven has when it builds and test and runs error free
org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter
???
Josef
AW: [axis2-1.6.1] jax-ws 2.0 and JavaClassToDBCConverter of axis2-1.6.1
Posted by Stadelmann Josef <jo...@axa-winterthur.ch>.
Hi Martin
or everyone able to help me.
after all I have found what causes me the problem, the stack dump as shown in a previous mail. Understanding is required to develop a solution.
The problem is that rt.jar has a Webfault.calss under javax.xml.ws; (checked using $ jar tf rt.jar | grep Webfault) for both jdk1.6.0_30 and jdk1.7.0_03/jre/lib/rt.jar's
Then I extracted the two classes, one after each other, and then I used $ javap -c Webfault to see a de-compilation without any side effects of high level tools such as NetBeans!!!
The result was as such.
C:\Program Files\Java\jdk1.6.0_30\jre\lib>javap -c WebFault
Compiled from "WebFault.java"
public interface javax.xml.ws.WebFault extends java.lang.annotation.Annotation{
public abstract java.lang.String name();
public abstract java.lang.String targetNamespace();
public abstract java.lang.String faultBean();
}
C:\Program Files\Java\jdk1.7.0_03\jre\lib>javap -c WebFault
Compiled from "WebFault.java"
public interface javax.xml.ws.WebFault extends java.lang.annotation.Annotation{
public abstract java.lang.String name();
public abstract java.lang.String targetNamespace();
public abstract java.lang.String faultBean();
public abstract java.lang.String messageName();
}
As you can see the WebFault of jdk1.7 has one interface to an attribute more, and the relevant implementation WebFaultAnnot.class supports this by getters and setters is called through the use of the proper Interface class residing in rt.jar which is either jdk1.6 or jdk1.7 specific.
Our OpenVMS runs on JDK1.6 and HP does not yet provide JDK1.7, we'r just about to have a meeting tomorrow with the responsible HP Enterprise Account Manager and some experts tomorrow about a clear Java for OpenVMS road map. and other issues.
But until then . . . I think I need to endorse something. But what?
Under C:\Program Files\NetBeans 7.1.2\java\modules\ext\jaxws22\api I have found jaxws-api.jar which has a WebFault.class and extracting the WebFault.class and looking at it with javap -c WebFault shows me that this WebFault.class has 4 interfaces to Attributes while the previous NetBeans 7.1.1 comes with the same file but has a WebFault.class with only 3 interfaces to attributes. This has confused me before I realized that this classes may have some compile time effect only but at run time the class is taken from the active jre/lib/rt.jar.
That is why I can compile great but run into problems when I want to deploy my web service solution into webapps of Catalina/Tomcat, but only if it runs under jdk1.6
Question: would it be sufficient to endorse the api jar file(s) found under C:\Program Files\NetBeans 7.1.2\java\modules\ext\jaxws22\api to a jdk1.6/jre7lib/endorsed directory?
The files are
jaxws-api.jar
jsr181-api.jar
jsr250-api.jar
saaj-api.jar
because I think endorsing the full rt.jar from jdk1.7 to the jre of jdk1.6 does not work, is too much of an endorsement.
I ask this also because I do not understand what you have suggested me by packaging the FileNotFoundWs.class in a jar and endorse only this one. I am really confused with that. Because this FileNotFoundWs.class is just a wrapper which through @WebFault(name, targetnamespace, faultbean, messagename) engages further interfaces and implementations residing at the proper rt.jar or in one of the small api jars such as jaxws-api.jar delivered with NetBeans 7.1.*
Josef - very thanks full for your thoughts - and sorry if I miss a bit of understanding of java.
Von: Martin Gainty [mailto:mgainty@hotmail.com]
Gesendet: Mittwoch, 6. Juni 2012 19:43
An: java-user@axis.apache.org
Betreff: RE: [axis2-1.6.1] jax-ws 2.0 and JavaClassToDBCConverter of axis2-1.6.1
Hi Josef
If you could drop your modified FileNotFoundExceptionWs.jar into endorsed dir you can startup Tomcat with -Djava.endorsed.dirs=C:\Java\jdk1.6.0_01\jre\lib\endorsed
e.g
$CATALINA_HOME/bin/java -Djava.endorsed.dirs=/jdk1.6.0_01/jre/lib/endorsed ........ jar bootstrap.jar
does this help?
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
________________________________
Subject: [axis2-1.6.1] jax-ws 2.0 and JavaClassToDBCConverter of axis2-1.6.1
Date: Wed, 6 Jun 2012 18:09:10 +0200
From: josef.stadelmann@axa-winterthur.ch
To: axis-user@ws.apache.org
@Webfault is an annotation in use since JDK 6.0 ...
I understand that this class needs enhancements over time.
What I do not understand is that
org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter
has a method
private void attachWebFaultAnnotation(DescriptionBuilderComposite composite) {
WebFault webFault = (WebFault)ConverterUtils.getAnnotation(
WebFault.class, serviceClass);
if (webFault != null) {
WebFaultAnnot webFaultAnnot = WebFaultAnnot.createWebFaultAnnotImpl();
webFaultAnnot.setFaultBean(webFault.faultBean());
webFaultAnnot.setName(webFault.name());
webFaultAnnot.setTargetNamespace(webFault.targetNamespace());
webFaultAnnot.setMessageName(webFault.messageName());
composite.setWebFaultAnnot(webFaultAnnot);
}
which is a show stoper for an JDK 6.0 dependent environment, because the line in red works only within a JDK 7.0 environment.
I have developed "FileNotFoundExceptionWs", a Wrapper class using the @Webfault annotation with 3 arguments,
and all builds fine. But depoyment of this service does not work because I run (un-endorsed) on a JDK 6.0 platform.
where the following error is thrown by Axis2-1.6.1 code as seen above.:
[INFO] Deploying JAXWS annotated class ch.axa.spezpla.fs1.MtomFile12PortImpl as a service - MtomFileService12
[INFO] Exception creating Axis Service : null
java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String;
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.attachWebFaultAnnotation(JavaClassToDBCConverter.java:384)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.setTypeTargettedAnnotations(JavaClassToDBCConverter.java:247)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.introspectClass(JavaClassToDBCConverter.java:159)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.buildDBC(JavaClassToDBCConverter.java:141)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.produceDBC(JavaClassToDBCConverter.java:97)
at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(DescriptionFactoryImpl.java:215)
at org.apache.axis2.jaxws.description.DescriptionFactory.createAxisService(DescriptionFactory.java:564)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.createAxisService(JAXWSDeployer.java:257)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.deployClasses(JAXWSDeployer.java:208)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.deployServicesInWARClassPath(JAXWSDeployer.java:106)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.init(JAXWSDeployer.java:78)
at org.apache.axis2.deployment.DeploymentEngine.initializeDeployers(DeploymentEngine.java:1166)
at org.apache.axis2.deployment.DeploymentEngine.setConfigContext(DeploymentEngine.java:1155)
at org.apache.axis2.deployment.WarBasedAxisConfigurator.setConfigContext(WarBasedAxisConfigurator.java:349)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:89)
at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:584)
at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:454)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4187)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4496)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1345)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:662)
google for the red line and wonder how many runs into a similar problem.
endorsing helps but shifts the problem arround, and there is no guarantee
that endorsing missing jar files adds to the robsutness of the environment!
is there a chance to have Tomcat using the same automatic endorsment facility as maven has when it builds and test and runs error free
org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter
???
Josef
AW: [axis2-1.6.1] jax-ws 2.0 and JavaClassToDBCConverter of axis2-1.6.1
Posted by Stadelmann Josef <jo...@axa-winterthur.ch>.
Hi Martin
I have found the reason for my problem;
The class WebFaultAnnot is the implementation-class of the interface WebFault.class;
The class WebFaultAnnot from axis2 implements 4 setters and getters to 4 fields.
AND it is therefore required that the interface WebFault.class match this implementation class.
This is for JDK6.0 not the case.
But
This is the case for JDK7.0
The interface-class Webfault, delivered with the package package javax.xml.ws from Sun
delivers operations to access only 3 of the 4 fields with JDK 6.0.
but with JDK7.0 the Webfault.class delivers operations to access all 4 fields.
That is the reason why the statement in Axis2-1.6.1
webFaultAnnot.setMessageName(webFault.messageName());
causes an Exception as shown below, because webFault.messageName() does not exists in the WebFault interface class delivered with JDK 6.0.
Now, which jar file do I have to endorse from JDK 7.0 over JDK 6.0? Which jar file do I have to bring into ./jre/lib/endorsed? For JAVA, and for Tomcats VM.
My answer: It is the jar file which keeps the Interface WebFault.class.
Now - I have only to find the proper name of the jar file to take this hurdle.
Josef
Von: Martin Gainty [mailto:mgainty@hotmail.com]
Gesendet: Mittwoch, 6. Juni 2012 19:43
An: java-user@axis.apache.org
Betreff: RE: [axis2-1.6.1] jax-ws 2.0 and JavaClassToDBCConverter of axis2-1.6.1
Hi Josef
If you could drop your modified FileNotFoundExceptionWs.jar into endorsed dir you can startup Tomcat with -Djava.endorsed.dirs=C:\Java\jdk1.6.0_01\jre\lib\endorsed
e.g
$CATALINA_HOME/bin/java -Djava.endorsed.dirs=/jdk1.6.0_01/jre/lib/endorsed ........ jar bootstrap.jar
does this help?
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
________________________________
Subject: [axis2-1.6.1] jax-ws 2.0 and JavaClassToDBCConverter of axis2-1.6.1
Date: Wed, 6 Jun 2012 18:09:10 +0200
From: josef.stadelmann@axa-winterthur.ch
To: axis-user@ws.apache.org
@Webfault is an annotation in use since JDK 6.0 ...
I understand that this class needs enhancements over time.
What I do not understand is that
org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter
has a method
private void attachWebFaultAnnotation(DescriptionBuilderComposite composite) {
WebFault webFault = (WebFault)ConverterUtils.getAnnotation(
WebFault.class, serviceClass);
if (webFault != null) {
WebFaultAnnot webFaultAnnot = WebFaultAnnot.createWebFaultAnnotImpl();
webFaultAnnot.setFaultBean(webFault.faultBean());
webFaultAnnot.setName(webFault.name());
webFaultAnnot.setTargetNamespace(webFault.targetNamespace());
webFaultAnnot.setMessageName(webFault.messageName());
composite.setWebFaultAnnot(webFaultAnnot);
}
which is a show stoper for an JDK 6.0 dependent environment, because the line in red works only within a JDK 7.0 environment.
I have developed "FileNotFoundExceptionWs", a Wrapper class using the @Webfault annotation with 3 arguments,
and all builds fine. But depoyment of this service does not work because I run (un-endorsed) on a JDK 6.0 platform.
where the following error is thrown by Axis2-1.6.1 code as seen above.:
[INFO] Deploying JAXWS annotated class ch.axa.spezpla.fs1.MtomFile12PortImpl as a service - MtomFileService12
[INFO] Exception creating Axis Service : null
java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String;
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.attachWebFaultAnnotation(JavaClassToDBCConverter.java:384)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.setTypeTargettedAnnotations(JavaClassToDBCConverter.java:247)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.introspectClass(JavaClassToDBCConverter.java:159)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.buildDBC(JavaClassToDBCConverter.java:141)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.produceDBC(JavaClassToDBCConverter.java:97)
at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(DescriptionFactoryImpl.java:215)
at org.apache.axis2.jaxws.description.DescriptionFactory.createAxisService(DescriptionFactory.java:564)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.createAxisService(JAXWSDeployer.java:257)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.deployClasses(JAXWSDeployer.java:208)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.deployServicesInWARClassPath(JAXWSDeployer.java:106)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.init(JAXWSDeployer.java:78)
at org.apache.axis2.deployment.DeploymentEngine.initializeDeployers(DeploymentEngine.java:1166)
at org.apache.axis2.deployment.DeploymentEngine.setConfigContext(DeploymentEngine.java:1155)
at org.apache.axis2.deployment.WarBasedAxisConfigurator.setConfigContext(WarBasedAxisConfigurator.java:349)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:89)
at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:584)
at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:454)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4187)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4496)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1345)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:662)
google for the red line and wonder how many runs into a similar problem.
endorsing helps but shifts the problem arround, and there is no guarantee
that endorsing missing jar files adds to the robsutness of the environment!
is there a chance to have Tomcat using the same automatic endorsment facility as maven has when it builds and test and runs error free
org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter
???
Josef
AW: [axis2-1.6.1] jax-ws 2.0 and JavaClassToDBCConverter of axis2-1.6.1
Posted by Stadelmann Josef <jo...@axa-winterthur.ch>.
Martin,
May I ask you: where is the Interface @WebFault actually implemented?
that is to say, in which jar file is the implementation class located.
Which artifact do I have to endorse to the JDK 1.6 that this implementation is found at run time?
When I run my code under JDK 1.7 all is OK
When I run it under JDK 1.6 I get the reported MethodNotFound Exception (reported too by 1000's of users in google)
And each time I am using Axis2-1.6.1
Josef
Von: Stadelmann Josef [mailto:josef.stadelmann@axa-winterthur.ch]
Gesendet: Donnerstag, 7. Juni 2012 11:26
An: java-user@axis.apache.org
Betreff: AW: [axis2-1.6.1] jax-ws 2.0 and JavaClassToDBCConverter of axis2-1.6.1
Martin,
Thank you.
My FileNotFoundException Wrapper starts with
@Webfault(name="FileNotFoundExceptionWs", targetNamespace="/ch.axa.spezpla.fs1/", faultBean="")
The implementation of WebFault under JDK 6.0 takes 3 arguments see above, while WebFault under JDK 7.0 takes 4 arguments
@Webfault(name="FileNotFoundExceptionWs", targetNamespace="/ch.axa.spezpla.fs1/", faultBean="", messageName="")
It compiles under 6.0 because WebFault is in fact an interface only delivered with JDK.60 and it has a implementation somewhere in JDK 6.0 as well using only 3 arguments.
The guilty in my mind is axis2's JavaClassToDBCConverter class which tries to set the messageName attribute through the WebFault Interface. It fails as shown below.
Martin, I never used endorsements myself unless exactly told how to do it. For me endorsements are something like a patch and not a midterm robust solution.
I do not understand why I a shall package my FileNotFoundExceptionWs class belonging to my FileService WebService up/download solution into a jar and then put that jar into the jre/lib/endorsement directory of my JDK6.0 environment. I would assume, as read on several places, having exact the same problem, Google shows 1010 entries for this bug, that I have to seek the JDK7.0 jar file which implements the WebFault class and place this JDK7.0 jar file into jre/lib/endorsed directory.
NOW - I am confused, and hope you can help me , can you clarify this.
I expect from endorsement that Axis2's JavaClassToDBCConverter finds the proper class in a jar file in the endorsement directory.
Josef
Von: Martin Gainty [mailto:mgainty@hotmail.com]
Gesendet: Mittwoch, 6. Juni 2012 19:43
An: java-user@axis.apache.org
Betreff: RE: [axis2-1.6.1] jax-ws 2.0 and JavaClassToDBCConverter of axis2-1.6.1
Hi Josef
If you could drop your modified FileNotFoundExceptionWs.jar into endorsed dir you can startup Tomcat with -Djava.endorsed.dirs=C:\Java\jdk1.6.0_01\jre\lib\endorsed
e.g
$CATALINA_HOME/bin/java -Djava.endorsed.dirs=/jdk1.6.0_01/jre/lib/endorsed ........ jar bootstrap.jar
does this help?
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
________________________________
Subject: [axis2-1.6.1] jax-ws 2.0 and JavaClassToDBCConverter of axis2-1.6.1
Date: Wed, 6 Jun 2012 18:09:10 +0200
From: josef.stadelmann@axa-winterthur.ch
To: axis-user@ws.apache.org
@Webfault is an annotation in use since JDK 6.0 ...
I understand that this class needs enhancements over time.
What I do not understand is that
org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter
has a method
private void attachWebFaultAnnotation(DescriptionBuilderComposite composite) {
WebFault webFault = (WebFault)ConverterUtils.getAnnotation(
WebFault.class, serviceClass);
if (webFault != null) {
WebFaultAnnot webFaultAnnot = WebFaultAnnot.createWebFaultAnnotImpl();
webFaultAnnot.setFaultBean(webFault.faultBean());
webFaultAnnot.setName(webFault.name());
webFaultAnnot.setTargetNamespace(webFault.targetNamespace());
webFaultAnnot.setMessageName(webFault.messageName());
composite.setWebFaultAnnot(webFaultAnnot);
}
which is a show stoper for an JDK 6.0 dependent environment, because the line in red works only within a JDK 7.0 environment.
I have developed "FileNotFoundExceptionWs", a Wrapper class using the @Webfault annotation with 3 arguments,
and all builds fine. But depoyment of this service does not work because I run (un-endorsed) on a JDK 6.0 platform.
where the following error is thrown by Axis2-1.6.1 code as seen above.:
[INFO] Deploying JAXWS annotated class ch.axa.spezpla.fs1.MtomFile12PortImpl as a service - MtomFileService12
[INFO] Exception creating Axis Service : null
java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String;
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.attachWebFaultAnnotation(JavaClassToDBCConverter.java:384)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.setTypeTargettedAnnotations(JavaClassToDBCConverter.java:247)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.introspectClass(JavaClassToDBCConverter.java:159)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.buildDBC(JavaClassToDBCConverter.java:141)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.produceDBC(JavaClassToDBCConverter.java:97)
at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(DescriptionFactoryImpl.java:215)
at org.apache.axis2.jaxws.description.DescriptionFactory.createAxisService(DescriptionFactory.java:564)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.createAxisService(JAXWSDeployer.java:257)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.deployClasses(JAXWSDeployer.java:208)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.deployServicesInWARClassPath(JAXWSDeployer.java:106)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.init(JAXWSDeployer.java:78)
at org.apache.axis2.deployment.DeploymentEngine.initializeDeployers(DeploymentEngine.java:1166)
at org.apache.axis2.deployment.DeploymentEngine.setConfigContext(DeploymentEngine.java:1155)
at org.apache.axis2.deployment.WarBasedAxisConfigurator.setConfigContext(WarBasedAxisConfigurator.java:349)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:89)
at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:584)
at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:454)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4187)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4496)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1345)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:662)
google for the red line and wonder how many runs into a similar problem.
endorsing helps but shifts the problem arround, and there is no guarantee
that endorsing missing jar files adds to the robsutness of the environment!
is there a chance to have Tomcat using the same automatic endorsment facility as maven has when it builds and test and runs error free
org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter
???
Josef
AW: [axis2-1.6.1] jax-ws 2.0 and JavaClassToDBCConverter of axis2-1.6.1
Posted by Stadelmann Josef <jo...@axa-winterthur.ch>.
Martin,
Thank you.
My FileNotFoundException Wrapper starts with
@Webfault(name="FileNotFoundExceptionWs", targetNamespace="/ch.axa.spezpla.fs1/", faultBean="")
The implementation of WebFault under JDK 6.0 takes 3 arguments see above, while WebFault under JDK 7.0 takes 4 arguments
@Webfault(name="FileNotFoundExceptionWs", targetNamespace="/ch.axa.spezpla.fs1/", faultBean="", messageName="")
It compiles under 6.0 because WebFault is in fact an interface only delivered with JDK.60 and it has a implementation somewhere in JDK 6.0 as well using only 3 arguments.
The guilty in my mind is axis2's JavaClassToDBCConverter class which tries to set the messageName attribute through the WebFault Interface. It fails as shown below.
Martin, I never used endorsements myself unless exactly told how to do it. For me endorsements are something like a patch and not a midterm robust solution.
I do not understand why I a shall package my FileNotFoundExceptionWs class belonging to my FileService WebService up/download solution into a jar and then put that jar into the jre/lib/endorsement directory of my JDK6.0 environment. I would assume, as read on several places, having exact the same problem, Google shows 1010 entries for this bug, that I have to seek the JDK7.0 jar file which implements the WebFault class and place this JDK7.0 jar file into jre/lib/endorsed directory.
NOW - I am confused, and hope you can help me , can you clarify this.
I expect from endorsement that Axis2's JavaClassToDBCConverter finds the proper class in a jar file in the endorsement directory.
Josef
Von: Martin Gainty [mailto:mgainty@hotmail.com]
Gesendet: Mittwoch, 6. Juni 2012 19:43
An: java-user@axis.apache.org
Betreff: RE: [axis2-1.6.1] jax-ws 2.0 and JavaClassToDBCConverter of axis2-1.6.1
Hi Josef
If you could drop your modified FileNotFoundExceptionWs.jar into endorsed dir you can startup Tomcat with -Djava.endorsed.dirs=C:\Java\jdk1.6.0_01\jre\lib\endorsed
e.g
$CATALINA_HOME/bin/java -Djava.endorsed.dirs=/jdk1.6.0_01/jre/lib/endorsed ........ jar bootstrap.jar
does this help?
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
________________________________
Subject: [axis2-1.6.1] jax-ws 2.0 and JavaClassToDBCConverter of axis2-1.6.1
Date: Wed, 6 Jun 2012 18:09:10 +0200
From: josef.stadelmann@axa-winterthur.ch
To: axis-user@ws.apache.org
@Webfault is an annotation in use since JDK 6.0 ...
I understand that this class needs enhancements over time.
What I do not understand is that
org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter
has a method
private void attachWebFaultAnnotation(DescriptionBuilderComposite composite) {
WebFault webFault = (WebFault)ConverterUtils.getAnnotation(
WebFault.class, serviceClass);
if (webFault != null) {
WebFaultAnnot webFaultAnnot = WebFaultAnnot.createWebFaultAnnotImpl();
webFaultAnnot.setFaultBean(webFault.faultBean());
webFaultAnnot.setName(webFault.name());
webFaultAnnot.setTargetNamespace(webFault.targetNamespace());
webFaultAnnot.setMessageName(webFault.messageName());
composite.setWebFaultAnnot(webFaultAnnot);
}
which is a show stoper for an JDK 6.0 dependent environment, because the line in red works only within a JDK 7.0 environment.
I have developed "FileNotFoundExceptionWs", a Wrapper class using the @Webfault annotation with 3 arguments,
and all builds fine. But depoyment of this service does not work because I run (un-endorsed) on a JDK 6.0 platform.
where the following error is thrown by Axis2-1.6.1 code as seen above.:
[INFO] Deploying JAXWS annotated class ch.axa.spezpla.fs1.MtomFile12PortImpl as a service - MtomFileService12
[INFO] Exception creating Axis Service : null
java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String;
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.attachWebFaultAnnotation(JavaClassToDBCConverter.java:384)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.setTypeTargettedAnnotations(JavaClassToDBCConverter.java:247)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.introspectClass(JavaClassToDBCConverter.java:159)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.buildDBC(JavaClassToDBCConverter.java:141)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.produceDBC(JavaClassToDBCConverter.java:97)
at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(DescriptionFactoryImpl.java:215)
at org.apache.axis2.jaxws.description.DescriptionFactory.createAxisService(DescriptionFactory.java:564)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.createAxisService(JAXWSDeployer.java:257)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.deployClasses(JAXWSDeployer.java:208)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.deployServicesInWARClassPath(JAXWSDeployer.java:106)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.init(JAXWSDeployer.java:78)
at org.apache.axis2.deployment.DeploymentEngine.initializeDeployers(DeploymentEngine.java:1166)
at org.apache.axis2.deployment.DeploymentEngine.setConfigContext(DeploymentEngine.java:1155)
at org.apache.axis2.deployment.WarBasedAxisConfigurator.setConfigContext(WarBasedAxisConfigurator.java:349)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:89)
at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:584)
at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:454)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4187)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4496)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1345)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:662)
google for the red line and wonder how many runs into a similar problem.
endorsing helps but shifts the problem arround, and there is no guarantee
that endorsing missing jar files adds to the robsutness of the environment!
is there a chance to have Tomcat using the same automatic endorsment facility as maven has when it builds and test and runs error free
org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter
???
Josef
RE: [axis2-1.6.1] jax-ws 2.0 and JavaClassToDBCConverter of
axis2-1.6.1
Posted by Martin Gainty <mg...@hotmail.com>.
Hi Josef
If you could drop your modified FileNotFoundExceptionWs.jar into endorsed dir you can startup Tomcat with -Djava.endorsed.dirs=C:\Java\jdk1.6.0_01\jre\lib\endorsede.g
$CATALINA_HOME/bin/java -Djava.endorsed.dirs=/jdk1.6.0_01/jre/lib/endorsed ........ jar bootstrap.jar
does this help?
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
Subject: [axis2-1.6.1] jax-ws 2.0 and JavaClassToDBCConverter of axis2-1.6.1
Date: Wed, 6 Jun 2012 18:09:10 +0200
From: josef.stadelmann@axa-winterthur.ch
To: axis-user@ws.apache.org
[axis2-1.6.1] jax-ws 2.0 and JavaClassToDBCConverter of axis2-1.6.1
@Webfault is an annotation in use since JDK 6.0 …
I understand that this class needs enhancements over time.
What I do not understand is that
org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter
has a method
private void attachWebFaultAnnotation(DescriptionBuilderComposite composite) {
WebFault webFault = (WebFault)ConverterUtils.getAnnotation(
WebFault.class, serviceClass);
if (webFault != null) {
WebFaultAnnot webFaultAnnot = WebFaultAnnot.createWebFaultAnnotImpl();
webFaultAnnot.setFaultBean(webFault.faultBean());
webFaultAnnot.setName(webFault.name());
webFaultAnnot.setTargetNamespace(webFault.targetNamespace());
webFaultAnnot.setMessageName(webFault.messageName());
composite.setWebFaultAnnot(webFaultAnnot);
}
which is a show stoper for an JDK 6.0 dependent environment, because the line in red works only within a JDK 7.0 environment.
I have developed "FileNotFoundExceptionWs", a Wrapper class using the @Webfault annotation with 3 arguments,
and all builds fine. But depoyment of this service does not work because I run (un-endorsed) on a JDK 6.0 platform.
where the following error is thrown by Axis2-1.6.1 code as seen above.:
[INFO] Deploying JAXWS annotated class ch.axa.spezpla.fs1.MtomFile12PortImpl as a service - MtomFileService12
[INFO] Exception creating Axis Service : null
java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String;
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.attachWebFaultAnnotation(JavaClassToDBCConverter.java:384)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.setTypeTargettedAnnotations(JavaClassToDBCConverter.java:247)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.introspectClass(JavaClassToDBCConverter.java:159)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.buildDBC(JavaClassToDBCConverter.java:141)
at org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter.produceDBC(JavaClassToDBCConverter.java:97)
at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(DescriptionFactoryImpl.java:215)
at org.apache.axis2.jaxws.description.DescriptionFactory.createAxisService(DescriptionFactory.java:564)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.createAxisService(JAXWSDeployer.java:257)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.deployClasses(JAXWSDeployer.java:208)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.deployServicesInWARClassPath(JAXWSDeployer.java:106)
at org.apache.axis2.jaxws.framework.JAXWSDeployer.init(JAXWSDeployer.java:78)
at org.apache.axis2.deployment.DeploymentEngine.initializeDeployers(DeploymentEngine.java:1166)
at org.apache.axis2.deployment.DeploymentEngine.setConfigContext(DeploymentEngine.java:1155)
at org.apache.axis2.deployment.WarBasedAxisConfigurator.setConfigContext(WarBasedAxisConfigurator.java:349)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:89)
at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:584)
at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:454)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4187)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4496)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1345)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:662)
google for the red line and wonder how many runs into a similar problem.
endorsing helps but shifts the problem arround, and there is no guarantee
that endorsing missing jar files adds to the robsutness of the environment!
is there a chance to have Tomcat using the same automatic endorsment facility as maven has when it builds and test and runs error free
org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter
???
Josef