Announcement Announcement Module
Collapse
No announcement yet.
WebService returning NULL on Client Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • WebService returning NULL on Client

    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

    Code:
    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:

    Code:
    		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.

    Code:
    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.

  • #2
    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
    Code:
    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.SAXParserImpl.setProperty(Unknown Source)
    	at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:246)
    	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
    	at org.apache.axis.Message.getSOAPEnvelope(Message.java: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(AxisClientProxy.java:186)
    	at $Proxy0.getPackageCodes(Unknown Source)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    Could the problem be with $Proxy0.getPackageCodes?

    Comment


    • #3
      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:

      Code:
      2004-10-31 17&#58;37&#58;33,941 DEBUG &#91;org.apache.axis.utils.NSStack&#93; - <NSPop &#40;empty&#41;>
      2004-10-31 17&#58;37&#58;33,941 DEBUG &#91;org.apache.axis.encoding.DeserializationContextImpl&#93; - <Popped element stack to null>
      2004-10-31 17&#58;37&#58;33,941 DEBUG &#91;org.apache.axis.encoding.DeserializationContextImpl&#93; - <Exit&#58; DeserializationContextImpl&#58;&#58;endElement&#40;&#41;>
      2004-10-31 17&#58;37&#58;33,941 DEBUG &#91;org.apache.axis.encoding.DeserializationContextImpl&#93; - <Enter&#58; DeserializationContextImpl&#58;&#58;endPrefixMapping&#40;soapenv&#41;>
      2004-10-31 17&#58;37&#58;33,941 DEBUG &#91;org.apache.axis.encoding.DeserializationContextImpl&#93; - <Exit&#58; DeserializationContextImpl&#58;&#58;endPrefixMapping&#40;&#41;>
      2004-10-31 17&#58;37&#58;33,941 DEBUG &#91;org.apache.axis.encoding.DeserializationContextImpl&#93; - <Enter&#58; DeserializationContextImpl&#58;&#58;endPrefixMapping&#40;xsd&#41;>
      2004-10-31 17&#58;37&#58;33,941 DEBUG &#91;org.apache.axis.encoding.DeserializationContextImpl&#93; - <Exit&#58; DeserializationContextImpl&#58;&#58;endPrefixMapping&#40;&#41;>
      2004-10-31 17&#58;37&#58;33,941 DEBUG &#91;org.apache.axis.encoding.DeserializationContextImpl&#93; - <Enter&#58; DeserializationContextImpl&#58;&#58;endPrefixMapping&#40;xsi&#41;>
      2004-10-31 17&#58;37&#58;33,941 DEBUG &#91;org.apache.axis.encoding.DeserializationContextImpl&#93; - <Exit&#58; DeserializationContextImpl&#58;&#58;endPrefixMapping&#40;&#41;>
      2004-10-31 17&#58;37&#58;33,941 DEBUG &#91;org.apache.axis.encoding.DeserializationContextImpl&#93; - <Enter&#58; DeserializationContextImpl&#58;&#58;endDocument&#40;&#41;>
      2004-10-31 17&#58;37&#58;33,941 DEBUG &#91;org.apache.axis.encoding.DeserializationContextImpl&#93; - <Exit&#58; DeserializationContextImpl&#58;&#58;endDocument&#40;&#41;>
      2004-10-31 17&#58;37&#58;33,941 DEBUG &#91;org.apache.axis.transport.http.HTTPSender&#93; - <java.lang.NullPointerException>
      Which is where everything blows up. The object being parsed is a List.

      Comment


      • #4
        Same here

        I'm having the same problem with my project. . . does anyone can acctually help?

        Comment


        • #5
          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/}hostnameESENV13

          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...

          Comment


          • #6
            Same issue

            Hi felipe,

            Did you figure out why? I also met the same issue using axis 1.4

            Comment


            • #7
              I had this problem too

              I had this problem too,

              and I solved it by upgrading from java 1.5.0_13 to java 1.5.0_15

              Comment

              Working...
              X