You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Rebhi Baraka <rb...@risc.uni-linz.ac.at> on 2006/01/21 18:43:21 UTC

java.lang.reflect.InvocationTargetException

I have a deployed service with a method that has 3 parameters as follows:

myMethod(Document doc, Document[] docs1, Document[] docs2)

The method returns a boolean value.

So when I try to invoke the service. I receive the  exception shown 
below. I am afraid that my deploy.wsdd is not correct because the 
typeMappings for the parameters are missing. The deploy.wsdd is as follows:

<deployment xmlns="http://xml.apache.org/axis/wsdd/"
            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
 <service name="Prove" provider="java:RPC">
  <parameter name="className" value="Prove"/>
  <parameter name="allowedMethods" value="prove"/>
 </service>
</deployment>

If you think I should define the typeMapping, please indicate by an 
example how can I define it for Document and Document[]. I have not seen 
an explicit example around.


This is the exception I get when I try to access the service. Please 
indicate what could be the cause  of it.

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:java.lang.reflect.InvocationTargetException
    at 
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
    at 
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
    at 
org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
    at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:585)
    at 
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:560)
    at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1555)
    at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:341)
    at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:828)
    at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:758)
    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:1178)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
    at 
org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
    at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
    at 
org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at 
at.ac.uni_linz.risc.perseus.ProveSoapBindingStub.prove(ProveSoapBindingStub.java:138)


Thanks for any help,
Rebhi.

Re: java.lang.reflect.InvocationTargetException

Posted by Jim Azeltine <ja...@sbcglobal.net>.
I have a suggestion for you. I have found this approach to be invaluable to me. I am using Eclipse 3.1 with the WTP 1.0M8 plugin package. I use the "Bottom up" method of creating a new web service from a Java class. Once you get the service built (which is automatic), it is published to the local Tomcat instance running under Eclipse. You can then use the plugin to create a client application with a set of working JSP's to test your service. Once you get it working, you can use the Eclipse export to war file wizard to package the service and then ftp it to your target server and deploy it. Now that you have a running service and client, you can dissect and study it, and learn a repeatable method for web service construction.You can take the generated client classes and plug them in to your own client programs. You can experiment with different types of Java classes, and see how the WSDL files are laid out once you generate them. You can point the Web Client wizard at publishe
 d
 services (via the ?wsdl method) to create an instant client for that service.
  This approach allows you to focus your attention and effort on creating the correct Java bean that you want to expose as a service, including what is passed and returned. Tip:If you need to return numerous copies of something in the return, create a custom bean to hold it, and return an array of those. I endured much pain before I found that technique. 
  I have learned more about what really works this way than anything else, other that this list! 8)
  You may have some pain getting the WTP plugin to work, I did. I went through so much crap I don't even know how I did it! If you can get it working, it is WELL WORTH IT.
   
  Jim Azeltine
  Sr. Software Engineer, SAIC

Rebhi Baraka <rb...@risc.uni-linz.ac.at> wrote:
  I have a deployed service with a method that has 3 parameters as follows:

myMethod(Document doc, Document[] docs1, Document[] docs2)

The method returns a boolean value.

So when I try to invoke the service. I receive the exception shown 
below. I am afraid that my deploy.wsdd is not correct because the 
typeMappings for the parameters are missing. The deploy.wsdd is as follows:

xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">








If you think I should define the typeMapping, please indicate by an 
example how can I define it for Document and Document[]. I have not seen 
an explicit example around.


This is the exception I get when I try to access the service. Please 
indicate what could be the cause of it.

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:java.lang.reflect.InvocationTargetException
at 
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at 
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at 
org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:585)
at 
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:560)
at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1555)
at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:341)
at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:828)
at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:758)
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:1178)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at 
org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at 
org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at 
at.ac.uni_linz.risc.perseus.ProveSoapBindingStub.prove(ProveSoapBindingStub.java:138)


Thanks for any help,
Rebhi.