Tuesday, September 15, 2009

Initialization Error When Invoke Weblogic webservice Through Client Stub

I faced an strange error message when I tried to call webservice client stub from a POJO class.
The web service is hosted on a weblogic server instance and is generated using jwsc. The client is generated from the generated wsdl. I use weblogic clientgen ant task to generate the stubs.



The exception I got is:


Exception in thread "Main Thread" java.lang.ExceptionInInitializerError
at weblogic.wsee.ws.init.WsDeploymentChain.newClientChain(WsDeploymentChain.java:24)
at weblogic.wsee.ws.WsFactory.callClientListeners(WsFactory.java:108)
at weblogic.wsee.ws.WsFactory.createClientService(WsFactory.java:46)
at weblogic.wsee.jaxrpc.ServiceImpl.init(ServiceImpl.java:143)
at weblogic.wsee.jaxrpc.ServiceImpl.<init>(ServiceImpl.java:111)
at com.cibc.eccs.omni.bre.wsclient.GetRuleEngineConfigurationService_Impl.<init>(GetRuleEngineConfigurationService_Impl.java:21)
at com.cibc.eccs.omni.bre.wsclient.GetRuleEngineConfigurationService_Impl.<init>(GetRuleEngineConfigurationService_Impl.java:13)
at com.cibc.eccs.omni.test.RuleEngineConfigClientTest.getRuleEngineConfig(RuleEngineConfigClientTest.java:23)
at com.cibc.eccs.omni.test.RuleEngineConfigClientTest.main(RuleEngineConfigClientTest.java:39)
Caused by: java.lang.ClassCastException: com.bea.xbean.values.XmlTokenImpl
at weblogic.wsee.tools.wseegen.schemas.impl.ListenerTypeImpl.getListenerClass(ListenerTypeImpl.java:37)
at weblogic.wsee.ws.init.WsConfigFactory.getDeploymentListenerConfig(WsConfigFactory.java:139)
at weblogic.wsee.ws.init.WsConfigFactory.load(WsConfigFactory.java:110)
at weblogic.wsee.ws.init.WsConfigFactory.newInstance(WsConfigFactory.java:59)
at weblogic.wsee.ws.init.WsConfigFactory.newInstance(WsConfigFactory.java:45)
at weblogic.wsee.ws.init.WsConfigManager.<clinit>(WsConfigManager.java:8)
... 9 more


First, I thought it is caused by not properly defined shcema xsd which makes wsdl invalid and cause this. But everything is checked and I still have this error message... Then I start suspect my running mode. I'm running a pojo inside eclipse to call the weblogic server endpoint, the pojo is using the classpath set in eclipse. I checked the classpath the pojo is invoked with in eclipse and everything is included. Then I dig further and found the actual exception is thrown inside weblogic.jar when the ServiceImpl class constructor is invoked. This jar is in the classpath, but maybe there is some conflicts. After puting the weblogic.jar to the top of my classpath, things are okay.


1 comment :