1 Reply Latest reply on Sep 12, 2003 6:45 AM by Juha Lindfors

    Tomcat 4.0.6 to Jboss 3.2.1 howto

    javakat Newbie

      Over the past two weeks, I have been trying to convert an existing tomcat 4.0.6 SSL app to jboss and found no clear instructions on how to do so. So, now that I have it working, I typed up the steps I followed in the hopes that it will keep someone else from spending all this time or at least will point some folks in the right direction... I hope I didn't forget any steps and that this is okay to post here.

      Instructions on how to deploy an SSL webapp .war file, originally configured for Tomcat 4.0.6, to JBoss 3.2.1-Tomcat4.1.24
      (NO EJBS)

      1.) Install jboss3.2.1_tomcat-4.1.24

      2.) Set up JBOSS_HOME in your env properties

      3.) Set up keystore with keytool -genkey -alias j2ee -keyalg RSA -keystore ./.keystore

      4.) Add the following lines to $JBOSS_HOME/server/default/conf/jboss-service.xml
      <!-- JAAS security manager and realm mapping -->


      org.jboss.security.plugins.JaasSecurityDomain



      jboss.security:service=JaasSecurityManager




      put the path to your .keystore file here
      put your .keystore password here


      5.) Add the following lines to $JBOSS_HOME/server/default/deploy/jbossweb-tomcat.sar/META-INF/jboss-service.xml
      <!-- Define an SSL HTTP/1.1 Connector on port 443 -->






      6.) Database Resources
      Take the db resource refs in your server.xml and web.xml files and break then out into seperate data source files and add a jboss-web.xml.
      Copy your driver jars to $JBOSS_HOME/server/default/lib

      Should look like this:
      -Add these lines to $YOUR_WEB_APP/web/WEB-INF/web.xml
      <resource-ref>

      Resource reference to a factory for java.sql.Connection
      instances that may be used for talking to a particular
      database that is configured in the server.xml file.

      <res-ref-name>
      mydb
      </res-ref-name>
      <res-type>
      javax.sql.DataSource
      </res-type>
      <res-auth>
      Container
      </res-auth>
      </resource-ref>

      -Add these lines to $YOUR_WEB_APP/web/WEB-INF/jboss-web.xml
      <resource-ref>
      <res-ref-name>
      mydb
      </res-ref-name>
      <res-type>
      javax.sql.DataSource
      </res-type>
      <jndi-name>java:/jdbc/mydb</jndi-name>
      </resource-ref>

      -Create $JBOSS_HOME/server/deploy/mydb-ds.xml which should contain the following:

      For SQL Server

      <local-tx-datasource>
      <jndi-name>mydb</jndi-name>
      <connection-url>jdbc:JSQLConnect://$YOURSERVER/database=$YOURDB</connection-url>
      <driver-class>com.jnetdirect.jsql.JSQLDriver</driver-class>
      </local-tx-datasource>


      For Oracle:

      <local-tx-datasource>
      <jndi-name>mydb</jndi-name>
      <connection-url>jdbc:oracle:thin:@$YOURSERVER:1521:$YOURSID</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>$YOURUSER</user-name>
      $YOURPWD
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      </local-tx-datasource>


      7.) Change your accessing of the db to "java:/" instead of "java:comp/env/jdbc/"

      8.) Build your .war and drop it into $JBOSS_HOME/server/default/deploy/