axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tami Wright" <ttwri...@myfamilyinc.com>
Subject RE: String[] NullPointerException
Date Tue, 05 Oct 2004 15:55:05 GMT
Sounds to me like your other classes are not instantiating the String[]
array correctly.  Meaning--in your other classes do you ensure that you
are doing the following:

String[] stringName = new String[length];
...

stringName[0] = new String("some string"); //or use: stringName[0] =
"some string';
stringName[1] =  "another string";

return stringName;

You always have to instantiate each array element.

Tami

-----Original Message-----
From: Wu Gang [mailto:wu.gang@euromail.se] 
Sent: Tuesday, October 05, 2004 7:24 AM
To: axis-user@ws.apache.org
Subject: String[] NullPointerException

Hi,

I'm using jdk1.3.1, Tomcat4.1.30 and Axis1.1. I wrote a RPC service that
returns String[] to the client. The service impl calls other classes
that i developed earlier. I got NullPointerException every time, but if
i do not call other classes, just return i.e. new String[] {"1", "2"},
it went right!? I do not know why, someone please help me out!
StackTrace as followed:


#######################################
Exception in thread "main" AxisFault
 faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.lang.NullPointerException
 faultActor:
 faultNode:
 faultDetail:
        {http://xml.apache.org/axis/}stackTrace: AxisFault
 faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.lang.NullPointerException
 faultActor:
 faultNode:
 faultDetail:

java.lang.NullPointerException
        at
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.ja
va:260)
        at
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.jav
a:169)
        at
org.apache.axis.encoding.DeserializationContextImpl.endElement(Deseriali
zationContextImpl
..java:1015)
        at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
patcher.dispatch(
Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
wn Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
        at javax.xml.parsers.SAXParser.parse(Unknown Source)
        at
org.apache.axis.encoding.DeserializationContextImpl.parse(Deserializatio
nContextImpl.java
:242)
        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
com.utilities.service.search.SearchSoapBindingStub.getDocumentIds(Search
SoapBindingStub.j
ava:147)
        at
com.utilities.service.search.SearchClient.main(SearchClient.java:24)


java.lang.NullPointerException
        at
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.ja
va:260)
        at
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.jav
a:169)
        at
org.apache.axis.encoding.DeserializationContextImpl.endElement(Deseriali
zationContextImpl
..java:1015)
        at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
patcher.dispatch(
Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
wn Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
        at javax.xml.parsers.SAXParser.parse(Unknown Source)
        at
org.apache.axis.encoding.DeserializationContextImpl.parse(Deserializatio
nContextImpl.java
:242)
        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
com.utilities.service.search.SearchSoapBindingStub.getDocumentIds(Search
SoapBindingStub.j
ava:147)
        at
com.utilities.service.search.SearchClient.main(SearchClient.java:24)



Mime
View raw message