Search code examples
javasoapwsdlweblogicweblogic12c

NullPointerException when creating instance of javax.xml.ws.Service on weblogic 12.2.1.3


We have a EshopService_Service class generated by JAX-WS RI 2.2.9-b130926.1035 - Generated source version: 2.2 from wsdl file.

After upgrading from weblogic version 12.1.2.0.0 to 12.2.1.3 we got this stack when creating Service instance:

java.lang.NullPointerException

    at com.oracle.webservices.impl.wsdl.WSDLBoundOperationImpl.<init>(WSDLBoundOperationImpl.java:540)

    at com.oracle.webservices.impl.wsdl.WSDLBoundPortTypeImpl.<init>(WSDLBoundPortTypeImpl.java:80)

    at com.oracle.webservices.impl.wsdl.WSDLModelImpl.mapBindings(WSDLModelImpl.java:169)

    at com.oracle.webservices.impl.wsdl.WSDLModelImpl.mapBindings(WSDLModelImpl.java:189)

    at com.oracle.webservices.impl.wsdl.WSDLModelImpl.<init>(WSDLModelImpl.java:48)

    at com.oracle.webservices.impl.wsdl.WSDLConverterImpl.wsdlModelFromDefinition(WSDLConverterImpl.java:292)

    at com.oracle.webservices.impl.wsdl.WSDLConverterImpl.getWSDLModel(WSDLConverterImpl.java:248)

    at com.oracle.webservices.impl.wsdl.WSDLConverterImpl.getWSDLService(WSDLConverterImpl.java:303)

    at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegateImpl.<init>(WLSProvider.java:1124)

    at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:223)

    at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:150)

    at javax.xml.ws.Service.<init>(Service.java:77)

    at xx.xx.xxxxxxx.services.eshop.EshopService_Service.<init>(EshopService_Service.java:40)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

    at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)

    at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)

    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)

    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:238)

    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:242)

    at com.xxx.prj.xxx.col.integration.business.IntegrationService.getEshopServicePort(IntegrationService.groovy:39)

    at com.xxx.prj.xxxx.col.integration.business.IntegrationService.<init>(IntegrationService.groovy:46)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

WSDLBoundOperationImpl is internal class of weblogic and there is no information about that class on web…

We’ve decompiled class WSDLBoundOperationImpl and it looks it is failing on owner.getPortType().get(this.name); when owner.getPortType() returns null...

Fact is that our WSDL does not contains any of “portType” element, but portType is not required wsdl directive and same WSDL was working well with Weblogic version 12.1.2.0.0 .

How to solve this problem? We can not change content of wsdl file...

Thank you.


Solution

  • Looks I've found workaround... Weblogic is using its own implementation of jax ws Provider... But with https://docs.oracle.com/cd/E24329_01/web.1211/e24964/data_types.htm#WSGET348 feature you can define javax.xml.ws.spi.Provider as (in my case) with org.apache.cxf.jaxws.spi.ProviderImpl ... Then, when creating Service instance, as Provider is used instance of apace.cxf provider...