12 Replies Latest reply on Jun 7, 2007 5:47 PM by kimbaltrue

    java.lang.UnsupportedOperationException when connecting to a

    Stephan Kenji Lerche Newbie

      Hi,

      I'm relatively new to web services so that may be the main problem.
      Anyway, I've created an EJB which I want to expose as both a stateless session bean and a webservice. The deployment itself works fine and connecting to the session bean works, too. But when I want to connect to the Bean as a web service I get this exception on the JBoss server.

      [org.jboss.ws.jaxrpc.SOAPFaultExceptionHelper] SOAP request exception
      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.soap.SOAPMessageImpl.(SOAPMessageImpl.java:77)
      at org.jboss.ws.soap.MessageFactoryImpl.createMessageInternal(MessageFactoryImpl.java:208)
      at org.jboss.ws.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:145)
      at org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:176)
      at org.jboss.ws.server.ServiceEndpointManager.processSOAPRequest(ServiceEndpointManager.java:373)
      at org.jboss.ws.server.StandardEndpointServlet.doPost(StandardEndpointServlet.java:116)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.jboss.ws.server.StandardEndpointServlet.service(StandardEndpointServlet.java:77)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      at java.lang.Thread.run(Thread.java:619)

      My setup:
      I'm using a JDK 1.6-beta, jboss-4.0.5.GA and jbossws-1.0.4.GA.

      The session bean/ web service looks like this:

      @Stateless
      @RemoteBinding(jndiBinding = "MyTestBean")
      @WebService
      @SOAPBinding(style = SOAPBinding.Style.RPC, use=SOAPBinding.Use.LITERAL)
      public class BusinessTestBean implements IBusinessTestRemote {
      
       private static final String answer = ">>>>>>>> Jboss printed: ";
      
       /*
       * (non-Javadoc)
       *
       * @see com.lowteq.ejb.IBusinessTest#roundTrip(java.lang.String)
       */
       @WebMethod()
       @WebResult(name = "TestDataContainer")
       public TestDataContainer roundTrip(
       @WebParam String input,
       @WebParam Long longValue) throws RemoteException {
       TestDataContainer container = new TestDataContainer();
       container.setLongValue(++longValue);
       container.setStringValue("Jboss answers: " + input);
       return container;
       }
      
       /*
       * (non-Javadoc)
       *
       * @see com.lowteq.ejb.IBusinessTest#toConsole(java.lang.String)
       */
       @WebMethod()
       @WebResult(name="Print")
       public String toConsole(@WebParam
       String input) throws RemoteException {
       System.out.println(answer+ input);
       return answer + input;
       }
      }


      As you can see the bean is EJB 3.0 and JSR-181 compliant.
      The client artifacts are created by the JDK's wsimport tool.
      That's the web service client:

      public class WebClient {
      
       static BusinessTestBeanService service = new BusinessTestBeanService ();
      
       public static void main(String[] args) throws Exception {
       BusinessTestBean port = service.getBusinessTestBeanPort();
       System.out.println(port.toConsole("test"));
       }
      
      }


      As I got the same exception on a jboss-4.0.4.GA I presume there is something wrong in the implementation but I couldn't figure out what the problem is.
      Any help would be great!