I have a web application that runs quite nicely within tomcat 5.0.25. When tomcat is running I just access the application with the usual http://localhost:8080/sgs
It does not need any EJB features, but we are planning to incorporate some new functionality that will require a full app server (e.g. JMS) -- hence the interest in jboss.
As a first step, I would like to configure the current app to run within the tomcat (5.0.26 I believe) that is part of jboss 3.2.5.
So I would like to make the necessary definitions/edits within the config files and directory structure of jboss so that when I launch jboss and it in turn starts tomcat, that I can use the same (or similar) url as above to access my web app.
We use JNDI to access a data source and part of the setup for this involves a <resource> specification inside our app's context specification which is included in a <context> section that we have installed inside of tomcat's server.xml.
Here is the fragment for the current tomcat server.xml that works:
<Resource name="jdbc/sgsdb" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/sgsdb">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>org.postgresql.Driver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:postgresql://localhost:5432/sgsdb?user=postgres</value>
<!-- edit the above URL to point to the correct sgsdb location -->
</parameter>
...
</ResourceParams>
In addition, the web.xml for our web-app contains a <resource-ref> section that relates to the JNDI.
The relevant example is:
<resource-ref>
<description>postgreSQL datasource configuration</description>
<res-ref-name>jdbc/sgsdb</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>I see that resource-ref tags do get used for jboss applications but in the examples I looked at, there were no examples of the use of <resource>.
My googling led me to define a jboss-web.xml file inside my app's WEB-INF folder for my application which currently has the following content:
<jboss-web>
<context-root>/sgs</context-root>
<resource-ref>
<res-ref-name>jdbc/sgsdb</res-ref-name>
<jndi-name>java:/jdbc/sgsdb</jndi-name>
</resource-ref>
</jboss-web>I also moved a datasource specification file postgres-ds.xml into the server/default/deploy folder of jboss for my postgres credentials that included the lines:
<datasources>
<local-tx-datasource>
<jndi-name>jdbc/sgsdb</jndi-name>
<connection-url>jdbc:postgresql://localhost:5432/sgsdb</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>appuser</user-name>
<password>password</password>
</local-tx-datasource>
</datasources>
The bottom line is that with all of my configuration attempts, the application will not deploy cleanly.
Perhaps someone has walked down this road before -- moving from plain tomcat to tomcat within jboss.
What is the right sequence of re-configuration steps to make the web application accessible from jboss/tomcat? What new config files do I need and which edits do I need to make in the ones that I have?
Where do I move the application directory to? -- I saw some ideas about creating a sgs.war folder in the jboss installation and placing my files for the application inside this folder. I tried a couple of options for this but could not get access to the JNDI data source.
When I started this, I thought it would be an easy migration, but after a full day of trying I have not succeeded.
Any suggestions appreciated.
Jim
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
