3 Replies Latest reply on Sep 9, 2003 5:43 AM by juha

    Separate ears connected to different datasources

    theactionboy

      hi.

      I am using jboss3.0.7 and separate tomcat4.1.. can anyone let me know how to deploy separate ears of the same EJB, each ear to be connected to different datasource within the same instance of the application server.

      Regars
      Vik

        • 1. Re: Separate ears connected to different datasources
          frito

          Pretty easy, you only have to edit the deployment descriptors for your beans and services. Use different JNDI names for your datasources and for the ejbs in your ears.
          I recommend using an own loader repository for every ear (jboss-app.xml)... read the jboss-app_3_0.dtd in your docs/dtd directory how to do this. You can deploy the datasources each with your ear or both standalone.

          I even recommend reading the J2EE spec (Chap. 8) for packaging and the documentation about Class Loading Architecture of JBoss on sourceforge ( http://sourceforge.net/project/showfiles.php?group_id=22866&release_id=163973 ).

          Greetings,
          Frito

          • 2. Re: Separate ears connected to different datasources
            tsychau

            I am currently using JBoss 3.2.1 and I am trying to deploy two ear files (test1.ear, test2.ear) each containing the same ejbs. They need to connect to different datasources though.

            For each ear file, I use different JNDI names for the datasources and for the ejbs.

            However, when I deploy test1.ear and test2.ear respectively into JBoss, the ejbs in test2.ear always connect to the datasource specified in test1.ear.

            This problem didn't happen if I deploy only one of the ear file. I have modified jbosscmp-jdbc.xml and the -ds.xml in the two ear files. Are there any additional configuration parameters that I need to modify?


            Thanks,
            Thomas

            • 3. Re: Separate ears connected to different datasources

              What do the two jbosscmp-jdbc.xml files in the two ear files look like?

              -- Juha