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

    java.lang.UnsupportedOperationException when connecting to a

    sklerche

      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!


        • 1. Re: java.lang.UnsupportedOperationException when connecting
          tobinibot

          Hi sklerche. I am having the same problem. Were you able to find a solution?

          Tobin

          • 2. Re: java.lang.UnsupportedOperationException when connecting
            sklerche

            Hi tobinibot

            No, I'm sorry I haven't found a solution yet.
            I still hope someone else has got an idea how to fix that.

            Best wishes.
            Stephan

            • 3. Re: java.lang.UnsupportedOperationException when connecting
              stevenh

              Hi sklerche,
              Not sure exactly whats going on but are you able to try it with jdk 1.5?

              Steve

              • 4. Re: java.lang.UnsupportedOperationException when connecting
                tobinibot

                Steven, I don't know about sklerche, but I am using 1.5.

                • 5. Re: java.lang.UnsupportedOperationException when connecting
                  tobinibot

                  Couple more details. I'm working with 2 other guys on a project. I wrote a basic web service and deploying on my machine. All 3 of us can successfully hit my web service.

                  I then checked the web service into source control, and had the other 2 guys check it out. On one of these guy's computer, it works just fine. All 3 of us can hit his web service.

                  When the 3rd guy deploys it, it deploys fine, but none of us can hit his web service (the aforementioned exception is thrown). We used 2 different clients to call the web service (XFire and soapUI) to make sure there wasn't a client generation problem, so it seems like it's something on the server side. I installed his JBoss instance for him, and it's just the same as mine. We can't figure out what's going on.

                  Tobin

                  • 6. Re: java.lang.UnsupportedOperationException when connecting
                    sklerche

                    Hi Steve,

                    no I didn't try it with jdk 1.5, but if that fixes the problem I'll do it.

                    As I got the same exception on both jboss versions, I just assumed there is a problem with my implementation of the bean itself.

                    Stephan

                    • 7. Re: java.lang.UnsupportedOperationException when connecting
                      sklerche

                      Hi Steve

                      I've just started Jboss with jdk 5.0, recompiled my bean accordingly and guess what, everything worked fine!

                      I thought jboss should work with all jdk's >= 5.0.

                      Anyhow thanks a million!
                      Stephan

                      • 8. Re: java.lang.UnsupportedOperationException when connecting
                        stevenh

                         

                        "tobinibot" wrote:
                        Couple more details. I'm working with 2 other guys on a project. I wrote a basic web service and deploying on my machine. All 3 of us can successfully hit my web service.

                        I then checked the web service into source control, and had the other 2 guys check it out. On one of these guy's computer, it works just fine. All 3 of us can hit his web service.

                        When the 3rd guy deploys it, it deploys fine, but none of us can hit his web service (the aforementioned exception is thrown). We used 2 different clients to call the web service (XFire and soapUI) to make sure there wasn't a client generation problem, so it seems like it's something on the server side. I installed his JBoss instance for him, and it's just the same as mine. We can't figure out what's going on.

                        Tobin


                        There has to be something different there somewhere. are you sure the 3rd machine isnt running 1.6? if it isnt it might be worth doing a diff between the two servers.

                        Steve.

                        • 9. Re: java.lang.UnsupportedOperationException when connecting
                          stevenh

                           

                          "sklerche" wrote:
                          Hi Steve

                          I've just started Jboss with jdk 5.0, recompiled my bean accordingly and guess what, everything worked fine!

                          I thought jboss should work with all jdk's >= 5.0.

                          Anyhow thanks a million!
                          Stephan


                          It probably should work on 1.6, but then again i would actually consider this a problem with the jdk rather than jboss given it does compile and run on 1.5.

                          Steve.

                          • 10. Re: java.lang.UnsupportedOperationException when connecting
                            thomas.diesler

                            This is probabably a classpath issue. Make sure your SAAJ implementation comes from jboss-saaj.jar

                            • 11. Re: java.lang.UnsupportedOperationException when connecting
                              rayymlai

                              this seems to be a compatibility issue of JBossWS 1.0.x with Java SE 6.0's JAX-WS 2.0. I've siimlar problem.

                              I had the JSR181EJB3 example from JBossWS 1.0.3/1.0.4 running well on JBoss AS 4.0.4/4.0.5 (after some painful patches). After I upgrade my JDK to 6.0, the same example generates the exception UnsupportedOperationException.

                              I try to remove the javax.xml.SOAPMessage*.class from the jbossws-client.jar and let the example uses Java SE 6.0's JAX-WS API. but it seems that there are more APIs impacted.

                              Previous email threads mention JDK 6.0 beta. But the same exception occurs for the GA version of 6.0 as well.

                              Java SE 6.0 provides amazing JAXWS 2.0 support. You can use its embedded HTTP web server to publish web services. New JAXWS 2.0 APIs are provided. I'd assume the current JBossWS 1.0.4's JAXWS API is not sync up with the latest JAXWS 2.0 yet.

                              Perhaps JBossWS team can advise the compatibility issue. Thanks.

                              • 12. Re: java.lang.UnsupportedOperationException when connecting
                                kimbaltrue

                                The JSE 6 Annotations use the XmlAccessType Enumeration as a property in the XmlAccessorType annotation, but the JWSDP 2 uses AccessType instead. Somebody did a rename of the class in the JSE 6 release so I'm not surprised if it fails.