5 Replies Latest reply on Aug 29, 2008 3:26 PM by Hung Truong

    boot strapping spring inside Jboss

    Hung Truong Newbie

      Hi there,
      I'm trying to bootstrap Spring and a bunch of spring related beans inside Jboss without using the .spring deployer, because I need to be able to deploy this inside WAS too.

      My web.xml and spring libraries work inside WAS, but when i put it over onto JBoss, JBoss reads the web.xml and everything appears to be okay, but it never triggers any of the Listeners, even to create them.

      Am i missing something? I've followed the following: http://www.codechimp.net/?p=22


      Any help would be greatly appreciated.

        • 1. Re: boot strapping spring inside Jboss
          Ragav Gomatam Novice

          Explain what you are trying to do ? Use Spring within a simple Web App Or Use Spring-Deployer ? They are entirely different things

          • 2. Re: boot strapping spring inside Jboss
            Hung Truong Newbie

            Hi there.
            Yeah, I'm trying to use spring with a web app.
            I have a collection of enties extending from AbstractMarshallingPayloadEndpoint and one particular from a ServletContextListener (which i am using to start up a bunch of stuff).

            So, my web.xml contains:

            <web-app
            version="2.4"
            id="WebApp_ID">

            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
            </listener-class>



            <display-name>MyServerListener</display-name>
            <listener-class>com.my.MyServletContextListener</listener-class>



            <!-- take especial notice of the name of this servlet -->

            <servlet-name>spring-ws</servlet-name>
            <servlet-class>
            org.springframework.ws.transport.http.MessageDispatcherServlet
            </servlet-class>
            <load-on-startup>1</load-on-startup>


            <servlet-mapping>
            <servlet-name>spring-ws</servlet-name>
            <url-pattern>/*</url-pattern>
            </servlet-mapping>


            </web-app>


            I put a break point inside the class, but it never gets created.
            All this is wrapped inside a war and deployed inside JBoss. The same war deployed inside WAS starts up properly.

            Am I missing some configuration inside JBoss to start up spring? When i remove the Spring libraries, i do get errors from JBoss saying that it can't find the spring libraries.

            Any ideas?

            • 3. Re: boot strapping spring inside Jboss
              Hung Truong Newbie

              yes, there are ... surrounding the listener-class, i just missed it on the cut and paste.

              • 4. Re: boot strapping spring inside Jboss
                Hung Truong Newbie

                <?xml version="1.0" encoding="UTF-8"?>
                <web-app
                id="WebApp_ID"
                xmlns="http://java.sun.com/xml/ns/j2ee"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
                version="2.4">

                <context-param>
                <param-name>contextConfigLocation</param-name>
                <param-value>
                /WEB-INF/acegi-config.xml
                </param-value>
                </context-param>


                <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>




                <display-name>MyServerListener</display-name>
                <listener-class>my.MyServletContextListener</listener-class>



                <!-- take especial notice of the name of this servlet -->

                <servlet-name>spring-ws</servlet-name>
                <servlet-class>
                org.springframework.ws.transport.http.MessageDispatcherServlet
                </servlet-class>
                <load-on-startup>1</load-on-startup>


                <servlet-mapping>
                <servlet-name>spring-ws</servlet-name>
                <url-pattern>/*</url-pattern>
                </servlet-mapping>

                </web-app>

                • 5. Re: boot strapping spring inside Jboss
                  Hung Truong Newbie

                  ...i don't know why < listener> and don't appear. They are in the xml file, and i just cut and pasted it here.