dovle wrote:
>Hi ,
>Thanks for the point.
>But how can you explain that I have a service on apache soap server ( a class
>that has some exposed methods ) and one of the methods throws an
>SOAPException . In fact throws my own exception that extends SOAPException .
>And it works . Well , last time it worked. Now I should try to re-deploy to
>see if is something wrong with my own code or .
>
It works out that your services is not always throwing an exception
sometimes it is working, but when it does throw an exception it is
getting masked by the NullPointerException.
>
>
>Might be something wrong to the isd:faultListener from DeploymentDescriptor ?
>
>Anyway, what does the line with isdFaultListener from DD.xml means ?
>( a little bit new to apache soap )
>
To tell you the truth I'm not exactly sure what the faultListener is
for. It's a class that gets put in an array with all of the other
faultListeners from all of the other services and then helps report
errors. I guess.
>
>Please, can you tell me what do I have to change in order to make it work?
>
Anyways to take care of the NullPointerException do the following.
Below is the buildFaultRouter method in the DeploymentDescriptor class
located in src/org/apache/server/DeploymentDescriptor.java within SOAP.
The
public SOAPFaultRouter buildFaultRouter(SOAPContext ctxt) {
if (fr != null) return fr;
fr = new SOAPFaultRouter();
if (faultListener == null) return fr;
SOAPFaultListener[] lis = new
SOAPFaultListener[faultListener.length];
try {
for (int i = 0; i < faultListener.length; i++) {
Class c = ctxt.loadClass( faultListener[i] );
// fix for the nullpointerexception that soap would throw
if (c == null) {
if
(faultListener[i].equalsIgnoreCase("org.apache.soap.server.DOMFaultListener"))
lis[i] = (SOAPFaultListener) new
org.apache.soap.server.DOMFaultListener();
else if
(faultListener[i].equalsIgnoreCase("org.apache.soap.server.ExceptionFaultListener"))
lis[i] = (SOAPFaultListener) new
org.apache.soap.server.ExceptionFaultListener();
} else
lis[i] = (SOAPFaultListener)c.newInstance();
}
}
catch (Exception e) {
}
fr.setFaultListener(lis);
return fr;
}
What happens is that for some reason the faultListener instance exists
except when you put it into the array it's not there, and then SOAP
tries to notify all Listeners except there aren't any.
Good luck
Rich Catlett
>
>Thanks ,
>dovle
>
>>This is actually a bug in the apache code. I tracked it down for some
>>reason when a fault occurs, when the soap code sets a faultrouter in the
>>soap code the one that it is going to add to the list exists, but it
>>adds it, and then nothing is there. When it tries to access the list
>>there is nothing there and it throws the NullPointerException. I spent
>>some time on it, but I ended up having to just skip it so it never tries
>>to notify faultListeners. The NullPointerException is masking the
>>actual exception that occured. I gave a very detailoed description and
>>never heard anything else. You can search the archives for it.
>>
>>Rich Catlett
>>