Null Pointer Exception when trying to call webservice


#1

Hi All,

Upgrading from ACF —> Lucee 5.

One on my functions in a CFC calls a webservice. The webservice call in ACF works fine.
The same call in Lucee returns a null pointer exception.

web service call:

<cfscript>
			var wsargs = structnew();
			var wsargs.refreshwsdl="yes";
			var tws = CreateObject("webservice", "#theWsdlURL#", wsargs);
			var tws = AddUserHeaders(tws);
		  
                        tws.getAllProposalPermissions(proposalId=id);
</cfscript>


I’ve verified the WSDL is available, and the method is avaialable.

Basically - the call works in ACF - but fails in Lucee.

Stack Trace:

lucee.runtime.exp.NativeException: ; nested exception is:
java.lang.NullPointerException
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.client.Call.invoke(Call.java:2470)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at lucee.runtime.net.rpc.client.Axis1Client.invoke(Axis1Client.java:468)
at lucee.runtime.net.rpc.client.Axis1Client._call(Axis1Client.java:391)
at lucee.runtime.net.rpc.client.Axis1Client.callWithNamedValues(Axis1Client.java:165)
at lucee.runtime.net.rpc.client.Axis1Client.callWithNamedValues(Axis1Client.java:196)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:833)
at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1737)
at model.cayuse.cayusegateway_cfc$cf.udfCall1(/ramses/model/cayuse/cayuseGateway.cfc:261)
at model.cayuse.cayusegateway_cfc$cf.udfCall(/ramses/model/cayuse/cayuseGateway.cfc)

Where would be a good place to start troubleshooting this?
I don’t have access to the code behind the webservice.

It only throws an NPE in Lucee.

Other calls to this WSDL in Lucee are working with the same syntax.

??
.


#2

HI @illiquent,

I tested with lucee 5.2.9.32 version & latest lucee 5.3.1.74 version working fine with my test web service call. I can’t able to reproduce the issue.

In which lucee version did you saw this?

Can you create simple test file & post here, thus helps a lot to find the issue


#3

My suspicion is something like

https://luceeserver.atlassian.net/plugins/servlet/mobile#issue/LDEV-933

But without detail (your wsdl, dump of http communications etc) it’ll be hard to reproduce.


#4

Hello,

We are using

Lucee 5.2.7.63

I will upgrade to 5.2.9.31 and see if the problem persists.

I will create test file as you request.

This does not affect all web service calls being made for us.

Thanks


#5

Upgraded to Lucee 5.2.9.31.
Still no luck.

here was the original ACF9 Call.

<cffunction name="getAllPermissions" output="no">
		<cfargument name="proposal_number" hint="proposal number">
                 <cfset pws = ''>
		<cfif NOT PermissionServiceIsUp()> 	<cfreturn> </cfif>

		<cfscript>
			pws = CreateObject("webservice","#wsPermWsdl#");
            addSOAPRequestHeader(pws, "#wsServer#", "soapUser", "#wsUname#");
			addSOAPRequestHeader(pws, "#wsServer#", "soapPass", "#wsPwd#");
            return pws.getAllProposalPermissions("#arguments.proposal_number#");
		</cfscript>

	</cffunction>

From the WSDL
<message name="getAllProposalPermissions">
<part name="parameters" element="tns:getAllProposalPermissions"/>
</message>

From Wizdler chrome plug in. An example fo a HTTPS post to the service

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
    <Body>
        <getAllProposalPermissions xmlns="http://permission.server.ws.xxxxx.com/">
            <proposalId xmlns="">1009250244</proposalId>
        </getAllProposalPermissions>
    </Body>
</Envelope>

Which returns:

<?xml version='1.0' encoding='UTF-8'?>

<S:Envelope xmlns:S=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/”>
<S:Body>
<ns2:getAllProposalPermissionsResponse xmlns:ns2=“http://permission.server.ws.cayuse.com/”>

false
list
read
print
write
attach
breaklock
delete
permchange
permadduser
permdeleteuser
cayuseadmin

</ns2:getAllProposalPermissionsResponse>
</S:Body>
</S:Envelope>


When I take the exact manually post with CFHTTP to do a manual soap request, I get a 500 Internal server error code returned back.

The webservice is not written in CF and I don’t have access to the code for the it.


#6

Here is the catalina.out file for the tomcat container where the webservice resides.

Oct 05, 2018 9:56:58 AM com.sun.xml.ws.transport.http.HttpAdapter invokeAsync
SEVERE: Unsupported Content-Type: application/json Supported ones are: [text/xml]
com.sun.xml.ws.server.UnsupportedMediaException: Unsupported Content-Type: application/json Supported ones are: [text/xml]
        at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:322)
        at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:156)
        at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:314)
        at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:347)
        at com.sun.xml.ws.transport.http.HttpAdapter.invokeAsync(HttpAdapter.java:541)
        at com.sun.xml.ws.transport.http.servlet.ServletAdapter.invokeAsync(ServletAdapter.java:212)
        at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:161)
        at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:197)
        at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:81)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:193)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)