Exception in thread "main" javax.xml.ws.WebServiceException: java.lang.UnsupportedOperationException

1 resposta
Paulo_Alves

Boas

Tenho um problema com WebServers. Ou seja tenho um endereço com a wsdl, gerei as classes java com o wsconsume do JBoss 4.2.1.GA, e criei um main de teste:
...
public static void main(String[] args) throws Exception {

EchoImplService service = new EchoImplService (); // Classe que extende de Service...
EchoService echoService = service.getEchoServicePort(); // Classe de interface do WS...
System.out.println(echoService.getGreet());

}
...
O problema é que isto lança me uma Excepção muito esquesita:
Exception in thread "main" javax.xml.ws.WebServiceException: java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage
	at org.jboss.ws.core.jaxws.client.ClientImpl.handleRemoteException(ClientImpl.java:304)
	at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:242)
	at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:164)
	at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)
	at $Proxy16.get(Unknown Source)
	at test.ClientTest.main(ClientTest.java:25)
Caused by: java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage
	at javax.xml.soap.SOAPMessage.setProperty(SOAPMessage.java:424)
	at org.jboss.ws.core.soap.SOAPMessageImpl.<init>(SOAPMessageImpl.java:67)
	at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:155)
	at org.jboss.ws.core.CommonSOAP11Binding.createMessage(CommonSOAP11Binding.java:58)
	at org.jboss.ws.core.CommonSOAPBinding.bindRequestMessage(CommonSOAPBinding.java:153)
	at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:274)
	at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:230)
	... 5 more

Ja vi no Google e o que aparece não funciona no meu caso porque nao tenho acesso ao Servidor JBOSS... [url]http://thesmallpotato.blogspot.com/2007/06/jdk-16-jboss-420-ejb3-web-service-axis2.html[/url]

Alguma ideia de como resolver isto?

Obrigado

1 Resposta

Paulo_Alves

Opa!
Isto resolve parte do Erro: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=99036

Contudo agora dá um NullPointerException aqui:

... System.out.println(echoService.getGreet()); ...

Ou seja, por alguma razão não esta a instanciar o WS.
Se alguem me puder ajudar, agradecia.

Obrigado

Criado 30 de novembro de 2007
Ultima resposta 30 de nov. de 2007
Respostas 1
Participantes 1