JAX-WS with weblogic and eclipse

I was trying to create a JAX-WS web service , with Weblogic Server 10.3.6.0 as the Application Server and eclipse as the IDE .

I used WSDL first approach .

Below are the summary of the steps I used :

1 : created a sample.xsd file to create a sample schema for the data types to be used in the WSDL .

2 : created a WSDL file with some operations .

3: created the web service using the eclipse tool, generate Web Service from FROM WSDL .

4: Implemented the business logic into the generated class .

5: Tried to deploy the web service on the Weblogic Server using eclipse ( Run As Application Server ) .

Received below Error :

javax.xml.ws.WebServiceException : java.lang.NullPointerException at weblogic.wsee.jaxws.WLSInstanceResolver.getSingleton(WLSInstanceResolver.java:36)

 

Complete stack trace is as below :

 

(self-tuning)’> <> <> <Servlet: “BasicOrderMgrServiceServlethttp” failed to preload on startup in Web application: “BasicOrderMgr_WS.war”.
javax.xml.ws.WebServiceException: java.lang.NullPointerException
at weblogic.wsee.jaxws.WLSInstanceResolver.getSingleton(WLSInstanceResolver.java:36)
at weblogic.wsee.jaxws.WLSInstanceResolver.start(WLSInstanceResolver.java:55)
at weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker.start(WLSInstanceResolver.java:82)
at com.sun.xml.ws.server.InvokerTube.setEndpoint(InvokerTube.java:85)
at weblogic.wsee.jaxws.EndpointAwareLateInitTube.postCreateEndpoint(EndpointAwareLateInitTube.java:48)
at weblogic.wsee.jaxws.JAXWSServlet.registerEndpoint(JAXWSServlet.java:158)
at weblogic.wsee.jaxws.JAXWSServlet.init(JAXWSServlet.java:68)
at weblogic.wsee.jaxws.JAXWSDeployedServlet.init(JAXWSDeployedServlet.java:55)

…………………
………………….
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:69)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Caused By: java.lang.NullPointerException
at com.demo.BasicOrderMgrService_BasicOrderMgrSoapPortImpl.(BasicOrderMgrService_BasicOrderMgrSoapPortImpl.java:26)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:357)
at java.lang.Class.newInstance(Class.java:310)

I tried below steps to resolve the issue :

1 : Checked the java build path of the eclipse , to make sure that there is no weblogic.jar and wsseclient.jar in the classpath .

It was present, I removed it and tried it again, received the same exception.

 

2: Exported the project as the war file from eclipse and deployed manually on the Weblogic Server , still received the same exception.

Then, after some troubleshooting, I found the below solution :

1 : looked into the generated Web Service Class file from eclipse , and found that the wsdlLocation was having a warning message : wsdl location not found . 

value of the above parameter was : wsdlLocation=”.wsdls/myservice.wsdl”

Then I changed the value to below :

wsdlLocation = “WEB-INF/wsdls/myservice.wsdl”

recompiled and deployed the application and the deployment was successful .

 

 

 

Please follow and like us:

No Responses

Please add your comments here