1 2 Previous Next 25 Replies Latest reply on Mar 6, 2006 1:08 AM by jason.greene Go to original post
      • 15. Re: jbossws packaging/deployment
        jason.greene

         

        "dimitris@jboss.org" wrote:
        We do intercept the call to start(DeploymentInfo).

        If the WebServiceDeployerJSE *stuff* can be safely moved from the

        protected Object create(Invocation invocation, DeploymentInfo di) throws Throwable

        to the

        protected Object start(Invocation invocation, DeploymentInfo di) throws Throwable

        phase, I guess this would solve the problem.


        Sorry, this question was directed at the rest of WS team. I can't see a reason why we are using create instead of start(), because from what I can tell the web.xml file is parsed in startService().

        -Jason

        • 16. Re: jbossws packaging/deployment
          thomas.diesler

          With the current architecture this cannot be fixed.
          The WebServiceDeployer interceptor must be attached before the Tomcat5 deployer enters the create state for a *.war deployment, because it must modify the *.war deployment before it is created.

          If the *.war deployment has a dependency on WebServiceDeployerJSE and the interceptor has not been attached already it is too late to attach the interceptor to the Tomcat5 deployer when the *.war service is created/started.

          I fix this issue by inventing a new *.jse deployment with an associated deployer that simply copies the *.jse to a *.war and deploys it throuh the MainDeployer. WebServiceDeployerNestedJSE has a dependency on WebServiceDeployerJSE. Therefore it is guarantied that the interceptor is installed.

          • 17. Re: jbossws packaging/deployment
            jason.greene

            The web.xml file is parsed during start() not create(), so this does work provided that the sequence of events is modified such that all activity in create is moved to start, and that happens before the invokeNext() is called in start(). I prototyped this and it is working although I have other changes in my tree that I need to sort out. I will try and get this done tonight.

            -Jason

            • 18. Re: jbossws packaging/deployment
              jason.greene

              Actually I ran into problems with this approach after all. I need to investsigate this further.

              -Jason

              • 19. Re: jbossws packaging/deployment
                jason.greene

                One of the problems is that when dependencies are involved WebServiceDeployer.start() is invoked multiple times. We need to check with ServiceController to verify that the web deployment was actually started.

                This problem affects the current create() approach as well.

                -Jason

                • 20. Re: jbossws packaging/deployment
                  jason.greene

                  I have refactored WebServiceDeployer and WebServiceDeployerJSE to handle nested deployments.

                  The sequence of events that normally occurs when dependencies are in effect follows:


                  1. create() is ran adding interceptors
                  2. start() is called on WebServiceDeployerJSE
                  3. start() is called on AbstractWebContainer
                  4. ServiceController.start() is called on WebModule, but WebModule is not started because dependencies are not yet satisfied.
                  5. start() is completed in WebServiceDeployerJSE
                  6. Some time later, after dependencies are resolved, start() is called on WebModule.

                    So the issue is that we can not start the service endpoint until step 6 happens, and that is outside of the start() invocation.

                    The solution I chose was to dynamically add a temporary notication handler on ServiceController that starts the service endpoint whenever the WebModule does not start in step 4.

                    There is still one last problem to resolve that only affects JSR-181 endpoints. AbstractWebContainer.init() needs to unpack a war if it is a web service. It can use webservices.xml if it is a j2ee 1.4 web service, however, if it is a jsr-181 deployment, webservices.xml is optional.

                    There is a hack that depends on jbossws.sar being around before the deployment can ever succeed:

                    unpackWebservice |= server.isRegistered(ObjectNameFactory.create("jboss.ws:service=ServiceEndpointManager"));
                    

                    I see two possible solutions to this problem:

                    1. Always unpack all wars. Is this really that much of a cost that we don't want this step?
                    2. Scan the web.xml for servlets that do not implement javax.servlet.Servlet, and if found unpack the war.

                      Thoughts anyone?

                      -Jason


                  • 21. Re: jbossws packaging/deployment
                    thomas.diesler

                    To me the issue is trivial:

                    Any service endpoint deployment should only happen after the WS deployment interceptors are installed. Therefore we must somehow postpone endpoint deployement until the interceptors attach themselves.

                    Why is the *.jse approach not working for you? See how ws-eventing starts up when nested inside jbossws.sar even in jboss-4.0.x

                    • 22. Re: jbossws packaging/deployment
                      thomas.diesler

                      More generally, we need an approach like this

                      #1 all interceptors attach to their respective deployers

                      #2 the deployers start picking up their respective deployments

                      This should be discussed with Dimitis and Scott.

                      • 23. Re: jbossws packaging/deployment
                        jason.greene

                         

                        "thomas.diesler@jboss.com" wrote:
                        To me the issue is trivial:

                        Any service endpoint deployment should only happen after the WS deployment interceptors are installed. Therefore we must somehow postpone endpoint deployement until the interceptors attach themselves.

                        Why is the *.jse approach not working for you? See how ws-eventing starts up when nested inside jbossws.sar even in jboss-4.0.x


                        The jse approach does work, but do we want another deployment type just to support nesting?

                        I assumed that we all prefered to support war files with the standard jboss dependency subsystem, which is what I implemented. So I pulled out the nested deployer, and now jbossws-eventing is using a nested war file with a dependency on WebServiceDeployerJSE.

                        The only thing thats not working atm is nested jsr181 deployments that don't have a webservices.xml. Although we don't have anything that uses that yet. As soon as we fix the init() phase of AbstractWebContainer, this problem goes away.

                        -Jason

                        • 24. Re: jbossws packaging/deployment
                          jason.greene

                           

                          "jason.greene@jboss.com" wrote:
                          "thomas.diesler@jboss.com" wrote:
                          To me the issue is trivial:

                          Any service endpoint deployment should only happen after the WS deployment interceptors are installed. Therefore we must somehow postpone endpoint deployement until the interceptors attach themselves.

                          Why is the *.jse approach not working for you? See how ws-eventing starts up when nested inside jbossws.sar even in jboss-4.0.x


                          The jse approach does work, but do we want another deployment type just to support nesting?

                          I assumed that we all prefered to support war files with the standard jboss dependency subsystem, which is what I implemented. So I pulled out the nested deployer, and now jbossws-eventing is using a nested war file with a dependency on WebServiceDeployerJSE.

                          The only thing thats not working atm is nested jsr181 deployments that don't have a webservices.xml. Although we don't have anything that uses that yet. As soon as we fix the init() phase of AbstractWebContainer, this problem goes away.

                          -Jason



                          Also, before the changes I made, any war file that had a dependency on any component not yet available would cause any web service deployment to fail.

                          This is ultimately because we need the tomcat classloader, which isn't active until all dependencies are resolved.

                          -Jason

                          • 25. Re: jbossws packaging/deployment
                            jason.greene

                             

                            "thomas.diesler@jboss.com" wrote:
                            More generally, we need an approach like this

                            #1 all interceptors attach to their respective deployers

                            #2 the deployers start picking up their respective deployments

                            This should be discussed with Dimitis and Scott.


                            I definately agree with this. The current web deployment architecture is spread out across multiple lifecycle phases, accross multiple mbeans. All of which we want to alter behavior:

                            AbstractWebContainer.init()
                            AbstractWebContainer.start()
                            WebModule.start()

                            WebServiceDeployerJSE only intercepts AbstractWebContainer. Currently WebModule can't be intercepted because it is generated by AbstractWebContainer, and it's not an XMBean.

                            Generally we need a before and after start phase. The before start needs to be able modify the web.xml, and the after start needs to happen after WebModule.start() is called, which is after all dependencies have been satisfied.

                            -Jason

                            1 2 Previous Next