3 Replies Latest reply on Sep 6, 2007 2:56 PM by kdolan1

    DataSource Problem JBoss/Tomcat Only Configuration

    kdolan1

      I need to create an application packaged as a .war file that updates a database and supports transactions. I also need to deploy this application in JBoss but in the Tomcat Only configuration.

      I created a test application, deployed it in the "default" installation of JBoss (along with a test-ds.xml file identifying the location of the database) and everything worked as expected. I then installed JBoss taking the Tomcat only option, deployed the application and test-ds.xml file and things would not deploy. Specifically, the errors on the console revealed it could not deploy the test-ds.xml file: deployer unknown.

      From here, I've tried a variety of things (e.g., removing test-ds.xml and configuring Tomcat's config.xml) and they all result in some kind of problem (e.g., .war will not deploy because resource-ref is not resolved). I've looked at lots of documentation - including Tomcats - to understand what the problem is and what I can do about it. Ideally, I would be able to specify everything (e.g., web.xml, jboss-web.xml) and configure everything (e.g., test-ds.xml) just like I do for the default installation of JBoss because I am running Tomcat in JBoss (but I got the "deployer unknown" error above). But I've also tried modifying things according to the Tomcat documentation and this does not appear to satisfy JBoss either.

      Does anyone know how to do this? Is there any documentation I can read? Is there a "deployer" I need to activate or turn on (without adding a lot of overhead)?

      Thanks!
      Kelly

        • 1. Re: DataSource Problem JBoss/Tomcat Only Configuration
          peterj

          It looks like deployment of *-ds.xml files is handled by org.jboss.deployment.EARDeployer, which implies to me that you need for EAR functionality to be able to deploy *-ds.xml files.

          • 2. Re: DataSource Problem JBoss/Tomcat Only Configuration
            kdolan1

            Ok - so if that is correct (which I think today I proved), I cannot use the -dx.xml file to resolve my JNDI/JDBC connection pool because I can only use the Tomcat only configuration of JBoss.

            If I do not put the -dx.xml file in my deploy folder, JBoss starts but when my application runs I get a "NameNotFoundException" which references "TestWarDB".

            For reference...

            my web.xml contains:
            <resource-ref>
            TestDataSource
            <res-ref-name>jdbc/TestDataSource</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
            </resource-ref>

            my jboss-web.xml contains:
            <resource-ref>
            <res-ref-name>jdbc/TestDataSource</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <jndi-name>java:/TestWarDB</jndi-name>
            </resource-ref>

            So how do I tell JBoss/Tomcat how to resolve java:/TestWarDB?

            I have tried configuring Tomcat (the version deployed within JBoss) according to Tomcat's documentation but I have had no luck in getting anything to work. If JBoss has a Tomcat Only installation configuration, I cannot possible think this would not support interaction with a database.

            Kelly

            • 3. Re: DataSource Problem JBoss/Tomcat Only Configuration
              kdolan1

              I still could figure out how to configure Tomcat in JBoss to recognize my database. So, I compared what components the JEMS installer installs for the "tomcat" option vs. the "default" option. I noticed a component named "jboss-ds". So, I tried using the JEMS installer to install JBoss.

              1. I chose the "default" option.
              2. I de-selected (unchecked) every component that is not installed with the "tomcat" option.
              3. I re-selected the jboss-ds component (and the ones on which it is dependent - jboss-ha-local-jdbc, jboss-ha-xa-jdbc, jboss-local-jdbc, jboss-xa-jdbc, jca-service, jdbc-metadata-service)

              This worked! I was able to deploy my .war file and my -ds.xml file.

              Also, I looked at both the disk space and memory footprint of adding these components and they are negligible (vs. running the entire "default" option). Now I need to confirm I am allowed to install these components.

              Kelly