axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alicia Sánchez-Mora" <aliciasm...@gmail.com>
Subject InvocationTargetException
Date Fri, 02 Mar 2007 14:54:47 GMT
 Hello,

I am developig a web service in Java. I use axis 1.4 and tomcat 5.5. From
the Client (Client.java) side I have to call some services in the class (
SDMInterfaceImpl.java). All was working correctly but now I have to add a
GUI.  Every time I call I service in a graphical window should appear a
message. When I add to my application the new code to run the GUI I have the
following error in the client side:


 Exception in thread "main" AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
<http://schemas.xmlsoap.org/soap/envelope/%7DServer.userException>
 faultSubcode:
 faultString: java.lang.reflect.InvocationTargetException
 faultActor:
 faultNode:
 faultDetail:
        { http://xml.apache.org/axis/}hostname:kif.mwrl.net
<http://xml.apache.org/axis/%7Dhostname:kif.mwrl.net>

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 :633)
        at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement
(XMLNSDocumentScannerImpl.java:713)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(
XMLDocumentFragmentScannerImpl.java:1685)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragm
entScannerImpl.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: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 org.ambientnetworks.sd_sde.client.Client.main(Client.java:55)


I attach here the service and the client code too. Could someone tell me
where the error comes from? And is it correct the way I create the GUI?

 package  org.ambientnetworks.sd_sde;
import java.awt.*;
import java.awt.event.*;

public class SDMInterfaceImpl  extends Thread implements SDMInterface{

private String hit =  "hit";
private String dummy_result = "ok";
private int result;
private int puzzle;
private List listOptions;

private static SDMInterfaceImpl instance;
private Frame f;
private TextField txtResults;



//public SDMInterfaceImpl() {
 public void init() {
          //init the GUI

      f = new Frame();
      txtResults = new TextField();
      listOptions = new List();
      f.add(listOptions);
      f.pack();
      f.setVisible(true);
  }

 public static SDMInterfaceImpl getInstance () {
      if(instance == null) {
         instance = new SDMInterfaceImpl ();
      }
      return instance;
   }

public String reqConn(String src, String dst){


    final String sourceHIT = src;
    final String destinationHIT = dst;
    new Thread (){

        public void run (){
            try {
                if (sourceHIT.equals(hit)) {
                    String res =  "ok";
                    result = new Integer (1);
                    puzzle =1;
                }

                else {
                    String res = "notOK"
                    result= new Integer (0);
                    puzzle = 10;
                }

            init();
            listOptions.addItem("reqConn");

            }catch (Exception e) {
                e.printStackTrace();
            }
        }



    }.start();

    return dummy_result;
}
}
*************************************************************************

import org.ambientnetworks.sd_sde.utils.*;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.utils.Options;

import javax.xml.rpc.ParameterMode;
import java.awt.*;
import java.awt.event.*;

public class Client {

public static void main (String [] args) throws Exception {



SDMInterfaceImpl sdm = SDMInterfaceImpl.getInstance ();
sdm.init();

String endpoint = " http://localhost:8180/SecurityDomainManager/services/sdm
";

  String method = "reqConn";
  Service  service = new Service ();
  Call call = (Call) service.createCall();

  call.setTargetEndpointAddress (new java.net.URL(endpoint));
  call.setOperationName (method);
  call.addParameter ("par1", XMLType.XSD_STRING, ParameterMode.IN);
  call.addParameter ("par2", XMLType.XSD_STRING, ParameterMode.IN );
  call.setReturnType (XMLType.XSD_STRING);

  String result = (String) call.invoke (new Object [] {"hit_a", "hit_b"});
  System.out.println ("Got response =" + result);




}
}





Thanks in advance,

Alicia

Mime
View raw message