3 Replies Latest reply on Feb 23, 2010 3:30 AM by ropalka

    Initialize WS in deployment descriptor?

    gmn314

      Hi,

      When creating JBoss Webservices, you package a java class as though it were a Servlet. In the web.xml, you specify element in web.xml with <servlet-name>, <servlet-class>, <load-on-startup> etc. You also create a <servlet-mapping> element. However, the Java class invoked is not actually a Servlet!

      My question is, is there any way that I can initialize my Java Webservice in the web.xml? I can't specify init parameters, as I would a servlet, because the class is not a servlet. Is the only way to use a regular properties file, and read the file from you Java class that implements your webservice?

      Thanks

        • 1. Re: Initialize WS in deployment descriptor?
          thomas.diesler

          Have a look at ServiceLifecycle

          • 2. Re: Initialize WS in deployment descriptor?
            grexe

            This is still an issue for me, we are (still) using 4.2.3.GA + JBossWS-CXF.

            The workaround you described seems to work only with JBossWS-Native, or did you mean the standard JEE ServiceLifeCycle interface?

             

            The actual problem we face is that the web service stack is only started upon first WebService-call, which takes so long that we get a timeout on the first call, but no problems afterwards.

            Isn't there a more elegant way to ensure the web service stack starts up when JBoss is started?

            • 3. Re: Initialize WS in deployment descriptor?
              ropalka

              Though the bean specified in servlet-class is not servlet,

              users can specify load on startup for such beans.

              During the deployment process the webservice bean

              is translated to servlet that will handle the requests.

               

              Thus setting load-on-startup is the solution you're looking for.