4 Replies Latest reply on Jan 19, 2009 1:02 AM by Nandaja Ananthanarayanan

    @WebServiceRef fails in JBossWS metro webservice

    Nandaja Ananthanarayanan Newbie

      With JBossWS Metro 3.0.4-GA, integrated to JBoss4.2.3GA version, @WebServiceRef injection does not seem to work. In fact @ Resource , @Depends etc also don't seem to work.
      On the other hand, if a service object is created using new, it seems to solve the issue.

      The injection is being done in a stateless EJB3 session bean, which acts as a webservice and also is a client to couple of other web services. Service creation for accessing the web service is attempted with @WebServiceRef.

      This was working perfectly with JbossWS native that comes with Jboss4.3.2-GA release.

      Please advise, as to whether this is a known issue or if there is anything that I am missing to get this working.

        • 1. Re: @WebServiceRef fails in JBossWS metro webservice
          Richard Opalka Master

          Upgrade to JBossWS 3.0.5. Some WebServiceRef related issues have been fixed there.

          • 2. Re: @WebServiceRef fails in JBossWS metro webservice
            Nandaja Ananthanarayanan Newbie

            Hi,

            Sorry for the typo .. I am already using JbossWS Metro..
            Detailing the scenario a little further, I have a webservice Echo deployed on JBossWS Metro -3.0.5 on Jboss4.2.3-GA. I have another stateless session bean ( EJB3.0 ) annotated as a WebService. Also it acts a client to Echo Webservice, for which I have a WebServiceRef injection @WebServiceRef
            private Echo echoClient;
            in the bean.

            I have defined a PostConstruct for this stateless session bean where I
            might bind this reference to an Endpoint Address using BINDING_PROVIDER. However, in the post construct if I try to obtain a port on the injected reference, there is a Null pointer exception, which means that the injection did not happen. As far as a PostConstruct method is concerned, all injections have to be available therein. If I do not annotate the bean as a WebService, everything works fine.
            Does the Metro deployer construct a bean instance on deployment ? I think it does, becuase I can see the logs hitting the post construct. If so , is there a race condition here, because the postconstruct is hit before the WebserviceRef injection is done by the ServiceObjectFactory of Jboss WS metro.
            If I use a constructor to instantiate the service class instead of WebserviceRef, things work fine, and I can see the logs showing that the ServiceObjectFactory is used to do a getObjectInstance().This is missing in the bean instance creation done during deployment.

            Also , if I look up the bean, webserviceref injection takes place fine.

            Is this something that has not been tackled in JBossWs Metro webservice deployment ? This was working fine with JBossWS Native. We needed to switch to Jbossws metro to send some custom HTTP headers with the web service request.

            Please advise as to whether this is a bug, or something that I am missing to take care during my deployment.

            Thanks.

            • 3. Re: @WebServiceRef fails in JBossWS metro webservice
              Richard Opalka Master

               

              "nandaja" wrote:
              Is this something that has not been tackled in JBossWs Metro webservice deployment ? This was working fine with JBossWS Native. We needed to switch to Jbossws metro to send some custom HTTP headers with the web service request.

              Please advise as to whether this is a bug, or something that I am missing to take care during my deployment.

              Hi,

              please create an JIRA issue and provide the simple test case that works on Native and doesn't on Metro integration. Then you can be sure it will be fixed. We consider it bug.