11 Replies Latest reply on Nov 17, 2003 10:22 AM by jfraser

    JBoss + external tomcat

    nick1304

      is there a way to integrate JBoss with just any installation of Tomcat, rather than the embedded one? i'd like to have that flexibility. or am i misunderstanding what's meant by "embededded" tomcat?

      thanks!
      nick

        • 1. Re: JBoss + external tomcat

          What version of Tomcat are you interested in?

          If Tomcat is run externally then there is little difference between it and any other standalone client - you need to supply it with the client files for JBoss and your EJB application.

          The only situation where there is a difference is if you are using security - then the web container's security setup has to be compatible with that being used in JBoss, and a mechanism has to be put in place to propagate the caller's credentials during calls to JBoss.

          Luke.

          • 2. Re: JBoss + external tomcat
            nick1304

            We have an existing setup with Tomcat 4.0.1, and would like to integrate JBoss with it. Is there a way I can just point JBoss at our existing installation?

            Thanks,
            Nick

            • 3. Re: JBoss + external tomcat
              bradsimonin

              Do I need to add the files /lib/ext/ejb.jar, /client/jboss-client.jar, and /client/jnp-client.jar to a specific Tomcat file?

              I am using JBoss 2.4.3 and Tomcat 4.0.1

              • 4. Re: JBoss + external tomcat
                twhphan

                Hi,

                What about the JNDI setting? I've jndi.properties in C:\catalina\common\classes\jndi.properties, which Tomcat 4.0.1 + JVM 1.3.1 should picks it.

                My jndi.properties contains:
                java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
                java.naming.provider.url=localhost:1099
                java.naming.factory.url.pkgs=org.jboss.naming

                I also copied all the JAR files from C:\jboss\client to C:\catalina\common\lib. And I copied my application's WAR file to C:\catalina\webapps

                I run JBoss 3.0 alpha (the snapshot version), then Tomcat on the same PC, but I get the following from Tomcat:

                javax.naming.NamingException: Cannot create resource instance
                at org.apache.naming.NamingContext.lookup(NamingContext.java:837)
                at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
                at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
                at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
                at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
                at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
                at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
                at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
                at org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
                at javax.naming.InitialContext.lookup(InitialContext.java:350)
                at esb.bean.MailBean.sendMail(Unknown Source)

                • 5. Re: JBoss + external tomcat


                  > What about the JNDI setting? I've jndi.properties in
                  > C:\catalina\common\classes\jndi.properties, which Tomcat 4.0.1 + JVM 1.3.1 should picks it.

                  I'm not sure how Tomcat handles this. I seem to remember that I set the properties myself when using an external Tomcat 4 but that was some time ago. You'll have to check the docs or the tomcat mailing list archive.

                  I believe you can also disable the built in naming service by using a command line parameter "-nonaming" which may help.

                  Luke.

                  • 6. Re: JBoss + external tomcat
                    jameschaingchen

                    Hi Luke,

                    Can you elaborate more regarding the following message that you posted? I ran into a situation that I need to make tomcat running standalone using JBoss integrated security solution.

                    "... The only situation where there is a difference is if you are using security - then the web container's security setup has to be compatible with that being used in JBoss, and a mechanism has to be put in place to propagate the caller's credentials during calls to JBoss."

                    Thanks!

                    James

                    • 7. Re: JBoss + external tomcat
                      bagus

                      Hi.
                      I copied this files :
                      jboss-client.jar
                      jboss-j2ee.jar
                      jnp-client.jar
                      jboss-common-client.jar
                      jbosssx-client.jar
                      jnet.jar
                      log4j.jar
                      to $JAVA_HOME/jre/lib/ext/

                      then make a context factory like :
                      Properties prop=new Properties();
                      prop.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
                      prop.put(Context.PROVIDER_URL,"jnp://localhost:1099");

                      prop.put("java.naming.factory.url.pkgs","org.jnp.interfaces");

                      Context ctx=new InitialContext(prop);

                      ....
                      Object obj=ctx.lookup("ejb/MyEJB");

                      or

                      Object objref=ctx.lookup("jnp://localhost:1099/ejb/MyEJB");

                      And it was working in my environment.
                      I'm using Tomcat 4.0.1 and JBoss 3.0

                      • 8. Re: JBoss + external tomcat
                        bagus

                        Hi.
                        I copied this files :
                        jboss-client.jar
                        jboss-j2ee.jar
                        jnp-client.jar
                        jboss-common-client.jar
                        jbosssx-client.jar
                        jnet.jar
                        log4j.jar
                        to $JAVA_HOME/jre/lib/ext/

                        then make a context factory like :
                        Properties prop=new Properties();
                        prop.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
                        prop.put(Context.PROVIDER_URL,"jnp://localhost:1099");

                        prop.put("java.naming.factory.url.pkgs","org.jnp.interfaces");

                        Context ctx=new InitialContext(prop);

                        ....
                        Object obj=ctx.lookup("ejb/MyEJB");

                        or

                        Object objref=ctx.lookup("jnp://localhost:1099/ejb/MyEJB");

                        And it was working in my environment.
                        I'm using Tomcat 4.0.1 and JBoss 3.0

                        • 9. Re: JBoss + external tomcat
                          bagus

                          Hi.
                          I copied this files :
                          jboss-client.jar
                          jboss-j2ee.jar
                          jnp-client.jar
                          jboss-common-client.jar
                          jbosssx-client.jar
                          jnet.jar
                          log4j.jar
                          to $JAVA_HOME/jre/lib/ext/

                          then make a context factory like :
                          Properties prop=new Properties();
                          prop.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
                          prop.put(Context.PROVIDER_URL,"jnp://localhost:1099");

                          prop.put("java.naming.factory.url.pkgs","org.jnp.interfaces");

                          Context ctx=new InitialContext(prop);

                          ....
                          Object obj=ctx.lookup("ejb/MyEJB");

                          or

                          Object objref=ctx.lookup("jnp://localhost:1099/ejb/MyEJB");

                          And it was working in my environment.
                          I'm using Tomcat 4.0.1 and JBoss 3.0

                          • 10. Re: JBoss + external tomcat
                            rizkaarifianto

                            hi...

                            Try copy those files to: %CATALINA_HOME%/common/lib

                            Regards,

                            • 11. Re: JBoss + external tomcat
                              jfraser

                              Hello,

                              The only idea, that I could come up with, but I haven't tried it, is to write a filter and have the filter use the AJP13 connector. which tomcat creates by default just an idea. if you solve this let me know.

                              JOE