java.lang.NoSuchMethodError: java.util.Locale: method <init>(Ljava/lang/Str
843833Dec 23 2004 — edited Feb 9 2005Dear Friends,
pls chech below code and tell me what is wrong in my code
import javax.xml.namespace.QName;
import javax.xml.rpc.Call;
import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.Service;
import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.encoding.XMLType;
import com.sun.xml.rpc.client.ServiceFactoryImpl;
public class TestCustomer1 {
public static void main(String args[]) {
int errorline=1;
try {
// Create a service class with no WSDL information. You
// still must know something about the WSDL, however: the
// service's name.
System.out.println("111111111111");
QName serviceName = new QName("http://9.182.227.83:9080/wsdl/ISecurityMgr.wsdl","ISecurityMgr");
errorline=2;
ServiceFactory factory = ServiceFactory.newInstance();
//ServiceFactory factory = new ServiceFactoryImpl();
System.out.println("22222222");
Service service = factory.createService(serviceName); System.out.println("33333");
errorline=3;
// Now create a dynamic Call object from this service.
// This call object is not yet associated with any
// operation. We'll do that below.
Call call = service.createCall();
errorline=4;
// Next, build up the information about the operation...
// The operation name
QName operationName = new QName(
"literal",
"login");
errorline=5;
call.setOperationName(operationName);
// The input parameter
call.addParameter(
"userID", // parameter name
XMLType.XSD_STRING, // parameter XML type QName
String.class, // parameter Java type class
ParameterMode.IN); // parameter mode
errorline=6;
call.addParameter(
"password", // parameter name
XMLType.XSD_STRING, // parameter XML type QName
String.class, // parameter Java type class
ParameterMode.IN); // parameter mode
errorline=7;
// The return
call.setReturnType(XMLType.XSD_STRING);
errorline=8;
// The operation is an RPC-style operation.
call.setProperty(
Call.OPERATION_STYLE_PROPERTY,
"rpc");
errorline=9;
// The encoding style property value comes from the
// binding's operation's input clauses encodingStyle
// attribute. Note that, in this case, this call is not
// really necessary - the value we're setting this
// property to is the default.
call.setProperty(
Call.ENCODINGSTYLE_URI_PROPERTY,
"http://schemas.xmlsoap.org/soap/encoding/");
errorline=10;
// The target endpoint ie..........sop address by siddh
call.setTargetEndpointAddress(
"http://9.182.227.83:9080/ICMSAPIDEV/services/usermgmt");
errorline=11;
// Invoke the operation
// userId = "ICMSWEB" ;//args[0];
// password = "ICMS4WEB";//args[1];
Object[] actualArgs = {"ICMSWEB","ICMS4WEB"};
errorline=12;
// Float price = (Float) call.invoke(actualArgs);
Object sai = call.invoke(actualArgs);
errorline=13;
System.out.println("object is.... " + sai.toString());
}
catch (Throwable t) {
System.out.println("error .."+errorline);
t.printStackTrace();
}
}
}
After running this class flowing error is coming
111111111111
22222222
java.lang.NoSuchMethodError: java.util.Locale: method <init>(Ljava/lang/String;)V not found
at com.sun.xml.rpc.encoding.simpletype.XSDDateTimeDateEncoder.<clinit>(XSDDateTimeDateEncoder.java:195)
at com.sun.xml.rpc.encoding.soap.StandardSOAPTypeMappings.<init>(StandardSOAPTypeMappings.java:563)
at com.sun.xml.rpc.encoding.StandardTypeMappings.getSoap(StandardTypeMappings.java:32)
at com.sun.xml.rpc.client.BasicService.createSoapMappings(BasicService.java:230)
at com.sun.xml.rpc.client.BasicService.createStandardTypeMappingRegistry(BasicService.java:202)
at com.sun.xml.rpc.client.BasicService.<init>(BasicService.java:79)
at com.sun.xml.rpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:53)
at pkj1.pkj2.TestCustomer1.main(TestCustomer1.java:45)error ..2
pls help me