View Full Version : WebService returning NULL on Client
bryanz
Oct 30th, 2004, 04:21 PM
Using JPetStore as the foundation, I have attempted to strip out everything with the exception of the remoting component itself. The only thing I have kept are the elements associated to the OrderService and have removed the DAO so that a hard coded value should always be returned.
When I invoke it, I get the following error
Exception in thread "main" org.springframework.remoting.RemoteAccessException : C
annot access JAX-RPC service [{http://localhost:8080/WebModule/axis/OrderService
}OrderService]; nested exception is org.apache.axis.AxisFault: ; nested exceptio
n is:
java.lang.NullPointerException
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.NullPointerException
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace: java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:396)
The error occurs after the call to getOrder is executed. My invocation looks like the follows:
Map orderServices = this.beanFactory.getBeansOfType(OrderService.class , true, true);
for (Iterator it = orderServices.keySet().iterator(); it.hasNext();)
{
String beanName = (String) it.next();
OrderService orderService = (OrderService) orderServices.get(beanName);
Order order = orderService.getOrder();
System.out.println(order.getFoo());
}
If I request the WSDL from a browser it looks to be good. Furthermore, the implementation on the server side is being called and is creating a simple object and returning it.
public class ServiceImpl implements OrderService
{
public Order getOrder()
{
System.out.println("Requested an Order");
Order order = new Order();
order.setFoo("This is a foo!");
return order;
}
}
It seems that my "Requested and Order" string comes out onto the display after the error on the client occurs. Very strange.
Any help would be great.
bryanz
Oct 31st, 2004, 05:14 PM
Is there something in the wsdd file that would cause the service to be invoked correctly on the server side but cause the information to come back incorrectly (throw a NULL) .
Here is the fault
xisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.NullPointerException
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace: java.lang.NullPointerException
at java.util.Hashtable.put(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserI mpl.setProperty(Unknown Source)
at org.apache.axis.encoding.DeserializationContextImp l.parse(DeserializationContextImpl.java:246)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPar t.java:538)
at org.apache.axis.Message.getSOAPEnvelope(Message.ja va:376)
at org.apache.axis.client.Call.invokeEngine(Call.java :2583)
at org.apache.axis.client.Call.invoke(Call.java:2553)
at org.apache.axis.client.Call.invoke(Call.java:2248)
at org.apache.axis.client.Call.invoke(Call.java:2171)
at org.apache.axis.client.Call.invoke(Call.java:1691)
at org.apache.axis.client.AxisClientProxy.invoke(Axis ClientProxy.java:186)
at $Proxy0.getPackageCodes(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
Could the problem be with $Proxy0.getPackageCodes?
bryanz
Oct 31st, 2004, 05:39 PM
I've turned on debugging and the server side creates the proper envelope and sends it off. It is received by the client side which it does the deserialization.
Eventually it gets the following:
2004-10-31 17:37:33,941 DEBUG [org.apache.axis.utils.NSStack] - <NSPop (empty)>
2004-10-31 17:37:33,941 DEBUG [org.apache.axis.encoding.DeserializationContextIm pl] - <Popped element stack to null>
2004-10-31 17:37:33,941 DEBUG [org.apache.axis.encoding.DeserializationContextIm pl] - <Exit: DeserializationContextImpl::endElement()>
2004-10-31 17:37:33,941 DEBUG [org.apache.axis.encoding.DeserializationContextIm pl] - <Enter: DeserializationContextImpl::endPrefixMapping(soape nv)>
2004-10-31 17:37:33,941 DEBUG [org.apache.axis.encoding.DeserializationContextIm pl] - <Exit: DeserializationContextImpl::endPrefixMapping()>
2004-10-31 17:37:33,941 DEBUG [org.apache.axis.encoding.DeserializationContextIm pl] - <Enter: DeserializationContextImpl::endPrefixMapping(xsd)>
2004-10-31 17:37:33,941 DEBUG [org.apache.axis.encoding.DeserializationContextIm pl] - <Exit: DeserializationContextImpl::endPrefixMapping()>
2004-10-31 17:37:33,941 DEBUG [org.apache.axis.encoding.DeserializationContextIm pl] - <Enter: DeserializationContextImpl::endPrefixMapping(xsi)>
2004-10-31 17:37:33,941 DEBUG [org.apache.axis.encoding.DeserializationContextIm pl] - <Exit: DeserializationContextImpl::endPrefixMapping()>
2004-10-31 17:37:33,941 DEBUG [org.apache.axis.encoding.DeserializationContextIm pl] - <Enter: DeserializationContextImpl::endDocument()>
2004-10-31 17:37:33,941 DEBUG [org.apache.axis.encoding.DeserializationContextIm pl] - <Exit: DeserializationContextImpl::endDocument()>
2004-10-31 17:37:33,941 DEBUG [org.apache.axis.transport.http.HTTPSender] - <java.lang.NullPointerException>
Which is where everything blows up. The object being parsed is a List.
felipe.nunes
Jun 30th, 2006, 09:43 AM
I'm having the same problem with my project. . . does anyone can acctually help?
felipe.nunes
Jun 30th, 2006, 10:33 AM
I updated the Axis lib 1.2 to 1.4 and now the error message is:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.reflect.InvocationTargetException
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:DESENV13
java.lang.reflect.InvocationTargetException
at org.apache.axis.message.SOAPFaultBuilder.createFau lt(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElemen t(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.en dElement(DeserializationContext.java:1087)
at com.sun.org.apache.xerces.internal.parsers.Abstrac tSAXParser.endElement(AbstractSAXParser.java:633)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocum entScannerImpl.scanEndElement(XMLNSDocumentScanner Impl.java:719)
at com.sun.org.apache.xerces.internal.impl.XMLDocumen tFragmentScannerImpl$FragmentContentDispatcher.dis patch(XMLDocumentFragmentScannerImpl.java:1685)
at com.sun.org.apache.xerces.internal.impl.XMLDocumen tFragmentScannerImpl.scanDocument(XMLDocumentFragm entScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(XML11Configuration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLPars er.parse(XMLParser.java:148)
at com.sun.org.apache.xerces.internal.parsers.Abstrac tSAXParser.parse(AbstractSAXParser.java:1242)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:3 75)
at org.apache.axis.encoding.DeserializationContext.pa rse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPar t.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.ja va:435)
at org.apache.axis.handlers.soap.MustUnderstandChecke r.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClien t.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java :2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at br.com.sysdata.client.ws.WSEquifaxFacadeSoapBindin gStub.helpService(WSEquifaxFacadeSoapBindingStub.j ava:156)
at br.com.sysdata.client.ws.WSEquifaxFacadeServiceTes tCase.test1WSEquifaxFacadeHelpService(WSEquifaxFac adeServiceTestCase.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154 )
at junit.framework.TestCase.runBare(TestCase.java:127 )
at junit.framework.TestResult$1.protect(TestResult.ja va:106)
at junit.framework.TestResult.runProtected(TestResult .java:124)
at junit.framework.TestResult.run(TestResult.java:109 )
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:2 08)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:478)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:344)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:196)
I'm working on figuring out what is wrong now...
hellotao
Jan 10th, 2008, 09:17 AM
Hi felipe,
Did you figure out why? I also met the same issue using axis 1.4
danskal
Apr 25th, 2008, 03:09 PM
I had this problem too,
and I solved it by upgrading from java 1.5.0_13 to java 1.5.0_15
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.