0 Replies Latest reply on Mar 30, 2009 8:01 AM by Pierangelo Repetti

    Call.setReturnType gives NPE

    Pierangelo Repetti Newbie


      I am using JBossWS inside JBoss AS 4.2.2GA. I guess the WS version is 2.0.1GA.

      I get a NullPointer calling setReturnType(null) on an instance of Call.

      The Java EE doc for setReturnType javax.xml.rpc.Call says that
      "Invoking setReturnType(null) removes the return type for this Call object."
      and so does the JBoss implementation, org.jboss.ws.core.jaxrpc.client.CallImpl.

      The jboss stack trace is

      Caused by: java.lang.NullPointerException
      at org.jboss.ws.core.binding.TypeMappingImpl$IQName.(TypeMappingImpl.java:702)
      at org.jboss.ws.core.binding.TypeMappingImpl.getJavaType(TypeMappingImpl
      at org.jboss.ws.core.jaxrpc.client.CallImpl.setReturnType(CallImpl.java:

      I downloaded the sources and followed the stack trace. It looks to me that the NPE is justified, since the IQName constructor does not check the passed qname against null:

      public IQName(QName name)
      namespace = name.getNamespaceURI() != null ? name.getNamespaceURI().intern() : "".intern();
      localPart = name.getLocalPart() != null ? name.getLocalPart().intern() : "".intern();
      prefix = name.getPrefix() != null ? name.getPrefix().intern() : "".intern();
      hash = name.hashCode();

      Has anyone had the same problem ? Is it necessary to open a bug ?

      -- Pierangelo