java.lang.UnsupportedOperationException: setProperty must be
usul Jun 3, 2008 2:29 PMHi,
Im trying to develop a simple webservice with "EJB 3.0" and a simple client.
I use:
- jboss-4.2.2.GA
- Eclipse
My two Server classes:
package myserv;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.jws.WebService;
@Stateless
@WebService(endpointInterface = "myserv.ICalculatorBean")
@Remote(ICalculatorBean.class)
public class CalculatorBean
{
public int add(int a, int b)
{
return a+b;
}
public int subtract(int a, int b)
{
return a - b;
}
}package myserv;
import java.rmi.Remote;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
@WebService
@SOAPBinding(style = Style.RPC)
public interface ICalculatorBean extends java.rmi.Remote
{
public int add(int a, int b);
public int subtract(int a, int b);
}My Client class:
package myclient;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.rpc.Service;
import javax.xml.rpc.ServiceFactory;
import myserv.*;
public class Client {
public static void main(String[] args) throws Exception
{
System.out.println("Starting Test Client");
URL url = new URL("http://127.0.0.1:8080/steffenwstest/CalculatorBean?wsdl");
QName qname = new QName(
"http://myserv/",
"CalculatorBeanService");
System.out.println("Creating a service Using: \n\t"
+ url + " \n\tand " + qname);
ServiceFactory factory = ServiceFactory.newInstance();
Service remote = factory.createService(url, qname);
System.out.println("Obtaining reference to a proxy object");
ICalculatorBean proxy = (ICalculatorBean) remote.getPort(ICalculatorBean.class);
System.out.println("Accessed local proxy: " + proxy);
System.out.println("9+8= " + proxy.add(9, 8));
}
}I get this Error:
Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
at $Proxy0.add(Unknown Source)
at myclient.Client.main(Client.java:30)
Caused by: java.rmi.RemoteException: Call invocation failed; nested exception is:
java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage
at org.jboss.ws.core.jaxrpc.client.CallImpl.invokeInternal(CallImpl.java:536)
at org.jboss.ws.core.jaxrpc.client.CallImpl.invoke(CallImpl.java:277)
at org.jboss.ws.core.jaxrpc.client.PortProxy.invoke(PortProxy.java:151)
... 2 more
Caused by: java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage
at javax.xml.soap.SOAPMessage.setProperty(Unknown Source)
at org.jboss.ws.core.soap.SOAPMessageImpl.<init>(SOAPMessageImpl.java:67)
at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:161)
at org.jboss.ws.core.CommonSOAP11Binding.createMessage(CommonSOAP11Binding.java:59)
at org.jboss.ws.core.CommonSOAPBinding.bindRequestMessage(CommonSOAPBinding.java:156)
at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:289)
at org.jboss.ws.core.jaxrpc.client.CallImpl.invokeInternal(CallImpl.java:517)
... 4 more
The error is thrown in this line:
System.out.println("9+8= " + proxy.add(9, 8));Note:
- I compiled both server and client with Java 5.0
- I did copy the following files into /lib/endorsed:
- jboss-saaj.jar
- jboss-jaxws.jar
- jboss-jaxrpc.jar
- jaxb-api.jar
- jaxb-impl.jar
My server uses everything from \server\all\lib.
My client uses everything from \client and \lib\endorsed.
What more can I do?