axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Mietz Egli" <pe...@lightsurf.com>
Subject NPE in AxisServlet.doPost()
Date Tue, 22 Jan 2002 23:47:45 GMT

I've been getting NullPointerExceptions in the AxisServlet.doPost()
method when calling a method which returns an array of java.util.Map.
Other methods which return a single Map are working fine, as is the
stock quote demo and "ant functional-tests".

The stack dump follows:

java.lang.NullPointerException
	at org.apache.axis.SOAPPart.getAsBytes(SOAPPart.java:272)
	at org.apache.axis.Message.getContentType(Message.java:289)
	at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:540)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:165)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
	at
com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:8
2)
	at com.caucho.server.http.Invocation.service(Invocation.java:278)
	at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:129)
	at com.caucho.server.http.ServletServer.serviceTop(ServletServer.java:847)
	at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:213)
	at
com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:158)
	at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
	at java.lang.Thread.run(Thread.java:484)

Axis is running under Resin 2.0.4, JDK 1.3.1_02, and Red Hat 7.1.  Here's
the .jws file:

   import java.util.*;

   public class MapArrayTest {
     public Map[] getMapArray() {
       Map[] result = new Map[3];
       result[0] = new Hashtable();
       result[0].put("foo", "bar");
       result[1] = new Hashtable();
       result[1].put("baz", "bar");
       result[2] = new Hashtable();
       result[2].put("bog", "bar");
       return result;
     }
  }


and the client:


    import java.net.*;
    import java.util.Map;

    public class MapArrayTestClient {

        public static void main(String[] args) {
            System.out.println("starting...");
            testSimple();
            System.out.println("done.");
        }


        public static void testSimple() {
            try {
                org.apache.axis.client.Service service = new
org.apache.axis.client.Service();
                org.apache.axis.client.Call call =
(org.apache.axis.client.Call) service.createCall();

                call.setTargetEndpointAddress(new
URL("http://10.10.10.136:8080/axis/MapArrayTest.jws"));

                call.removeAllParameters();
                // call.setReturnType(new
org.apache.axis.encoding.XMLType(new
javax.xml.rpc.namespace.QName("http://10.10.10.136:80/axis/MapArrayTest.jws"
, "ArrayOf_tns1_Map")));
                call.setReturnType(new org.apache.axis.encoding.XMLType(new
javax.xml.rpc.namespace.QName("http://www.w3.org/2001/XMLSchema",
"Array")));


call.setProperty(org.apache.axis.transport.http.HTTPTransport.ACTION, "");
                call.setOperationName( "getMapArray");

                Object resp = call.invoke(new Object[] {});

                if (resp instanceof java.rmi.RemoteException) {
                    ((java.rmi.RemoteException)resp).printStackTrace();
                }
                else {
                     Map[] result =
(java.util.Map[])org.apache.axis.utils.JavaUtils.convert(resp,java.util.Map[
].class);
                }

            }
            catch (Exception e) {
                e.printStackTrace();
            }
        }
    }


I also tried a QName of ("http://www.w3.org/2001/XMLSchema", "Array")
with the same results.

Anybody have any ideas or run into this problem before?

p.


Mime
View raw message