Apache Axis Woes - Return Code (0)null

The latest project at work is using a service tier setup. We have the web front-end that’s using Struts 1.2 (yes, old!), Weblogic 9.2, Apache Axis 1.3, JSON & jQuery. The back-end web services are written in .Net (and how difficult it seems to be for developers to work in .Net). Things at least work, up until you receive very strange errors such as this:

java.lang.NullPointerException
at weblogic.xml.jaxp.ChainingEntityResolver.popEntityResolver(ChainingEntityResolver.java:75)
at weblogic.xml.jaxp.RegistryDocumentBuilder.setEntityResolver(RegistryDocumentBuilder.java:179)

and this:
AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (0)null
faultActor:
faultNode:
faultDetail:
{}:return code: 0

The worst thing about this error is that it’s completely non-descriptive. You can’t get a damn thing from your code (the WS call looks good; no connectivity errors). I spent in total 1 and a half days debugging this issue, and got nowhere. Google was returning red-herrings and forum posts with no solution and desperate coders saying ‘plz help me’. Painful stuff.

The fix as I see it, is to ensure the services are in sync. with the client.

  1. Make sure your web service is deployed correctly - the issue we discovered is that the client was sending extra objects that the service wasn’t expecting
  2. Regenerate your client - the client must be talking to the right methods and sending the correct object types. It looks like because the web service didn’t like our objects, it wasn’t returning a result (errors such as ‘There was an error while trying to serialize parameter X with data contract name Y’). The response therefore cannot be parsed, and you’ll get XML parsing errors caused by null pointers
  3. Check your logs; both server & client - we only found the true cause of our particular error because the service developer opened up the log directory in IIS. From that, I tail’d the log file when making a call and noticed the serialization errors.
  4. Don’t panic - yes it’s true, HHGTTG is right: panicking doesn’t help.

I first encountered this error well over a year ago when developing some web services myself. I’m no expert and I didn’t have the time to add logging (and indeed rebuild Axis) to Axis itself, but I’m sure the response returned from the service is totally unusable by the XML parser in your Application server and thus Axis itself.

I hope this helps someone. I spent so much time searching Google and pulling my hear out with no real solution…

2 Comments

  1. Srinivas
    Posted June 11, 2008 at 2:09 am | Permalink

    Hi-

    I am using axis 1.2.1 jar for webservice calls, we are facing an issue if the load increases on server it is throwing a weird error, it is not even returning any error response it is just returning (0) null. Can anyone help me , what is the reason for this prob and how can be fixed.

    Is this anything related to axis version.

    Below is the error:

    Caused by: (0)null
    at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
    at org.apache.axis.client.Call.invoke(Call.java:2748)
    at org.apache.axis.client.Call.invoke(Call.java:2424)
    at org.apache.axis.client.Call.invoke(Call.java:2347)
    at org.apache.axis.client.Call.invoke(Call.java:1804)

    Any thing would be of great help.

    Thanks-
    Srinivas.

  2. Posted June 11, 2008 at 7:39 am | Permalink

    Srinivas:
    How are you generating your client to talk to the web service? Have you rebuilt it and/or regenerated it from scratch?

2 Trackbacks/Pingbacks

  1. […] […]

  2. […] […]

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*