Skip to main content

problem with the 6 step: Running the Web Service Client in Building a Simple Metro Application

1 reply [Last post]
Gmork
Offline
Joined: 2012-06-18
Points: 0

Hi all.
I'm newby triying on Simple Metro Application using glassfish 3 and JDK 1.6.0_32. All work fine until the 6 setp: Running the Web Service Client.

ant run

Buildfile: /home/gmork/dev/java/wsit-jaxws-fromjava/build.xml
Trying to override old definition of task apt

run:
     [java] Exception in thread "main" java.lang.NoClassDefFoundError: org/glassfish/ha/store/api/BackingStoreException
     [java] at com.sun.xml.ws.rx.mc.runtime.McConfigurationFactory.createInstance(McConfigurationFactory.java:66)
     [java] at com.sun.xml.ws.rx.mc.runtime.McTubeFactory.createTube(McTubeFactory.java:68)
     [java] at com.sun.xml.ws.assembler.TubeCreator.createTube(TubeCreator.java:84)
     [java] at com.sun.xml.ws.assembler.TubelineAssemblerFactoryImpl$MetroTubelineAssembler.createClient(TubelineAssemblerFactoryImpl.java:130)
     [java] at com.sun.xml.ws.client.Stub.createPipeline(Stub.java:314)
     [java] at com.sun.xml.ws.client.Stub.<init>(Stub.java:286)
     [java] at com.sun.xml.ws.client.Stub.<init>(Stub.java:230)
     [java] at com.sun.xml.ws.client.Stub.<init>(Stub.java:245)
     [java] at com.sun.xml.ws.client.sei.SEIStub.<init>(SEIStub.java:91)
     [java] at com.sun.xml.ws.client.WSServiceDelegate.getStubHandler(WSServiceDelegate.java:725)
     [java] at com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:703)
     [java] at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:387)
     [java] at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:363)
     [java] at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:345)
     [java] at javax.xml.ws.Service.getPort(Service.java:134)
     [java] at fromjava.client.AddNumbersImplService.getAddNumbersImplPort(AddNumbersImplService.java:72)
     [java] at fromjava.client.AddNumbersClient.main(Unknown Source)
     [java] Caused by: java.lang.ClassNotFoundException: org.glassfish.ha.store.api.BackingStoreException
     [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
     [java] at java.security.AccessController.doPrivileged(Native Method)
     [java] at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
     [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
     [java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
     [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
     [java] ... 17 more
     [java] Java Result: 1

BUILD SUCCESSFUL
Total time: 2 seconds

tutorial expected response:

[java] May 4, 2006 2:45:50 PM [com.sun.xml.ws.policy.jaxws.PolicyWSDLParserExten
       sion]  addClientConfigToMap
[java] WARNING: Optional client configuration file URL is missing. No client con
       figuration is processed.
[java] Invoking addNumbers(10, 20)
[java] The result of adding 10 and 20 is 30.

[java] Invoking addNumbers(-10, 20)
[java] Caught AddNumbersFault_Exception: Numbers: -10, 20

seems to be missing a library, but I'm not sure what, why or where to look (and add); Supposedly, the example should work without a problem. Would someone kindly give me some help?

Thank you very much for your time

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Gmork
Offline
Joined: 2012-06-18
Points: 0

Well, I found something and can produce a solution (weak, but I hope to help others with your problem). The code requires the following jar: ha-api.jar, found in ${env.as_home}/modules, for inclusion in the path add a line in build.xml:

...
<!-- GF v3 Classpath -->
<fileset dir="${modules.home}">
  <include name="gmbal.jar"/>
  <include name="webservices-osgi.jar"/>

  <!-- start my add -->
  <include name="ha-api.jar"/>
  <!-- end my add -->           
           
</fileset>
...

results in:

$ ant run
Buildfile: /home/gmork/dev/java/wsit-jaxws-fromjava/build.xml
Trying to override old definition of task apt

run:
     [echo] *****************************************************
     [echo] variable lib.home: /home/gmork/servers/glassfish3/glassfish/lib
     [echo] *****************************************************
     [echo] variable toString:wsit.endorsed: /home/gmork/servers/glassfish3/glassfish/lib/endorsed:/home/gmork/servers/glassfish3/glassfish/modules/endorsed
     [echo] *****************************************************
     [java] Invoking addNumbers(10, 20)
     [java] The result of adding 10 and 20 is 30.
     [java]
     [java] Invoking addNumbers(-10, 20)
     [java] Caught AddNumbersException_Exception: Numbers: -10, 20

BUILD SUCCESSFUL
Total time: 4 seconds

Hope this helps someone who encounters the same problem