2 Replies Latest reply on May 3, 2008 6:22 PM by Nilesh Porwal

    Tomcat to JBoss migration question

    Nilesh Porwal Newbie

      I have an application that runs well in Tomcat6. Under the conf\Catalina\localhost I have a viewData.xml file with these details:

      <Context path="/viewData" docBase="C:\\viewData\\web">
      <Logger className="org.apache.catalina.logger.FileLogger"
       prefix="viewData." suffix=".txt"
       timestamp="true"/>
      <Resource
       name="jms/viewData"
       auth="Container"
       type="com.ibm.mq.jms.MQQueueConnectionFactory"
       factory="com.ibm.mq.jms.MQQueueConnectionFactoryFactory"
       description="JMS Queue Connection Factory for sending messages"
       HOST="DEVMQHOST"
       PORT="1414"
       CHAN="JAVA.CHANNEL"
       TRAN="1"
       QMGR="DEVMQMGR"/>
      
       <Resource
       name="jms/viewDataSend"
       auth="Container"
       type="com.ibm.mq.jms.MQQueue"
       factory="com.ibm.mq.jms.MQQueueFactory"
       description="JMS Queue for sending"
       QU="VIEWDATA.SEND"/>
      
       <Resource
       name="jms/viewDataReceive"
       auth="Container"
       type="com.ibm.mq.jms.MQQueue"
       factory="com.ibm.mq.jms.MQQueueFactory"
       description="JMS Queue for receiving"
       QU="VIEWDATA.RECEIVE"/>
      </Context>
      


      How do I deploy this application in Jboss 4.2.2.GA?

      1. I tried putting the web folder in the server/default/deploy folder as viewData. When I tried accessing it via the browser, I got the 404 message "The requested resource (/viewData/.....) is not available.

      2. I moved the folder out of server/default/deploy and moved it to D:\viewData
      In the default/deploy/jboss-web.deployer/server.xml file, I added this code snippet under the section.

      <Context path="/viewData" docBase="C:\\viewData"/>
      


      I also added a WEB.INF/jboss-web.xml
      <jboss-web>
      <Context path="/viewData">
      <Logger className="org.apache.catalina.logger.FileLogger"
       prefix="viewData." suffix=".txt"
       timestamp="true"/>
      <Resource
       name="jms/viewData"
       auth="Container"
       type="com.ibm.mq.jms.MQQueueConnectionFactory"
       factory="com.ibm.mq.jms.MQQueueConnectionFactoryFactory"
       description="JMS Queue Connection Factory for sending messages"
       HOST="DEVMQHOST"
       PORT="1414"
       CHAN="JAVA.CHANNEL"
       TRAN="1"
       QMGR="DEVMQMGR"/>
      
       <Resource
       name="jms/viewDataSend"
       auth="Container"
       type="com.ibm.mq.jms.MQQueue"
       factory="com.ibm.mq.jms.MQQueueFactory"
       description="JMS Queue for sending"
       QU="VIEWDATA.SEND"/>
      
       <Resource
       name="jms/viewDataQueue"
       auth="Container"
       type="com.ibm.mq.jms.MQQueue"
       factory="com.ibm.mq.jms.MQQueueFactory"
       description="JMS Queue for receiving"
       QU="VIEWDATA.RECEIVE"/>
      </Context>
      </jboss-web>
      


      When I tried accessing the URL again, I got this error message:

      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'viewDataService' defined in ServletContext resource [/WEB-INF/viewData-servlet.xml]: Cannot resolve reference to bean .....
      


      What do I need to change?

        • 1. Re: Tomcat to JBoss migration question
          Peter Johnson Master

          Rename your folder to viewData.war (server/default/deploy/viewData.war). JBossAS needs the extension to determine what type of application your have and therefore how to deploy it.

          • 2. Re: Tomcat to JBoss migration question
            Nilesh Porwal Newbie

            I tried that, and it moved further along. I dropped the references from the default/deploy/jboss-web.deployer/server.xml file.

            Here is what I put into my WEB-INF/jboss-web.xml file:

            <resource-env-ref>
            <resource-env-ref-name>jms/viewData</resource-env-ref-name>
            <resource-env-ref-type>javax.jms.QueueConnectionFactory</resource-env-ref-type>
            <jndi-name>java:/viewData</jndi-name>
            </resource-env-ref>
            


            Now I have to figure out where to put in the context information. Here is I get this in the log files:

            Here is the error message:
            2008-05-03 17:46:36,927 INFO [STDOUT] ERROR: [03-05-2008 17:46:36] [FrameworkServlet.java:243 initServletBean()]
             Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'viewDataService' defined in ServletContext resource [/WEB-INF/viewData-servlet.xml]: Cannot resolve reference to bean .....
            


            Where does the context information go? Where can the spring framework pick up the information from the application server?