Jump to content

"java.lang.reflect.InvocationTargetException" Exception


keshari

Recommended Posts

Hi All,Me facing a problem related to java web services.I am using jdk-6u3,Eclipse and Tomcat 5.0.I am making the web service of WsEpp Class shown below@WebService public class WsEpp { EppService objcls; @WebMethod public int registerDomain(String ACTIVITY_ID,String DOMAIN_NAME,String DOMHOSTNAME1,String DOMSERVER_IP_ADDRESS1,String DOMHOSTNAME2,String DOMSERVER_IP_ADDRESS2,String DOM_MX ,String DOM_MX_IP,String DOM_REGISTRAR,String DOM_RCONTACTID,String DOM_ACONTACTID,String DOM_BCONTACTID,String DOM_TCONTACTID,String DOM_AUTHCODE,String DOM_CURRENT_REGISTRAR,String DOM_AUTHORIZATION_CODE,String DOM_REG_FIRSTNAME, String DOM_REG_LASTNAME,String DOM_REG_EMAIL,String DOM_REG_COMPANY_NAME,String DOM_REG_ADDRESS,String DOM_REG_CITY,String DOM_REG_COUNTRY,String DOM_REG_STATE,String DOM_REG_ZIP,String DOM_REG_PHONE,String DOM_REG_COUNTRY_CODE,String DOM_REG_AREA_CODE,String DOM_REG_FAX,String DOM_REG_MOBILE,String DOM_ADM_FIRST_NAME,String DOM_ADM_LAST_NAME,String DOM_ADM_EMAIL,String DOM_ADM_ADDRESS,String DOM_ADM_CITY,String DOM_ADM_COUNTRY,String DOM_ADM_STATE,String DOM_ADM_ZIP,String DOM_ADM_PHONE,String DOM_ADM_COUNTRY_CODE ,String DOM_ADM_AREA_CODE,String DOM_ADM_FAX,String DOM_ADM_MOBILE,String DOM_BILL_FIRST_NAME,String DOM_BILL_LAST_NAME,String DOM_BILL_EMAIL,String DOM_BILL_ADDRESS,String DOM_BILL_CITY,String DOM_BILL_COUNTRY,String DOM_BILL_STATE,String DOM_BILL_ZIP,String DOM_BILL_PHONE,String DOM_BILL_COUNTRY_CODE,String DOM_BILL_AREA_CODE,String DOM_BILL_FAX ,String DOM_BILL_MOBILE,String DOM_TECH_FIRST_NAME,String DOM_TECH_LAST_NAME,String DOM_TECH_EMAIL,String DOM_TECH_ADDRESS,String DOM_TECH_CITY,String DOM_TECH_COUNTRY,String DOM_TECH_STATE,String DOM_TECH_ZIP,String DOM_TECH_PHONE,String DOM_TECH_COUNTRY_CODE,String DOM_TECH_AREA_CODE,String DOM_TECH_FAX,String DOM_TECH_MOBILE ,int DURATION) {objcls=new EppService();int result=objcls.createDomain(ACTIVITY_ID,DOMAIN_NAME,DOMHOSTNAME1,DOMSERVER_IP_ADDRESS1,DOMHOSTNAME2,DOMSERVER_IP_ADDRESS2,DOM_MX,DOM_MX_IP,DOM_REGISTRAR, DOM_RCONTACTID,DOM_ACONTACTID,DOM_BCONTACTID,DOM_TCONTACTID,DOM_AUTHCODE,DOM_CURRENT_REGISTRAR,DOM_AUTHORIZATION_CODE,DOM_REG_FIRSTNAME,DOM_REG_LASTNAME,DOM_REG_EMAIL,DOM_REG_COMPANY_NAME,DOM_REG_ADDRESS,DOM_REG_CITY,DOM_REG_COUNTRY,DOM_REG_STATE,DOM_REG_ZIP,DOM_REG_PHONE,DOM_REG_COUNTRY_CODE,DOM_REG_AREA_CODE,DOM_REG_FAX,DOM_REG_MOBILE,DOM_ADM_FIRST_NAME,DOM_ADM_LAST_NAME,DOM_ADM_EMAIL,DOM_ADM_ADDRESS,DOM_ADM_CITY,DOM_ADM_COUNTRY,DOM_ADM_STATE,DOM_ADM_ZIP,DOM_ADM_PHONE,DOM_ADM_COUNTRY_CODE,DOM_ADM_AREA_CODE,DOM_ADM_FAX,DOM_ADM_MOBILE,DOM_BILL_FIRST_NAME,DOM_BILL_LAST_NAME,DOM_BILL_EMAIL,DOM_BILL_ADDRESS,DOM_BILL_CITY,DOM_BILL_COUNTRY,DOM_BILL_STATE,DOM_BILL_ZIP,DOM_BILL_PHONE,DOM_BILL_COUNTRY_CODE, DOM_BILL_AREA_CODE,DOM_BILL_FAX,DOM_BILL_MOBILE,DOM_TECH_FIRST_NAME,DOM_TECH_LAST_NAME,DOM_TECH_EMAIL,DOM_TECH_ADDRESS,DOM_TECH_CITY,DOM_TECH_COUNTRY,DOM_TECH_STATE,DOM_TECH_ZIP,DOM_TECH_PHONE,DOM_TECH_COUNTRY_CODE,DOM_TECH_AREA_CODE,DOM_TECH_FAX,DOM_TECH_MOBILE,DURATION);return result;}}The EppService Class is shown belowpublic class EppService { public int createDomain(String ACTIVITY_ID,String DOMAIN_NAME,String DOMHOSTNAME1,String DOMSERVER_IP_ADDRESS1,String DOMHOSTNAME2,String DOMSERVER_IP_ADDRESS2,String DOM_MX ,String DOM_MX_IP,String DOM_REGISTRAR,String DOM_RCONTACTID,String DOM_ACONTACTID,String DOM_BCONTACTID,String DOM_TCONTACTID,String DOM_AUTHCODE,String DOM_CURRENT_REGISTRAR,String DOM_AUTHORIZATION_CODE,String DOM_REG_FIRSTNAME, String DOM_REG_LASTNAME,String DOM_REG_EMAIL,String DOM_REG_COMPANY_NAME,String DOM_REG_ADDRESS,String DOM_REG_CITY,String DOM_REG_COUNTRY,String DOM_REG_STATE,String DOM_REG_ZIP,String DOM_REG_PHONE,String DOM_REG_COUNTRY_CODE,String DOM_REG_AREA_CODE,String DOM_REG_FAX,String DOM_REG_MOBILE,String DOM_ADM_FIRST_NAME,String DOM_ADM_LAST_NAME,String DOM_ADM_EMAIL,String DOM_ADM_ADDRESS,String DOM_ADM_CITY,String DOM_ADM_COUNTRY,String DOM_ADM_STATE,String DOM_ADM_ZIP,String DOM_ADM_PHONE,String DOM_ADM_COUNTRY_CODE ,String DOM_ADM_AREA_CODE,String DOM_ADM_FAX,String DOM_ADM_MOBILE,String DOM_BILL_FIRST_NAME,String DOM_BILL_LAST_NAME,String DOM_BILL_EMAIL,String DOM_BILL_ADDRESS,String DOM_BILL_CITY,String DOM_BILL_COUNTRY,String DOM_BILL_STATE,String DOM_BILL_ZIP,String DOM_BILL_PHONE,String DOM_BILL_COUNTRY_CODE,String DOM_BILL_AREA_CODE,String DOM_BILL_FAX ,String DOM_BILL_MOBILE,String DOM_TECH_FIRST_NAME,String DOM_TECH_LAST_NAME,String DOM_TECH_EMAIL,String DOM_TECH_ADDRESS,String DOM_TECH_CITY,String DOM_TECH_COUNTRY,String DOM_TECH_STATE,String DOM_TECH_ZIP,String DOM_TECH_PHONE,String DOM_TECH_COUNTRY_CODE,String DOM_TECH_AREA_CODE,String DOM_TECH_FAX,String DOM_TECH_MOBILE ,int DURATION) {int x;n4i.PrintClass obj_PrintClass= new n4i.PrintClass();x =obj_PrintClass.printData(DURATION);System.out.println(x);return x;}} The PrintClass is as shown below public class PrintClass {public int printData(int type){int str = 0;PrintLib obj_PrintLib = new PrintLib();switch (type){case 1: str = obj_PrintLib.returnTest1("","","","","","","","", "","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",0);break; case 2: str = obj_PrintLib.returnTest2("","","","","","","","", "","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",0);break; case 3: str = obj_PrintLib.returnData(3);break; default: str = 9; }return str;}} The PrintLib is as shown below public class PrintLib { private static epp_Command command_data = null;private static epp_CheckResult[] check_results = null; private static Format df = new SimpleDateFormat(Globals.DATE_TIME_FORMAT); public PrintLib(){ System.out.println("CONSTRUCTOR 1");this.command_data = new epp_Command();System.out.println("CONSTRUCTOR 2"); } public int returnTest1(String ACTIVITY_ID,String DOMAIN_NAME,String DOMHOSTNAME1, String DOMSERVER_IP_ADDRESS1,String DOMHOSTNAME2,String DOMSERVER_IP_ADDRESS2,String DOM_MX ,String DOM_MX_IP,String DOM_REGISTRAR,String DOM_RCONTACTID,String DOM_ACONTACTID,String DOM_BCONTACTID,String DOM_TCONTACTID,String DOM_AUTHCODE,String DOM_CURRENT_REGISTRAR,String DOM_AUTHORIZATION_CODE,String DOM_REG_FIRSTNAME, String DOM_REG_LASTNAME,String DOM_REG_EMAIL,String DOM_REG_COMPANY_NAME,String DOM_REG_ADDRESS,String DOM_REG_CITY,String DOM_REG_COUNTRY,String DOM_REG_STATE,String DOM_REG_ZIP,String DOM_REG_PHONE,String DOM_REG_COUNTRY_CODE,String DOM_REG_AREA_CODE,String DOM_REG_FAX,String DOM_REG_MOBILE,String DOM_ADM_FIRST_NAME,String DOM_ADM_LAST_NAME,String DOM_ADM_EMAIL,String DOM_ADM_ADDRESS,String DOM_ADM_CITY,String DOM_ADM_COUNTRY,String DOM_ADM_STATE,String DOM_ADM_ZIP,String DOM_ADM_PHONE,String DOM_ADM_COUNTRY_CODE ,String DOM_ADM_AREA_CODE,String DOM_ADM_FAX,String DOM_ADM_MOBILE,String DOM_BILL_FIRST_NAME,String DOM_BILL_LAST_NAME,String DOM_BILL_EMAIL,String DOM_BILL_ADDRESS,String DOM_BILL_CITY,String DOM_BILL_COUNTRY,String DOM_BILL_STATE,String DOM_BILL_ZIP,String DOM_BILL_PHONE,String DOM_BILL_COUNTRY_CODE,String DOM_BILL_AREA_CODE,String DOM_BILL_FAX ,String DOM_BILL_MOBILE,String DOM_TECH_FIRST_NAME,String DOM_TECH_LAST_NAME,String DOM_TECH_EMAIL,String DOM_TECH_ADDRESS,String DOM_TECH_CITY,String DOM_TECH_COUNTRY,String DOM_TECH_STATE,String DOM_TECH_ZIP,String DOM_TECH_PHONE,String DOM_TECH_COUNTRY_CODE,String DOM_TECH_AREA_CODE,String DOM_TECH_FAX,String DOM_TECH_MOBILE,int DURATION){return 1;} public int returnTest2(String ACTIVITY_ID,String DOMAIN_NAME,String DOMHOSTNAME1, String DOMSERVER_IP_ADDRESS1,String DOMHOSTNAME2,String DOMSERVER_IP_ADDRESS2,String DOM_MX ,String DOM_MX_IP,String DOM_REGISTRAR,String DOM_RCONTACTID,String DOM_ACONTACTID,String DOM_BCONTACTID,String DOM_TCONTACTID,String DOM_AUTHCODE,String DOM_CURRENT_REGISTRAR,String DOM_AUTHORIZATION_CODE,String DOM_REG_FIRSTNAME, String DOM_REG_LASTNAME,String DOM_REG_EMAIL,String DOM_REG_COMPANY_NAME,String DOM_REG_ADDRESS,String DOM_REG_CITY,String DOM_REG_COUNTRY,String DOM_REG_STATE,String DOM_REG_ZIP,String DOM_REG_PHONE,String DOM_REG_COUNTRY_CODE,String DOM_REG_AREA_CODE,String DOM_REG_FAX,String DOM_REG_MOBILE,String DOM_ADM_FIRST_NAME,String DOM_ADM_LAST_NAME,String DOM_ADM_EMAIL,String DOM_ADM_ADDRESS,String DOM_ADM_CITY,String DOM_ADM_COUNTRY,String DOM_ADM_STATE,String DOM_ADM_ZIP,String DOM_ADM_PHONE,String DOM_ADM_COUNTRY_CODE ,String DOM_ADM_AREA_CODE,String DOM_ADM_FAX,String DOM_ADM_MOBILE,String DOM_BILL_FIRST_NAME,String DOM_BILL_LAST_NAME,String DOM_BILL_EMAIL,String DOM_BILL_ADDRESS,String DOM_BILL_CITY,String DOM_BILL_COUNTRY,String DOM_BILL_STATE,String DOM_BILL_ZIP,String DOM_BILL_PHONE,String DOM_BILL_COUNTRY_CODE,String DOM_BILL_AREA_CODE,String DOM_BILL_FAX ,String DOM_BILL_MOBILE,String DOM_TECH_FIRST_NAME,String DOM_TECH_LAST_NAME,String DOM_TECH_EMAIL,String DOM_TECH_ADDRESS,String DOM_TECH_CITY,String DOM_TECH_COUNTRY,String DOM_TECH_STATE,String DOM_TECH_ZIP,String DOM_TECH_PHONE,String DOM_TECH_COUNTRY_CODE,String DOM_TECH_AREA_CODE,String DOM_TECH_FAX,String DOM_TECH_MOBILE,int DURATION){return 2;} public int returnData(int data){return data;}}The generated WSDL is as shown below<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions targetNamespace="http://DefaultNamespace" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://DefaultNamespace" xmlns:intf="http://DefaultNamespace" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><!--WSDL'>http://www.w3.org/2001/XMLSchema"><!--WSDL created by Apache Axis version: 1.4Built on Apr 22, 2006 (06:55:48 PDT)--><wsdl:types><schema elementFormDefault="qualified" targetNamespace="http://DefaultNamespace" xmlns="http://www.w3.org/2001/XMLSchema"><element'>http://www.w3.org/2001/XMLSchema"><element name="registerDomain"><complexType><sequence><element name="ACTIVITY_ID" type="xsd:string"/><element name="DOMAIN_NAME" type="xsd:string"/><element name="DOMHOSTNAME1" type="xsd:string"/><element name="DOMSERVER_IP_ADDRESS1" type="xsd:string"/><element name="DOMHOSTNAME2" type="xsd:string"/><element name="DOMSERVER_IP_ADDRESS2" type="xsd:string"/><element name="DOM_MX" type="xsd:string"/><element name="DOM_MX_IP" type="xsd:string"/><element name="DOM_REGISTRAR" type="xsd:string"/><element name="DOM_RCONTACTID" type="xsd:string"/><element name="DOM_ACONTACTID" type="xsd:string"/><element name="DOM_BCONTACTID" type="xsd:string"/><element name="DOM_TCONTACTID" type="xsd:string"/><element name="DOM_AUTHCODE" type="xsd:string"/><element name="DOM_CURRENT_REGISTRAR" type="xsd:string"/><element name="DOM_AUTHORIZATION_CODE" type="xsd:string"/><element name="DOM_REG_FIRSTNAME" type="xsd:string"/><element name="DOM_REG_LASTNAME" type="xsd:string"/><element name="DOM_REG_EMAIL" type="xsd:string"/><element name="DOM_REG_COMPANY_NAME" type="xsd:string"/><element name="DOM_REG_ADDRESS" type="xsd:string"/><element name="DOM_REG_CITY" type="xsd:string"/><element name="DOM_REG_COUNTRY" type="xsd:string"/><element name="DOM_REG_STATE" type="xsd:string"/><element name="DOM_REG_ZIP" type="xsd:string"/><element name="DOM_REG_PHONE" type="xsd:string"/><element name="DOM_REG_COUNTRY_CODE" type="xsd:string"/><element name="DOM_REG_AREA_CODE" type="xsd:string"/><element name="DOM_REG_FAX" type="xsd:string"/><element name="DOM_REG_MOBILE" type="xsd:string"/><element name="DOM_ADM_FIRST_NAME" type="xsd:string"/><element name="DOM_ADM_LAST_NAME" type="xsd:string"/><element name="DOM_ADM_EMAIL" type="xsd:string"/><element name="DOM_ADM_ADDRESS" type="xsd:string"/><element name="DOM_ADM_CITY" type="xsd:string"/><element name="DOM_ADM_COUNTRY" type="xsd:string"/><element name="DOM_ADM_STATE" type="xsd:string"/><element name="DOM_ADM_ZIP" type="xsd:string"/><element name="DOM_ADM_PHONE" type="xsd:string"/><element name="DOM_ADM_COUNTRY_CODE" type="xsd:string"/><element name="DOM_ADM_AREA_CODE" type="xsd:string"/><element name="DOM_ADM_FAX" type="xsd:string"/><element name="DOM_ADM_MOBILE" type="xsd:string"/><element name="DOM_BILL_FIRST_NAME" type="xsd:string"/><element name="DOM_BILL_LAST_NAME" type="xsd:string"/><element name="DOM_BILL_EMAIL" type="xsd:string"/><element name="DOM_BILL_ADDRESS" type="xsd:string"/><element name="DOM_BILL_CITY" type="xsd:string"/><element name="DOM_BILL_COUNTRY" type="xsd:string"/><element name="DOM_BILL_STATE" type="xsd:string"/><element name="DOM_BILL_ZIP" type="xsd:string"/><element name="DOM_BILL_PHONE" type="xsd:string"/><element name="DOM_BILL_COUNTRY_CODE" type="xsd:string"/><element name="DOM_BILL_AREA_CODE" type="xsd:string"/><element name="DOM_BILL_FAX" type="xsd:string"/><element name="DOM_BILL_MOBILE" type="xsd:string"/><element name="DOM_TECH_FIRST_NAME" type="xsd:string"/><element name="DOM_TECH_LAST_NAME" type="xsd:string"/><element name="DOM_TECH_EMAIL" type="xsd:string"/><element name="DOM_TECH_ADDRESS" type="xsd:string"/><element name="DOM_TECH_CITY" type="xsd:string"/><element name="DOM_TECH_COUNTRY" type="xsd:string"/><element name="DOM_TECH_STATE" type="xsd:string"/><element name="DOM_TECH_ZIP" type="xsd:string"/><element name="DOM_TECH_PHONE" type="xsd:string"/><element name="DOM_TECH_COUNTRY_CODE" type="xsd:string"/><element name="DOM_TECH_AREA_CODE" type="xsd:string"/><element name="DOM_TECH_FAX" type="xsd:string"/><element name="DOM_TECH_MOBILE" type="xsd:string"/><element name="DURATION" type="xsd:int"/></sequence></complexType></element><element name="registerDomainResponse"><complexType><sequence><element name="registerDomainReturn" type="xsd:int"/></sequence></complexType></element></schema></wsdl:types> <wsdl:message name="registerDomainResponse"> <wsdl:part element="impl:registerDomainResponse" name="parameters"/> </wsdl:message> <wsdl:message name="registerDomainRequest"> <wsdl:part element="impl:registerDomain" name="parameters"/> </wsdl:message> <wsdl:portType name="WsEpp"> <wsdl:operation name="registerDomain"> <wsdl:input message="impl:registerDomainRequest" name="registerDomainRequest"/> <wsdl:output message="impl:registerDomainResponse" name="registerDomainResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="WsEppSoapBinding" type="impl:WsEpp"> <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="registerDomain"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="registerDomainRequest"> <wsdlsoap:body use="literal"/> </wsdl:input> <wsdl:output name="registerDomainResponse"> <wsdlsoap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="WsEppService"> <wsdl:port binding="impl:WsEppSoapBinding" name="WsEpp"> <wsdlsoap:address location="http://localhost:8080/WebServiceProject/services/WsEpp"/> </wsdl:port> </wsdl:service> </wsdl:definitions> And when I am sending the request the response comes like below- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <soapenv:Body> - <soapenv:Fault> <faultcode>soapenv:Server.userException</faultcode> <faultstring>java.lang.reflect.InvocationTargetException</faultstring> - <detail> <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">net-df0ab1ca865</ns1:hostname> </detail> </soapenv:Fault> </soapenv:Body> </soapenv:Envelope>The faultcode and faultstring is the field which I am not getting.And the most funny thing is that,when I make a simple Test.java file which uses the object of PrintLib,then its running perfectally without web service,on the other hand in webservice The object of PrintLib is not instantiated.Means on the console the message printed "CONSTRUCTER 1" which I have used in PrintLib.Kindally provide me help,Thanks in advance

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...