1 Reply Latest reply on Jan 21, 2008 9:32 AM by jaikiran

    Help! Migrating from tomcat to Jboss

    amol82

      Hi,

      We have a Struts-spring-hibernate application.
      We just migrated to java 1.6 from 1.4
      I am now doing a POC to migrate it to Jboss from Tomcat.
      I am pretty new to Jboss.

      We have a docbase and jdbc resource spedified in server.xml in tomcat.

      So i specified docbase in server.xml in webdeploy directory in Jboss.(Correct me if there is any other way to specify the exploded code.)

      The problem i am currently facing is the while loading application it is not able to find the datasource.

      my jdbc datasource in tomcat looks like "jdbc/xxxx"
      and in my application it is used as "comp/env/jdbc/xxxx"

      But when i did the same in server.xml in jboss I am getting an error the it is not able to find "env"

      I tried to make a seperate "oracle-ds.xml" but i am getting the same error.
      I even tried to use "jdbc/xxxx" in my application code but then I am getting and error that jdbc is not found.

      But when i remove the application path fr server.xml and use only oracle-ds.xml i am able to see the the entry in jms-console as well as datasourse name in jboss startup but jms-console is not available with application as there is error and also jdbc datasource entry in logs is not showing.
      Thanks in advance,
      Amol

        • 1. Re: Help! Migrating from tomcat to Jboss
          jaikiran

          Which version of JBoss are you using?

          We just migrated to java 1.6 from 1.4


          The latest stable version of JBoss (i.e. 4.2.2) is not yet fully qualified to run under Java6. You will have to use Java5 instead.

          So i specified docbase in server.xml in webdeploy directory in Jboss.(Correct me if there is any other way to specify the exploded code.)


          There are a couple of options for this:
          1) Follow this http://wiki.jboss.org/wiki/Wiki.jsp?page=ExplodedDeployment

          OR

          2) Edit the jboss-service.xml file under %JBOSS_HOME%/server/< serverName>/conf folder to include the path where you have the deployable application. There's a attribute named URLs under Deployment Scanning section which contains the list of folders which will scanned by JBoss for deploying application. Read through the comments there, to understand how you can add your own folder which will be scanned by JBoss:
          <attribute name="URLs">
           deploy/
           </attribute>


          As far as the datasource issue is concerned, you will first have to deploy the datasource using a -ds.xml file. The datasource by default will be bound to the java: namespace with the jndi-name that you specified in the -ds.xml file. If you further have to bind it in the java:comp/env namespace then you will have to configure it using resource-ref elements in the web.xml and jboss-web.xml files