12 Replies Latest reply on May 3, 2005 11:18 AM by darranl

    Configuring JBoss to existing tomcat

    choepeter

      i have just got jboss 3.2.3 to run with tomcat. but is there way to specify jboss to use another instance of tomcat as opposed to the one that came with jboss. if so, what do i need to configure in jboss and tomcat to have them work together?

        • 1. Re: Configuring JBoss to existing tomcat
          starksm64

          No, you either use the embedded tomcat or use tomcat standalone.

          • 2. Re: Configuring JBoss to existing tomcat
            luigifonti

            I am currently using Tomcat-5 (pre-installed on port 80) and jboss-3.2.3 (with embedded Tomcat-4 on port 8080). They co-exist and work.
            Servlets are installed on tomcat-5, and they successfuly access EJBs managed by jboss (using remote interfaces).

            I just had to copy the following jar files from directory <jboss-home>/server/default/lib/ to directory <tomcat-home>/common/lib/:

            jbossall-client.jar
            jboss-client.jar
            jboss-common-client.jar
            jboss-j2ee.jar
            jboss-jaas.jar
            jboss-net-client.jar
            jbossx-client.jar
            jboss-system-client.jar
            log4j.jar
            jsse.jar

            This was necessary because the servlets act as clients of EJBs, and they need the jboss client libraries when they are executed.

            I only use embedded tomcat-4 for jmx-console:
            http://hostname:8080/jmx-console

            • 3. Re: Configuring JBoss to existing tomcat
              choepeter

              i should copy the files and start tomcat AND jboss?

              should all the bean class also be in the tomcat directory or do they need to be placed in the jboss directory?

              i am very new to this so please be patient with me.

              • 4. Re: Configuring JBoss to existing tomcat
                luigifonti

                Yes, you must copy the files to tomcat directory, then start or re-start tomcat.
                Jboss doesn't need to be re-started if already active.

                The jar file with the packed bean classes must be copied to jboss directory (e.g. ../server/default/deploy/ ). It will automatically be deployed within few seconds, because jboss continuously scans the deploy directory to check for new files.

                If you have a servlet acting as client for beans, then you must copy its class file(s) to tomcat directory tree.

                Best regards.
                Luigi Fonti

                • 5. Re: Configuring JBoss to existing tomcat
                  luigifonti

                  Oh, i see i made a mistake in my previous reply: the library jar files must be copied taking them from <jboss-home>/client/ directory, not from <jboss-home>/server/default/lib/

                  Bye
                  Luigi Fonti

                  • 6. Re: Configuring JBoss to existing tomcat
                    span

                    Hi,

                    I'm new to JBoss. I currently use Tomcat 4.1.24 with Struts 1.1, now I want to enable JBoss 3.2.3 to existing Tomcat 4.1.24.

                    I downloaded jboss-3.2.3.zip which included Tomcat 4.1.29 and installed. I can start JBoss without problems.

                    As I read above posted responses, I need to copy all jar files under <jboss-home>/client/ into <tomcat-home>/common/lib/. However choepeter asked should all the bean class also be in the tomcat directory ? what bean class do you refer to? is it all jar files under <jboss-home>/client/ ?

                    I don't understand Fonti's reply: Yes, you must copy the files to tomcat directory, then start or re-start tomcat. Jboss doesn't need to be re-started if already active. What the files do you refer to? which subdirectory of tomcat?

                    The jar file with the packed bean classes must be copied to jboss directory (e.g. ../server/default/deploy/ ). what the jar files do you refer? please explain more detail.

                    the sequence for starting JBoss with existing Tomcat is starting JBoss first then start existing Tomcat, am I right? if I'm right, how do I know I start tomcat 4.1.24 not 4.1.29?

                    Thank you all!

                    • 7. Re: Configuring JBoss to existing tomcat
                      syzygy

                      How do we obtain context of beans deployed in Jboss from tomcat when we are using external tomcat as mentioned by Luigifonti.

                      • 8. Re: Configuring JBoss to existing tomcat
                        darranl

                        Anyone asking how to get JBoss to use a different Tomcat has got their tiers back to front.

                        The web tier should make use of the EJB tier, however the EJB tier should have no knowledge of the web tier.

                        You should be asking how can I get a standalone Tomcat to make use of JBoss.

                        Obtaining the Context should be the same as obtaining the context for any stand alone application. i.e.

                        Context ctx = new InitialContext() and make sure that you have a jndi.properties on the classpath of the web app, alternatively pass in the connection properties to the contructor.

                        As described earlier in this post you will need to copy soem JBoss jars to the Tomcat installation.

                        • 9. Re: Configuring JBoss to existing tomcat
                          ice

                           

                          "darranl" wrote:
                          Anyone asking how to get JBoss to use a different Tomcat has got their tiers back to front.

                          The web tier should make use of the EJB tier, however the EJB tier should have no knowledge of the web tier.

                          You should be asking how can I get a standalone Tomcat to make use of JBoss.

                          Obtaining the Context should be the same as obtaining the context for any stand alone application. i.e.

                          Context ctx = new InitialContext() and make sure that you have a jndi.properties on the classpath of the web app, alternatively pass in the connection properties to the contructor.

                          As described earlier in this post you will need to copy soem JBoss jars to the Tomcat installation.


                          The problem here, is that we want to connect a standAlone TOMCAT to our JBOSS (standing on a distant computer) and that without changing the application's code. just working on the configuration files of JBOSS...

                          • 10. Re: Configuring JBoss to existing tomcat
                            ice

                             

                            "darranl" wrote:
                            Anyone asking how to get JBoss to use a different Tomcat has got their tiers back to front.

                            The web tier should make use of the EJB tier, however the EJB tier should have no knowledge of the web tier.

                            You should be asking how can I get a standalone Tomcat to make use of JBoss.

                            Obtaining the Context should be the same as obtaining the context for any stand alone application. i.e.

                            Context ctx = new InitialContext() and make sure that you have a jndi.properties on the classpath of the web app, alternatively pass in the connection properties to the contructor.

                            As described earlier in this post you will need to copy soem JBoss jars to the Tomcat installation.


                            The problem here, is that we want to connect a standAlone TOMCAT to our JBOSS (standing on a distant computer) and that without changing the application's code. just working on the configuration files of JBOSS...

                            • 11. Re: Configuring JBoss to existing tomcat
                              darranl

                               

                              The problem here, is that we want to connect a standAlone TOMCAT to our JBOSS (standing on a distant computer)


                              Yes that is what is being discussed originally here.

                              and that without changing the application's code. just working on the configuration files of JBOSS...


                              JBoss is the server for your EJBs, why does it need to know anything about the web tier which at the end of the day is just a client. All of the configuration needs to be done at the Tomcat layer.

                              You need to configure your web application to use the remote JBoss.

                              You do not need to configure JBoss to be used by the remote web application.

                              • 12. Re: Configuring JBoss to existing tomcat
                                darranl

                                I have found this article that should help you: -

                                http://www.amitysolutions.com.au/documents/JBossTomcatJNDI-technote.pdf