| Author |
JNI with AXIS - InvocationTargetException
|
Sai pradeep
Greenhorn
Joined: Jan 12, 2004
Posts: 10
|
|
Hi All! I came to know from the mailing list that many people used Jni with Axis. My task was to develop a web service which can invoke a JNI. Whenever I try to invoke jni from my service I get an Exception "InvocationTargetException". When i try to run this jni application without deploying it on the Axis, everything seems to work fine. I would be grateful to you, if anyone of you could be able to get me out of this Exception. Cheers Sai.
|
 |
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
|
|
|
It would be helpful if you would provide more details than just the exception class... Maybe a bit of code around the exception-throwing line?
|
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
|
 |
Sai pradeep
Greenhorn
Joined: Jan 12, 2004
Posts: 10
|
|
This is the Exception i get whenever i try to invoke my JNI method from AXIS Service. java.lang.reflect.InvocationTargetException AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.lang.reflect.InvocationTargetException faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:AxisFault
faultCode: \ {http://schemas.xmlsoap.org/soap/envelope/} Server.userException
faultSubcode:
faultString: java.lang.reflect.InvocationTargetException
faultActor:
faultNode:
faultDetail:
java.lang.reflect.InvocationTargetException
at \ org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:260)
\ x9;at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169) \ xa; at org.apache.axis.encoding.DeserializationContextImpl.endElement(Deserializat \ ionContextImpl.java:1083)
at \ org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at \ org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown \ Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentCont \ entDispatcher.dispatch(Unknown Source)
at \ org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown \ 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(DeserializationContextImpl.j \ ava:252)
at \ org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:553)
at \ org.apache.axis.Message.getSOAPEnvelope(Message.java:378)
at \ org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:675)
\ ;at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:128)
at \ org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)
\ x9;at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
at \ org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
at \ org.apache.axis.client.AxisClient.invoke(AxisClient.java:180)
at \ org.apache.axis.client.Call.invokeEngine(Call.java:2564)
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 \ IncidentClient.main(IncidentClient.java:22)
java.lang.reflect.InvocationTargetException at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java: \ 260) at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:1 \ 69) at org.apache.axis.encoding.DeserializationContextImpl.endElement(Deserializat \ ionContextImpl.java:1083) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown \ Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispat \ cher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown \ 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(DeserializationCo \ ntextImpl.java:252) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:553) at org.apache.axis.Message.getSOAPEnvelope(Message.java:378) at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:67 \ 5) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:128) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java \ :71) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180) at org.apache.axis.client.Call.invokeEngine(Call.java:2564) 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 IncidentClient.main(IncidentClient.java:22)
|
 |
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
|
|
|
The stack trace would indicate that your web service call never reaches your service class -- maybe you should check whether that's the case by, for example, the good old System.out.println()?
|
 |
JeanLouis Marechaux
Ranch Hand
Joined: Nov 12, 2001
Posts: 906
|
|
Just like Lasse, I think the faultString: java.lang.reflect.InvocationTargetException means the Axis client is unable to reach the Webservice you have specified. Double check the service name exists and is properly deployed onto you server.
|
/ JeanLouis<br /><i>"software development has been, is, and will remain fundamentally hard" (Grady Booch)</i><br /> <br />Take a look at <a href="http://www.epfwiki.net/wikis/openup/" target="_blank" rel="nofollow">Agile OpenUP</a> in the Eclipse community
|
 |
 |
|
|
subject: JNI with AXIS - InvocationTargetException
|
|
|