Skip to main content

Client NoSuchMethodError Exception

1 reply [Last post]
fospitia
Offline
Joined: 2004-10-20
Points: 0

Hi

I have a one way WebService from this wsdl:

<?xml version="1.0" encoding="UTF-8"?>

the sun-jaxws.xml file:

<?xml version="1.0" encoding="UTF-8"?>

the custom-server.xml file is:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

and my PersonPortTypeImpl class is:

/**
*
*/
package org.example.person.server;

@javax.jws.WebService (endpointInterface="org.example.person.server.PersonPortType")
public class PersonPortTypeImpl {

public void newPerson(Person person) {
System.out.println("Person:" + person);
}
}

I deployed in a JBoss AS 4.0.3 without any problem.

But the client give me the next exception, and i don't know why:

Exception in thread "main" javax.xml.ws.WebServiceException: java.lang.NoSuchMethodError: javax.xml.soap.MessageFactory.newInstance(Ljava/lang/String;)Ljavax/xml/soap/MessageFactory;
at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.doSend(SOAPMessageDispatcher.java:296)
at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.send(SOAPMessageDispatcher.java:153)
at com.sun.xml.ws.encoding.soap.internal.DelegateBase.send(DelegateBase.java:85)
at com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSEIMethod(EndpointIFInvocationHandler.java:176)
at com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(EndpointIFInvocationHandler.java:105)
at $Proxy17.newPerson(Unknown Source)
at org.example.person.client.PersonClientTest.run(PersonClientTest.java:25)
at org.example.person.client.PersonClientTest.main(PersonClientTest.java:17)
Caused by: java.lang.NoSuchMethodError: javax.xml.soap.MessageFactory.newInstance(Ljava/lang/String;)Ljavax/xml/soap/MessageFactory;
at com.sun.xml.ws.util.SOAPUtil.createMessageFactory(SOAPUtil.java:174)
at com.sun.xml.ws.util.SOAPUtil.(SOAPUtil.java:43)
at com.sun.xml.ws.encoding.soap.client.SOAPXMLEncoder.toSOAPMessage(SOAPXMLEncoder.java:180)
at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.doSend(SOAPMessageDispatcher.java:261)
... 7 more

the client code is:

/**
*
*/
package org.example.person.client;

/**
*
*
*/
public class PersonClientTest {

/**
* @param args
*/
public static void main(String[] args) {
PersonClientTest client = new PersonClientTest();
client.run();
}

private void run() {
Person person = new Person();

PersonPortType port = new PersonService().getPersonPort();
System.out.println("NEW PERSON");
port.newPerson(person);
System.out.println("NEW PERSON");
}
}

Anybody can help me?

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vivekp
Offline
Joined: 2003-06-10
Points: 0

Looks like javax.xml.soap.MessageFactory.newInstance(Ljava/lang/String) method is not found by jaxws. This method was added since SAAJ 1.3. Check your classpath to see if you have saaj-impl.jar and saaj-api.jar distributed with jaxws.

Probably saaj 1.2 api jar is found which doesnt have this method.

-vivek.