Return-Path: X-Original-To: apmail-axis-java-dev-archive@www.apache.org Delivered-To: apmail-axis-java-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 90DF59F37 for ; Mon, 2 Apr 2012 15:52:33 +0000 (UTC) Received: (qmail 94365 invoked by uid 500); 2 Apr 2012 15:52:32 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 94223 invoked by uid 500); 2 Apr 2012 15:52:32 -0000 Mailing-List: contact java-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@axis.apache.org Delivered-To: mailing list java-dev@axis.apache.org Received: (qmail 94204 invoked by uid 99); 2 Apr 2012 15:52:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Apr 2012 15:52:32 +0000 X-ASF-Spam-Status: No, hits=-2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_HI,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [194.40.127.75] (HELO C005894.axa.ch) (194.40.127.75) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Apr 2012 15:52:23 +0000 X-IronPort-AV: E=Sophos;i="4.75,357,1330902000"; d="scan'208,217";a="44315242" Received: from c005811.chres1.doleni.net ([194.40.60.11]) by C005894.ch.winterthur.com with ESMTP; 02 Apr 2012 17:51:58 +0200 Received: from c005815.chres1.doleni.net ([194.40.60.9]) by c005811.chres1.doleni.net with Microsoft SMTPSVC(6.0.3790.4675); Mon, 2 Apr 2012 17:51:58 +0200 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CD10E8.88B85329" X-MimeOLE: Produced By Microsoft Exchange V6.5 Subject: [axis2-1.6.1] jaxws-samples - SampleClient.java not running Date: Mon, 2 Apr 2012 17:51:57 +0200 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [axis2-1.6.1] jaxws-samples - SampleClient.java not running Thread-Index: Ac0Q54mznulEtEZrSX+UodTBoAY1uQAAIdIw From: "Stadelmann Josef" To: X-OriginalArrivalTime: 02 Apr 2012 15:51:58.0008 (UTC) FILETIME=[88F8DB80:01CD10E8] X-Virus-Checked: Checked by ClamAV on apache.org ------_=_NextPart_001_01CD10E8.88B85329 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable OK - it compiles correct and the services have been tested using the JSP GUI. So it is time to take the SampleClient.java code and take a debugg session to learn what all will happen.=20 BUG: running SampleClient.java results in=20 cd E:\Users\C770817\SW-UMGEBUNG\axis2-1.6.1\samples\jaxws-samples; "JAVA_HOME=3DC:\\Program Files\\Java\\jdk1.6.0_30" E:\\Users\\C770817\\SW-UMGEBUNG\\apache-maven-3.0.5\\bin\\mvn.bat "-Dexec.args=3D-classpath %classpath org.apache.axis2.jaxws.samples.client.SampleClient" -Dexec.executable=3Djava -Dexec.classpathScope=3Druntime process-classes org.codehaus.mojo:exec-maven-plugin:1.2:exec Scanning for projects... =20 ------------------------------------------------------------------------ Building JAXWS Samples - Echo, Ping, MTOM 1.6.1 ------------------------------------------------------------------------ [resources:resources] [debug] execute contextualize Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! Copying 0 resource [compiler:compile] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent! Compiling 1 source file to E:\Users\C770817\SW-UMGEBUNG\axis2-1.6.1\samples\jaxws-samples\target\cl asses [exec:exec] Exception in thread "main" java.lang.RuntimeException: Please set org.apache.axis2.jaxws.config.path system property to a valid axis2.xml file (with addressing module enabled) at org.apache.axis2.jaxws.samples.client.SampleClient.initConfigurationFact ory(SampleClient.java:249) at org.apache.axis2.jaxws.samples.client.SampleClient.CallService(SampleCli ent.java:230) at org.apache.axis2.jaxws.samples.client.SampleClient.main(SampleClient.jav a:78) ------------------------------------------------------------------------ BUILD FAILURE ------------------------------------------------------------------------ Total time: 2.200s Finished at: Mon Apr 02 14:50:20 CEST 2012 Final Memory: 14M/495M ------------------------------------------------------------------------ Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:exec (default-cli) on project jaxws-samples: Command execution failed. Process exited with an error: 1(Exit value: 1) -> [Help 1] To see the full stack trace of the errors, re-run Maven with the -e switch. Re-run Maven using the -X switch to enable full debug logging. For more information about the errors and possible solutions, please read the following articles: [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 'cmd' is not recognized as an internal or external command, operable program or batch file. OK - let's add a fix and=20 public static void main(String[] args) { System.setProperty("org.apache.axis2.jaxws.config.path", "/E:/Users/C770817/SW-UMGEBUNG/axis2-1.6.1/repository/axis2.xml"); SampleClient sample =3D new SampleClient(); sample.parseArgs(args); sample.CallService(); } OK ? - Let us try again to run this SampleClient cd E:\Users\C770817\SW-UMGEBUNG\axis2-1.6.1\samples\jaxws-samples; "JAVA_HOME=3DC:\\Program Files\\Java\\jdk1.6.0_30" E:\\Users\\C770817\\SW-UMGEBUNG\\apache-maven-3.0.5\\bin\\mvn.bat "-Dexec.args=3D-classpath %classpath org.apache.axis2.jaxws.samples.client.SampleClient" -Dexec.executable=3Djava -Dexec.classpathScope=3Druntime process-classes org.codehaus.mojo:exec-maven-plugin:1.2:exec Scanning for projects... =20 ------------------------------------------------------------------------ Building JAXWS Samples - Echo, Ping, MTOM 1.6.1 ------------------------------------------------------------------------ [resources:resources] [debug] execute contextualize Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! Copying 0 resource [compiler:compile] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent! Compiling 1 source file to E:\Users\C770817\SW-UMGEBUNG\axis2-1.6.1\samples\jaxws-samples\target\cl asses [exec:exec] 02.04.2012 14:54:25 org.apache.axis2.deployment.ClusterBuilder buildCluster INFO: Clustering has been disabled 02.04.2012 14:54:25 org.apache.axis2.deployment.DeploymentEngine loadFromClassPath INFO: Module validation failed: The system is attempting to engage a module that is not available: addressing Exception in thread "main" javax.xml.ws.WebServiceException: Error getting Client Configuration Context : The system is attempting to engage a module that is not available: addressing at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(Except ionFactory.java:173) at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(Exceptio nFactory.java:70) at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(Exceptio nFactory.java:118) at org.apache.axis2.jaxws.ClientConfigurationFactory.(ClientConfigura tionFactory.java:60) at org.apache.axis2.jaxws.samples.client.SampleClient.initConfigurationFact ory(SampleClient.java:254) at org.apache.axis2.jaxws.samples.client.SampleClient.CallService(SampleCli ent.java:230) at org.apache.axis2.jaxws.samples.client.SampleClient.main(SampleClient.jav a:78) ------------------------------------------------------------------------ BUILD FAILURE ------------------------------------------------------------------------ Total time: 2.761s Finished at: Mon Apr 02 14:54:25 CEST 2012 Final Memory: 11M/495M ------------------------------------------------------------------------ Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:exec (default-cli) on project jaxws-samples: Command execution failed. Process exited with an error: 1(Exit value: 1) -> [Help 1] To see the full stack trace of the errors, re-run Maven with the -e switch. Re-run Maven using the -X switch to enable full debug logging. For more information about the errors and possible solutions, please read the following articles: [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 'cmd' is not recognized as an internal or external command, operable program or batch file. BAD - lets us add a client repository path with just client side axis2.xml in it and a modul directory with just addressing in it and an empty service directory. BUT - to make SampleClient aware of that a code change it is required to add axis2.xml and axis2.repo as System.properties OK ? - Let us try again to run this SampleClient [exec:exec] 02.04.2012 15:07:21 org.apache.axis2.deployment.ClusterBuilder buildCluster INFO: Clustering has been disabled 02.04.2012 15:07:21 org.apache.axis2.deployment.ModuleDeployer deploy INFO: Deploying module: addressing-1.6.1 - file:/E:/Users/C770817/SW-UMGEBUNG/axis2-1.6.1/repository-client/modules /addressing-1.6.1.mar 02.04.2012 15:07:21 org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator generateWsdl SCHWERWIEGEND: Error occurred generating WSDL file for Web service implementation class {org.apache.axis2.jaxws.samples.client.echo.EchoServicePortTypeClient} java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.generate Wsdl(JAXWSRIWSDLGenerator.java:184) at org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.initiali ze(JAXWSRIWSDLGenerator.java:390) at org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.getWSDL( JAXWSRIWSDLGenerator.java:383) at org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.buildAxi sServiceFromGeneratedWSDL(EndpointDescriptionImpl.java:1054) at org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.setupAxi sService(EndpointDescriptionImpl.java:778) at org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.(E ndpointDescriptionImpl.java:276) at org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.(E ndpointDescriptionImpl.java:224) at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.updateEnd pointDescription(ServiceDescriptionImpl.java:534) at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.updateEnd point(DescriptionFactoryImpl.java:364) at org.apache.axis2.jaxws.description.DescriptionFactory.updateEndpoint(Des criptionFactory.java:180) at org.apache.axis2.jaxws.spi.ServiceDelegate.getPort(ServiceDelegate.java: 597) at org.apache.axis2.jaxws.spi.ServiceDelegate.getPort(ServiceDelegate.java: 513) at javax.xml.ws.Service.getPort(Service.java:92) at org.apache.axis2.jaxws.samples.client.echo.EchoService.getEchoServicePor t(EchoService.java:58) at org.apache.axis2.jaxws.samples.client.echo.EchoServicePortProxy$Descript or.initCommon(EchoServicePortProxy.java:54) at org.apache.axis2.jaxws.samples.client.echo.EchoServicePortProxy$Descript or.(EchoServicePortProxy.java:50) at org.apache.axis2.jaxws.samples.client.echo.EchoServicePortProxy.(E choServicePortProxy.java:96) at org.apache.axis2.jaxws.samples.client.SampleClient.buildAsync(SampleClie nt.java:368) at org.apache.axis2.jaxws.samples.client.SampleClient.CallService(SampleCli ent.java:234) at org.apache.axis2.jaxws.samples.client.SampleClient.main(SampleClient.jav a:81) Caused by: java.lang.NoClassDefFoundError: com/sun/mirror/apt/AnnotationProcessorFactory at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at com.sun.tools.ws.util.WSToolsObjectFactoryImpl.wsgen(WSToolsObjectFactor yImpl.java:60) at com.sun.tools.ws.spi.WSToolsObjectFactory.wsgen(WSToolsObjectFactory.jav a:107) ... 24 more Caused by: java.lang.ClassNotFoundException: com.sun.mirror.apt.AnnotationProcessorFactory at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.load>> CLIENT: ERROR: SEI Async EXCEPTION. Class(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ... 38 more javax.xml.ws.WebServiceException: Error occurred generating WSDL file for Web service implementation class {org.apache.axis2.jaxws.samples.client.echo.EchoServicePortTypeClient} at org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.generate Wsdl(JAXWSRIWSDLGenerator.java:198) at org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.initiali ze(JAXWSRIWSDLGenerator.java:390) at org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.getWSDL( JAXWSRIWSDLGenerator.java:383) at org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.buildAxi sServiceFromGeneratedWSDL(EndpointDescriptionImpl.java:1054) at org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.setupAxi sService(EndpointDescriptionImpl.java:778) at org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.(E ndpointDescriptionImpl.java:276) at org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.(E ndpointDescriptionImpl.java:224) at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.updateEnd pointDescription(ServiceDescriptionImpl.java:534) at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.updateEnd point(DescriptionFactoryImpl.java:364) at org.apache.axis2.jaxws.description.DescriptionFactory.updateEndpoint(Des criptionFactory.java:180) at org.apache.axis2.jaxws.spi.ServiceDelegate.getPort(ServiceDelegate.java: 597) at org.apache.axis2.jaxws.spi.ServiceDelegate.getPort(ServiceDelegate.java: 513) at javax.xml.ws.Service.getPort(Service.java:92) at org.apache.axis2.jaxws.samples.client.echo.EchoService.getEchoServicePor t(EchoService.java:58) at org.apache.axis2.jaxws.samples.client.echo.EchoServicePortProxy$Descript or.initCommon(EchoServicePortProxy.java:54) at org.apache.axis2.jaxws.samples.client.echo.EchoServicePortProxy$Descript or.(EchoServicePortProxy.java:50) at org.apache.axis2.jaxws.samples.client.echo.EchoServicePortProxy.(E choServicePortProxy.java:96) at org.apache.axis2.jaxws.samples.client.SampleClient.buildAsync(SampleClie nt.java:368) at org.apache.axis2.jaxws.samples.client.SampleClient.CallService(SampleCli ent.java:234) at org.apache.axis2.jaxws.samples.client.SampleClient.main(SampleClient.jav a:81) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.generate Wsdl(JAXWSRIWSDLGenerator.java:184) ... 19 more Caused by: java.lang.NoClassDefFoundError: com/sun/mirror/apt/AnnotationProcessorFactory at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at com.sun.tools.ws.util.WSToolsObjectFactoryImpl.wsgen(WSToolsObjectFactor yImpl.java:60) at com.sun.tools.ws.spi.WSToolsObjectFactory.wsgen(WSToolsObjectFactory.jav a:107) ... 24 more Caused by: java.lang.ClassNotFoundException: com.sun.mirror.apt.AnnotationProcessorFactory at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ... 38 more ------------------------------------------------------------------------ BUILD SUCCESS ------------------------------------------------------------------------ What is missing here ? which jar has the AnnotationProcessorFactory? OK - I then check the jaxws-samples directory structure and I can fin "org.apache.axis2.jaxws.samples.client.echo" and in that package I can find the " EchoServicePortTypeClient.java" The brown stack text happens when true OK - lets have the axis2.xml of the client, changed it back to its default that the wsdl is generated from @annotations! With this parameter set false (the default) false the client sample run but the client reports an Connection exception The result is: ------------------------------------------------------------------------ Building JAXWS Samples - Echo, Ping, MTOM 1.6.1 ------------------------------------------------------------------------ [resources:resources] [debug] execute contextualize Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! Copying 0 resource [compiler:compile] Nothing to compile - all classes are up to date [exec:exec] 02.04.2012 16:42:18 org.apache.axis2.deployment.ClusterBuilder buildCluster INFO: Clustering has been disabled 02.04.2012 16:42:18 org.apache.axis2.deployment.ModuleDeployer deploy INFO: Deploying module: addressing-1.6.1 - file:/E:/Users/C770817/SW-UMGEBUNG/axis2-1.6.1/repository-client/modules /addressing-1.6.1.mar >> CLIENT: SEI Async to http://localhost:8080/jaxws-samples/services/EchoService.EchoServicePort >> CLIENT: Connection Exception >> CLIENT: SEI Async invocation complete. ------------------------------------------------------------------------ BUILD SUCCESS ------------------------------------------------------------------------ Total time: 11.670s Finished at: Mon Apr 02 16:42:25 CEST 2012 Final Memory: 6M/495M ------------------------------------------------------------------------ 'cmd' is not recognized as an internal or external command, operable program or batch file. Now we have a very smart run but I can't say yet why the jaxws-samples/SampleClient.java reports a >> CLIENT: Connection Exception looking closer with debugger, which may or may not be correct, due to many threads, and because therew are so mayn TODO's which make me uncertain! looking at the EchoServicecallbackHandler,=20 output =3D response.get(); results in a exception "javax.xml.ws.WebServiceException: org.apache.axis2.AxisFault: Port number for transport http has not yet been detected" The fault happens when AxisInvocationController.java executes line 276 execute(opClient, false, axisRequestMsgCtx); } catch (AxisFault af) { if (log.isDebugEnabled()) { log.debug(axisRequestMsgCtx.getLogIDString() + " AxisFault received from client: " + af.getMessage()); } /* * Save the exception on the callback. The client will learn about the error when they try to * retrieve the async results via the Response.get(). "Errors that occur during the invocation * are reported via an exception when the client attempts to retrieve the results of the operation." * -- JAXWS 4.3.3 */ /* * TODO: This is the appropriate thing to do here since the thrown exception may occur before * we switch threads to the async thread. But... what happens if we've already switched over * to the async thread? So far, it appears that the exception gets set on the FutureTask * Concurrent object, and we never hit this scope. This means that later, when the client * calls future.get(), no exception will be thrown despite what the spec says. The client can, * however, retrieve errors via it's AsyncHandler. */ cbf.onError(af); } I have seen this as axis fault org.apache.axis2.AxisFault: Port number for transport http has not yet been detected" There is another thing very spurios and I think developers should have a look at in JAXWSRIWSDLGenerator.generateWSDL(...) the tempFile name is taken from a java.io.tmpdir as "C:\Users\C770817\AppData\Local\Temp\1\_axis2" later on a className is added and the return of axisService.getName() resulting in=20 "C:\Users\C770817\AppData\Local\Temp\1\_axis2org.apache.axis2.jaxws.samp les.client.echo.EchoServicePortTypeClient_EchoService" this is then used to create the localOutputDirectory at JAXWSRIWSDLGenerator.generateWSDL(...) (line 170)=20 AND later on=20 this long string is passed as argument -d to the wsdl generator -d "C:\Users\C770817\AppData\Local\Temp\1\_axis2org.apache.axis2.jaxws.samp les.client.echo.EchoServicePortTypeClient_EchoService" Looking into this directory the wsgen has never stored a file !!! and I can not debug into=20 SCHWERWIEGEND: Error occurred generating WSDL file for Web service implementation class {org.apache.axis2.jaxws.samples.client.echo.EchoServicePortTypeClient} java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) This adventure of a non-working client, a client which does not find a port in one case, or a client which is unable to generate a wsdl file by wsgen, brings me to the question: WAS THIS SAMPE CLIENT RUUNING ONCE? IF YES what shall I do, what do I miss? Josef ------_=_NextPart_001_01CD10E8.88B85329 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [axis2-1.6.1] jaxws-samples - SampleClient.java not = running

OK – it compiles correct and the services have been = tested using the JSP GUI.

So it is = time to take the SampleClient.java code and take a debugg session to = learn what all will happen.

BUG: = running SampleClient.java results in
cd = E:\Users\C770817\SW-UMGEBUNG\axis2-1.6.1\samples\jaxws-samples; = "JAVA_HOME=3DC:\\Program Files\\Java\\jdk1.6.0_30" = E:\\Users\\C770817\\SW-UMGEBUNG\\apache-maven-3.0.5\\bin\\mvn.bat = "-Dexec.args=3D-classpath %classpath = org.apache.axis2.jaxws.samples.client.SampleClient" = -Dexec.executable=3Djava -Dexec.classpathScope=3Druntime process-classes = org.codehaus.mojo:exec-maven-plugin:1.2:exec

Scanning for projects...

           &n= bsp;           &nb= sp;           &nbs= p;            = ;            =             =

--------------------------------------------------------------------= ----

Building JAXWS Samples - Echo, Ping, MTOM 1.6.1

--------------------------------------------------------------------= ----

[resources:resources]

[debug] execute contextualize

Using platform encoding (Cp1252 actually) to copy filtered = resources, i.e. build is platform dependent!

Copying 0 resource

[compiler:compile]

File encoding has not been set, using platform encoding Cp1252, = i.e. build is platform dependent!

Compiling 1 source file to = E:\Users\C770817\SW-UMGEBUNG\axis2-1.6.1\samples\jaxws-samples\target\cla= sses

[exec:exec]

Exception in thread "main" = java.lang.RuntimeException: = Please set = org.apache.axis2.jaxws.config.path system property to a valid axis2.xml = file (with addressing module enabled)

        at = org.apache.axis2.jaxws.samples.client.SampleClient.initConfigurationFacto= ry(SampleClient.java:249)

        at = org.apache.axis2.jaxws.samples.client.SampleClient.CallService(SampleClie= nt.java:230)

        at = org.apache.axis2.jaxws.samples.client.SampleClient.main(SampleClient.java= :78)

--------------------------------------------------------------------= ----

BUILD FAILURE

--------------------------------------------------------------------= ----

Total time: 2.200s

Finished at: Mon Apr 02 14:50:20 CEST 2012

Final Memory: 14M/495M

--------------------------------------------------------------------= ----

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:exec = (default-cli) on project jaxws-samples: Command execution failed. = Process exited with an error: 1(Exit value: 1) -> [Help = 1]

To = see the full stack trace of the errors, re-run Maven with the -e = switch.

Re-run Maven using the -X switch to enable full debug = logging.

For more information about the errors and possible solutions, = please read the following articles:

[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionExc= eption

'cmd' is not recognized as an internal or external = command,

operable program or batch file.


OK – let's add a fix and

    public static void main(String[] = args) {

        = System.setProperty("org.apache.axis2.jaxws.config.path", = "/E:/Users/C770817/SW-UMGEBUNG/axis2-1.6.1/repository/axis2.xml"= ;);

        = SampleClient sample =3D new SampleClient();

        = sample.parseArgs(args);

        = sample.CallService();

    }

OK ? – Let us try again to run this = SampleClient

cd = E:\Users\C770817\SW-UMGEBUNG\axis2-1.6.1\samples\jaxws-samples; = "JAVA_HOME=3DC:\\Program Files\\Java\\jdk1.6.0_30" = E:\\Users\\C770817\\SW-UMGEBUNG\\apache-maven-3.0.5\\bin\\mvn.bat = "-Dexec.args=3D-classpath %classpath = org.apache.axis2.jaxws.samples.client.SampleClient" = -Dexec.executable=3Djava -Dexec.classpathScope=3Druntime process-classes = org.codehaus.mojo:exec-maven-plugin:1.2:exec

Scanning for projects...

           &n= bsp;           &nb= sp;           &nbs= p;            = ;            =             =

--------------------------------------------------------------------= ----

Building JAXWS Samples - Echo, Ping, MTOM 1.6.1

--------------------------------------------------------------------= ----

[resources:resources]

[debug] execute contextualize

Using platform encoding (Cp1252 actually) to copy filtered = resources, i.e. build is platform dependent!

Copying 0 resource

[compiler:compile]

File encoding has not been set, using platform encoding Cp1252, = i.e. build is platform dependent!

Compiling 1 source file to = E:\Users\C770817\SW-UMGEBUNG\axis2-1.6.1\samples\jaxws-samples\target\cla= sses

[exec:exec]

02.04.2012 14:54:25 org.apache.axis2.deployment.ClusterBuilder = buildCluster

INFO: Clustering has been disabled

02.04.2012 14:54:25 org.apache.axis2.deployment.DeploymentEngine = loadFromClassPath

INFO: Module validation failed: The system is attempting to engage = a module that is not available: addressing

Exception in thread "main" = javax.xml.ws.WebServiceException: Error getting Client Configuration = Context : The system is attempting = to engage a module that is not available: = addressing

        at = org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(Excepti= onFactory.java:173)

        at = org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(Exception= Factory.java:70)

        at = org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(Exception= Factory.java:118)

        at = org.apache.axis2.jaxws.ClientConfigurationFactory.<init>(ClientConf= igurationFactory.java:60)

        at = org.apache.axis2.jaxws.samples.client.SampleClient.initConfigurationFacto= ry(SampleClient.java:254)

        at = org.apache.axis2.jaxws.samples.client.SampleClient.CallService(SampleClie= nt.java:230)

        at = org.apache.axis2.jaxws.samples.client.SampleClient.main(SampleClient.java= :78)

--------------------------------------------------------------------= ----

BUILD FAILURE

--------------------------------------------------------------------= ----

Total time: 2.761s

Finished at: Mon Apr 02 14:54:25 CEST 2012

Final Memory: 11M/495M

--------------------------------------------------------------------= ----

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:exec = (default-cli) on project jaxws-samples: Command execution failed. = Process exited with an error: 1(Exit value: 1) -> [Help = 1]

To = see the full stack trace of the errors, re-run Maven with the -e = switch.

Re-run Maven using the -X switch to enable full debug = logging.

For more information about the errors and possible solutions, = please read the following articles:

[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionExc= eption

'cmd' is not recognized as an internal or external = command,

operable program or batch file.

BAD = – lets us add a client repository path with just client side = axis2.xml in it and a modul directory with just addressing in it and an = empty service directory.

BUT = – to make SampleClient aware of that a code change it is required = to add axis2.xml and axis2.repo as System.properties

OK ? = – Let us try again to run this SampleClient

[exec:exec]

02.04.2012 15:07:21 org.apache.axis2.deployment.ClusterBuilder = buildCluster

INFO: Clustering has been disabled

02.04.2012 15:07:21 org.apache.axis2.deployment.ModuleDeployer = deploy

INFO: Deploying module: addressing-1.6.1 - = file:/E:/Users/C770817/SW-UMGEBUNG/axis2-1.= 6.1/repository-client/modules/addressing-1.6.1.mar

02.04.2012 15:07:21 = org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator = generateWsdl

SCHWERWIEGEND: Error = occurred generating WSDL file for Web service implementation class = {org.apache.axis2.jaxws.samples.client.echo.EchoServicePortTypeClient}

java.lang.reflect.InvocationTargetException

        at = sun.reflect.NativeMethodAccessorImpl.invoke0(Native = Method)

        at = sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java= :39)

        at = sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI= mpl.java:25)

        at = java.lang.reflect.Method.invoke(Method.java:597)

        at = org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.generateW= sdl(JAXWSRIWSDLGenerator.java:184)

        at = org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.initializ= e(JAXWSRIWSDLGenerator.java:390)

        at = org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.getWSDL(J= AXWSRIWSDLGenerator.java:383)

        at = org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.buildAxis= ServiceFromGeneratedWSDL(EndpointDescriptionImpl.java:1054)=

        at = org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.setupAxis= Service(EndpointDescriptionImpl.java:778)

        at = org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.<init&= gt;(EndpointDescriptionImpl.java:276)

        at = org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.<init&= gt;(EndpointDescriptionImpl.java:224)

        at = org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.updateEndp= ointDescription(ServiceDescriptionImpl.java:534)

        at = org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.updateEndp= oint(DescriptionFactoryImpl.java:364)

        at = org.apache.axis2.jaxws.description.DescriptionFactory.updateEndpoint(Desc= riptionFactory.java:180)

        at = org.apache.axis2.jaxws.spi.ServiceDelegate.getPort(ServiceDelegate.java:5= 97)

        at = org.apache.axis2.jaxws.spi.ServiceDelegate.getPort(ServiceDelegate.java:5= 13)

        at = javax.xml.ws.Service.getPort(Service.java:92)

        at = org.apache.axis2.jaxws.samples.client.echo.EchoService.getEchoServicePort= (EchoService.java:58)

        at = org.apache.axis2.jaxws.samples.client.echo.EchoServicePortProxy$Descripto= r.initCommon(EchoServicePortProxy.java:54)

        at = org.apache.axis2.jaxws.samples.client.echo.EchoServicePortProxy$Descripto= r.<init>(EchoServicePortProxy.java:50)

        at = org.apache.axis2.jaxws.samples.client.echo.EchoServicePortProxy.<init&= gt;(EchoServicePortProxy.java:96)

        at = org.apache.axis2.jaxws.samples.client.SampleClient.buildAsync(SampleClien= t.java:368)

        at = org.apache.axis2.jaxws.samples.client.SampleClient.CallService(SampleClie= nt.java:234)

        at = org.apache.axis2.jaxws.samples.client.SampleClient.main(SampleClient.java= :81)

Caused by: java.lang.NoClassDefFoundError: = com/sun/mirror/apt/AnnotationProcessorFactory

        at java.lang.ClassLoader.defineClass1(Native = Method)

        at = java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)=

        at = java.lang.ClassLoader.defineClass(ClassLoader.java:615)

=

        at = java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

        at = java.net.URLClassLoader.defineClass(URLClassLoader.java:283)

        at = java.net.URLClassLoader.access$000(URLClassLoader.java:58)<= /P>

        at = java.net.URLClassLoader$1.run(URLClassLoader.java:197)

        at = java.security.AccessController.doPrivileged(Native = Method)

        at = java.net.URLClassLoader.findClass(URLClassLoader.java:190)<= /P>

        at = java.lang.ClassLoader.loadClass(ClassLoader.java:306)

        at = sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

        at = java.lang.ClassLoader.loadClass(ClassLoader.java:247)

        at = com.sun.tools.ws.util.WSToolsObjectFactoryImpl.wsgen(WSToolsObjectFactory= Impl.java:60)

        at = com.sun.tools.ws.spi.WSToolsObjectFactory.wsgen(WSToolsObjectFactory.java= :107)

        ... 24 more

Caused by: = java.lang.ClassNotFoundException: = com.sun.mirror.apt.AnnotationProcessorFactory

        at = java.net.URLClassLoader$1.run(URLClassLoader.java:202)

        at = java.security.AccessController.doPrivileged(Native = Method)

        at = java.net.URLClassLoader.findClass(URLClassLoader.java:190)<= /P>

        at = java.lang.ClassLoader.loadClass(ClassLoader.java:306)

        at sun.misc.Launcher$AppClassLoader.load>> = CLIENT: ERROR: SEI Async EXCEPTION.

Class(Launcher.java:301)

        at = java.lang.ClassLoader.loadClass(ClassLoader.java:247)

        ... 38 more

javax.xml.ws.WebServiceException: Error occurred generating WSDL = file for Web service implementation class = {org.apache.axis2.jaxws.samples.client.echo.EchoServicePortTypeClient}

        at = org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.generateW= sdl(JAXWSRIWSDLGenerator.java:198)

        at = org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.initializ= e(JAXWSRIWSDLGenerator.java:390)

        at = org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.getWSDL(J= AXWSRIWSDLGenerator.java:383)

        at = org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.buildAxis= ServiceFromGeneratedWSDL(EndpointDescriptionImpl.java:1054)=

        at = org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.setupAxis= Service(EndpointDescriptionImpl.java:778)

        at = org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.<init&= gt;(EndpointDescriptionImpl.java:276)

        at = org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.<init&= gt;(EndpointDescriptionImpl.java:224)

        at = org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.updateEndp= ointDescription(ServiceDescriptionImpl.java:534)

        at = org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.updateEndp= oint(DescriptionFactoryImpl.java:364)

        at = org.apache.axis2.jaxws.description.DescriptionFactory.updateEndpoint(Desc= riptionFactory.java:180)

        at = org.apache.axis2.jaxws.spi.ServiceDelegate.getPort(ServiceDelegate.java:5= 97)

        at = org.apache.axis2.jaxws.spi.ServiceDelegate.getPort(ServiceDelegate.java:5= 13)

        at = javax.xml.ws.Service.getPort(Service.java:92)

        at = org.apache.axis2.jaxws.samples.client.echo.EchoService.getEchoServicePort= (EchoService.java:58)

        at = org.apache.axis2.jaxws.samples.client.echo.EchoServicePortProxy$Descripto= r.initCommon(EchoServicePortProxy.java:54)

        at = org.apache.axis2.jaxws.samples.client.echo.EchoServicePortProxy$Descripto= r.<init>(EchoServicePortProxy.java:50)

        at = org.apache.axis2.jaxws.samples.client.echo.EchoServicePortProxy.<init&= gt;(EchoServicePortProxy.java:96)

        at = org.apache.axis2.jaxws.samples.client.SampleClient.buildAsync(SampleClien= t.java:368)

        at = org.apache.axis2.jaxws.samples.client.SampleClient.CallService(SampleClie= nt.java:234)

        at = org.apache.axis2.jaxws.samples.client.SampleClient.main(SampleClient.java= :81)

Caused by: = java.lang.reflect.InvocationTargetException

        at = sun.reflect.NativeMethodAccessorImpl.invoke0(Native = Method)

        at = sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java= :39)

        at = sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI= mpl.java:25)

        at = java.lang.reflect.Method.invoke(Method.java:597)

        at = org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.generateW= sdl(JAXWSRIWSDLGenerator.java:184)

        ... 19 more

Caused by: java.lang.NoClassDefFoundError: = com/sun/mirror/apt/AnnotationProcessorFactory

        at java.lang.ClassLoader.defineClass1(Native = Method)

        at = java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)=

        at = java.lang.ClassLoader.defineClass(ClassLoader.java:615)

=

        at = java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

        at = java.net.URLClassLoader.defineClass(URLClassLoader.java:283)

        at = java.net.URLClassLoader.access$000(URLClassLoader.java:58)<= /P>

        at = java.net.URLClassLoader$1.run(URLClassLoader.java:197)

        at = java.security.AccessController.doPrivileged(Native = Method)

        at = java.net.URLClassLoader.findClass(URLClassLoader.java:190)<= /P>

        at = java.lang.ClassLoader.loadClass(ClassLoader.java:306)

        at = sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

        at = java.lang.ClassLoader.loadClass(ClassLoader.java:247)

        at = com.sun.tools.ws.util.WSToolsObjectFactoryImpl.wsgen(WSToolsObjectFactory= Impl.java:60)

        at = com.sun.tools.ws.spi.WSToolsObjectFactory.wsgen(WSToolsObjectFactory.java= :107)

        ... 24 more

Caused by: = java.lang.ClassNotFoundException: = com.sun.mirror.apt.AnnotationProcessorFactory

        at = java.net.URLClassLoader$1.run(URLClassLoader.java:202)

        at = java.security.AccessController.doPrivileged(Native = Method)

        at = java.net.URLClassLoader.findClass(URLClassLoader.java:190)<= /P>

        at = java.lang.ClassLoader.loadClass(ClassLoader.java:306)

        at = sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

        at = java.lang.ClassLoader.loadClass(ClassLoader.java:247)

        ... 38 more

--------------------------------------------------------------------= ----

BUILD SUCCESS

--------------------------------------------------------------------= ----

What is missing here ? which jar = has the = AnnotationProcessorFactory?


OK = – I then check the jaxws-samples directory structure and I can fin = "org.apache.axis2.jaxws.samples.client.echo"

and in = that package I can find the " = EchoServicePortTypeClient.java"

The brown stack text = happens when <parameter = name=3D"useGeneratedWSDLinJAXWS">true</parameter>

OK = – lets have the axis2.xml of the client, changed it back to its = default that the wsdl is generated from @annotations!

With = this parameter set false (the default) <parameter = name=3D"useGeneratedWSDLinJAXWS">false</parameter>

the = client sample run but the client reports an Connection = exception

The = result is:

--------------------------------------------------------------------= ----

Building JAXWS Samples - Echo, Ping, MTOM 1.6.1

--------------------------------------------------------------------= ----

[resources:resources]

[debug] execute contextualize

Using platform encoding (Cp1252 actually) to copy filtered = resources, i.e. build is platform dependent!

Copying 0 resource

[compiler:compile]

Nothing to compile - all classes are up to date

[exec:exec]

02.04.2012 16:42:18 org.apache.axis2.deployment.ClusterBuilder = buildCluster

INFO: Clustering has been disabled

02.04.2012 16:42:18 org.apache.axis2.deployment.ModuleDeployer = deploy

INFO: Deploying module: addressing-1.6.1 - file:/E:/Users/C770817/SW-UMGEBUNG/axis2-1.= 6.1/repository-client/modules/addressing-1.6.1.mar

>> CLIENT: SEI Async to http://localhost:8080/jaxws-samples/services/EchoService.EchoSer= vicePort

>> CLIENT: Connection Exception

>> CLIENT: SEI Async invocation complete.

--------------------------------------------------------------------= ----

BUILD SUCCESS

--------------------------------------------------------------------= ----

Total time: 11.670s

Finished at: Mon Apr 02 16:42:25 CEST 2012

Final Memory: 6M/495M

--------------------------------------------------------------------= ----

'cmd' is not recognized as an internal or external = command,

operable program or batch file.

Now we have a very smart run but I can't say yet why the = jaxws-samples/SampleClient.java reports a  >> CLIENT: = Connection Exception

looking closer with debugger, which may or may not be correct, due = to many threads, and because therew are so mayn TODO's which make me = uncertain!

looking at the EchoServicecallbackHandler, =

        output =3D response.get();

        results in a exception = "javax.xml.ws.WebServiceException: = org.apache.axis2.AxisFault: Port number for transport http has not yet = been detected"

The fault happens when AxisInvocationController.java executes line = 276

            = execute(opClient, false, axisRequestMsgCtx);

        } catch (AxisFault af) = {

            = if (log.isDebugEnabled()) {

           &n= bsp;    log.debug(axisRequestMsgCtx.getLogIDString() + = " AxisFault received from client: " +

           &n= bsp;            = af.getMessage());

            = }

            = /*

           &n= bsp; * Save the exception on the callback.  The client will learn = about the error when they try to

           &n= bsp; * retrieve the async results via the Response.get().  = "Errors that occur during the invocation

           &n= bsp; * are reported via an exception when the client attempts to = retrieve the results of the operation."

           &n= bsp; * -- JAXWS 4.3.3

           &n= bsp; */

            = /*

            = * TODO:  This is the appropriate thing to do here since the thrown = exception may occur before

            = * we switch threads to the async thread.  But... what happens if = we've already switched over

            = * to the async thread?  So far, it appears that the exception gets = set on the FutureTask

            = * Concurrent object, and we never hit this scope.  This means that = later, when the client

            = * calls future.get(), no exception will be thrown despite what the spec = says.  The client can,

            = * however, retrieve errors via it's AsyncHandler.

            = */

            = cbf.onError(af);

        }

I have seen this as axis fault org.apache.axis2.AxisFault: Port number for transport = http has not yet been detected"

There is another thing very spurios and I think = developers should have a look at

in JAXWSRIWSDLGenerator.generateWSDL(…) the = tempFile name is taken from a java.io.tmpdir as = "C:\Users\C770817\AppData\Local\Temp\1\_axis2"

later on = a className is added and the return of axisService.getName() resulting = in

"C:\Users\C770817\AppData\Local\Temp\1\_axis2org.apac= he.axis2.jaxws.samples.client.echo.EchoServicePortTypeClient_EchoService&= quot;

this is = then used to create the localOutputDirectory at = JAXWSRIWSDLGenerator.generateWSDL(…) (line 170)

AND = later on

this = long string is passed as argument  –d to the wsdl = generator

-d = "C:\Users\C770817\AppData\Local\Temp\1\_axis2org.apache.axis2.jaxws.= samples.client.echo.EchoServicePortTypeClient_EchoService"

Looking = into this directory the wsgen has never stored a file = !!!

and I = can not debug into

SCHWERWIEGEND: Error = occurred generating WSDL file for Web service implementation class = {org.apache.axis2.jaxws.samples.client.echo.EchoServicePortTypeClient}

java.lang.reflect.InvocationTargetException

        at = sun.reflect.NativeMethodAccessorImpl.invoke0(Native = Method)

        at = sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java= :39)

        at = sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI= mpl.java:25)

        at = java.lang.reflect.Method.invoke(Method.java:597)

This = adventure of a non-working client, a client which does not find a port = in one case, or a client which is unable to generate a wsdl file by = wsgen, brings me to the question:

WAS THIS = SAMPE CLIENT RUUNING ONCE?

IF YES = what shall I do, what do I miss?

Josef















------_=_NextPart_001_01CD10E8.88B85329--