I am working with a JAVA application that uses SOAP and RMI, and unfortunately I have a problem.
Since I am not an expert, I am not sure that this is a strict JAVA-RMI problem, but let's try...
The system is divided in three parts : the gui (also SOAP-client), the SOAP-server (also RMI-client) and the RMI-server.
The SOAP-client can connect the SOAP-server which can connect the RMI-server. Same things for response.
All hosts are different linux machines and jdk1.5 is used.
From the RMI-server point of view, I have one service named
'fgs' running (compilation ok, start ok (including
rmiregistry)).
From the RMI-client point of view, I have a soap file (
.jws), running under
tomcat/axis, which is compiled on the fly successfully (with one jar file that include the
.class of
'fgs' put in the
WEB-INF/lib folder).
Everything seems to be perfect, and indeed I am able to get the RMI object I want.
However, when I run a method, I get a
java.lang.reflect.InvocationTargetException exception, even if the method was a simple "HelloWorld" one.
More details below.
I would appreciate any input/ideas/remarks.
Many thanks in advance.
RobR
------------------------ RMI-client ---------------------
[...]
public String fgs() throws RemoteException {
RMIBT rmiBT = RMIBT.getInstance(); // RMIBT can be trusted.
Full obj = (Full) rmiBT.getObj(FULL_END); // This object is not null.
String results = "DEFAULT";
result = obj.getHelloWorld(); // If this line is commented, then no exception is thrown and I get "DEFAULT".
return result;
}
[...]
------------------------ RMI-server [Interface]---------------------
[...]
public interface Full extends Remote {
String getHelloWorld() throws RemoteException;
}
------------------------ RMI-server [Implementation]---------------------
[...]
public class FullImpl extends UnicastRemoteObject implements Full {
public String getHelloWorld() throws RemoteException {
return "Hello";
}
}
[...]
------------------------ Exception ---------------------
java.lang.reflect.InvocationTargetException
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:221)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:128)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1077)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:225)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:645)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:173)
at org.apache.axis.client.Call.invokeEngine(Call.java:2737)
[...]