Skip to main content

Error with JAXWS client code , generated using RI 2.1.7, WS running with JDK 1.6.0_29

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
mshimpi
Offline
Joined: 2010-07-19

Hi,

I have JAXWS based services exposed using JAXWS-RI 2.1.7 on Tomcat 5.x. The client code is also generated using the same version of JAXWS-RI utility using WSDL first approach.

I am getting following error at runtime on the second run. THE FIRST RUN WORKS GREAT!

java.lang.ClassCastException: com.sun.xml.internal.bind.api.Messages cannot be cast to ResourceBundle
at java.util.ResourceBundle$Control.newBundle(ResourceBundle.java:2297)
at java.util.ResourceBundle.loadBundle(ResourceBundle.java:1364)
at java.util.ResourceBundle.findBundle(ResourceBundle.java:1328)
at java.util.ResourceBundle.findBundle(ResourceBundle.java:1282)
at java.util.ResourceBundle.findBundle(ResourceBundle.java:1282)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1224)
Caused: java.util.MissingResourceException: Can't find bundle for base name com.sun.xml.internal.bind.api.Messages, locale en_US
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1427)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1250)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:705)
at com.sun.xml.internal.bind.api.Messages.(Messages.java:43)
Caused: java.lang.ExceptionInInitializerError
at com.sun.xml.internal.bind.api.TypeReference.(TypeReference.java:76)
at com.sun.xml.internal.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:691)
at com.sun.xml.internal.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:612)
at com.sun.xml.internal.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:401)
at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:240)
at com.sun.xml.internal.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:687)
at com.sun.xml.internal.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:675)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:330)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:313)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:295)
at javax.xml.ws.Service.getPort(Service.java:92)

Any help would highly be appreciated.

Cheers.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mshimpi
Offline
Joined: 2010-07-19

Well, there seems to be some issue with getPort() method in the web service client code. I have not been able to figure out why the getPort() would work on the first call, where as, it would throw about exception from 2nd call onwards.

The issue can be resolved by getting the instance of web service proxy only once. This can be done by either modifying the getPort() methods in generated client code Services_.java file.

Hope it helps.