3
votes

Iam new to Webservices. Iam trying to create a JAX- WS client from a WSDL file . Using RAD 8.0 , I generated the classes including the proxy ,SEI and the Webservice client .Now iam trying to hit the exposed webservice methods as a standalone application . I have added jaxws-rt-2.1.4.jar to the classpath also .

From the main class ,if i try to create an instance of the client to access the service iam getting the following error .

 Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.J9VMInternals.initialize(J9VMInternals.java:227)
at java.lang.J9VMInternals.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1345)
at java.util.ServiceLoader$ServiceIterator.next(ServiceLoader.java:195)
at javax.xml.ws.spi.Provider.getProviderUsingServiceLoader(Provider.java:146)
at javax.xml.ws.spi.Provider.provider(Provider.java:106)
at javax.xml.ws.Service.<init>(Service.java:57)
at com.royalbank.wcm_ap.ws_client.rbcauth.v1.AnPAuth.<init>(AnPAuth.java:35)
at com.royalbank.wcm_ap.ws_client.rbcauth.v1.TestClass.main(TestClass.java:53)
  Caused by: javax.xml.ws.WebServiceException: Error creating JAXBContext for W3CEndpointReference. 
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:222)
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:218)
at java.security.AccessController.doPrivileged(AccessController.java:203)
at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:217)
at com.sun.xml.ws.spi.ProviderImpl.<clinit>(ProviderImpl.java:88)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:205)
... 8 more
 Caused by: javax.xml.bind.JAXBException
    - with linked exception:
  [java.lang.ClassNotFoundException: com.ibm.xml.xlxp2.jaxb.JAXBContextFactory]
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:207)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:401)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:618)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:565)
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:220)

Am i missing something here with regard to the configurations ? thanks in advance :)

1
is RAD the only IDE that you can use..?? have you tried any other IDE to generate the webservice..??Fr_nkenstien
@VineetVerma YEs . I cannot use other IDE .From my best guess, I guess this has something to do with the jars . we are getting class not found exception [java.lang.ClassNotFoundException: com.ibm.xml.xlxp2.jaxb.JAXBContextFactory] .U have any ideas on that ?Muthu Raman
try to use download the jar(jarfinder.com/index.php/java/info/…) and include it in your class path..check and tellFr_nkenstien
also in case you can use licence free IDE only then you can use Oracle Jdeveloper or eclipse. this will help you build your web service easily..that is if it is possible\Fr_nkenstien
@VineetVerma no progress .Still the same error i placed the shared jars in lib folder under WEB-INF and also configured it in build path ..Muthu Raman

1 Answers

3
votes

The Missing class "com.ibm.xml.xlxp2.jaxb.JAXBContextFactory" is available in the jar "com.ibm.jaxws.thinclient_8.5.0.jar" which will be available in the server runtime directory for Websphere App server : C:\Program Files\IBM\WebSphere\AppServer\runtimes.

Please include this jar for compile purpose only and donot include this in your WAR or EAR as it will conflict with your server runtime library jar.

For server WAS 8.0 the path jar would be "com.ibm.jaxws.thinclient_8.0.0.jar".