Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.lang.reflect.InvocationTargetException

843833Dec 29 2004 — edited May 14 2009
Hi

I have been having problems with this exception in particluar tracing the cause and trying to sort it out.

I am using Axis as my SOAP engine on a Tomcat 4.0 web server.

I am trying to access a remote database over our internal network.

The classes that I am using to access the database all work well when they are invoked from a JSP calling them directly. However when I generate the web services stubs and replicate the code needed to invoke my classes I get the following error.
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)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169)
at org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1015)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1675)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1926)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1926)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:634)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:333)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.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 uk.gov.kirklees.masterpiece.webservices.AccountSoapBindingStub.getFiscalSetTotal(AccountSoapBindingStub.java:179)
at uk.gov.kirklees.masterpiece.webservices.TestClient.main(TestClient.java:30)
java.lang.reflect.InvocationTargetException
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:260)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169)
at org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1015)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1675)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1926)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1926)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:634)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:333)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.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 uk.gov.kirklees.masterpiece.webservices.AccountSoapBindingStub.getFiscalSetTotal(AccountSoapBindingStub.java:179)
at uk.gov.kirklees.masterpiece.webservices.TestClient.main(TestClient.java:30)

The TestClient is just designed to replicate the entry of the variables into the request that I had previously enteted via a JSP.

Capturing the Exception at first seemd to indicatee that there was a timeout problem - this was feasible since the response requires to access the database twice to actually obtain enough information to create the response. However I recreated the WSDLtoJava section of the process and added the -O -1 parameter as described to negate timeouts. I am still getting the above error.

I would be gratefule if anyone could indicate other avenues to pursue in this, I am using Netbeans to compile the code and can debug through that but I can't seem to find any real indications of the base cause of this.
This is the code for my TestClient

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;


public class TestClient {

public static void main(String[] args) {
String account = args[0];
String year = args[1];
String fset = args[2];
String ftype = args[3];
try{
AccountService service = new AccountServiceLocator();
Account myAccount = service.getAccount();
String total = myAccount.getFiscalSetTotal(account, year,fset, ftype);
System.out.println(total);
}catch(Exception e){
Exception ex = e;
System.out.println(e.getMessage());
e.printStackTrace();
}
}
}


All help much appreciated
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 11 2009
Added on Dec 29 2004
8 comments
7,965 views