1 2 Previous Next 16 Replies Latest reply on Oct 22, 2003 5:00 AM by juha

    jboss to non-j2ee connection

    bigbinc

      I want to communicate with a jboss bean, but I want to use a servlet on another machine that is using just tomcat(no jboss). What is the best way to approach this. Also I would not mind sending xml messages back and forth, is this the SOAP approach?

        • 1. Re: jboss to non-j2ee connection

          What exactly do you want to do? Have a servlet call an EJB?

          -- Juha

          • 2. Re: jboss to non-j2ee connection
            bigbinc

            Yea, but the servlet is written without jboss/possibly w/o tomcat. non-j2ee.

            Or possibly a socket connection. But I dont think ejbs do sockets.

            I read somewhere I could just use the http protocol to communicate but are there other ways?

            • 3. Re: jboss to non-j2ee connection

              Yes you can use HTTP, but what's wrong with using just the default RMI?

              -- Juha

              • 4. Re: jboss to non-j2ee connection
                bigbinc

                Hmm, dont know RMI that well. I have a lot of network code in sockets/servlet(mainly use HTTP get and post).

                Will RMI work well when communicating from j2ee/jboss to j2se/RMI?.

                • 5. Re: jboss to non-j2ee connection

                  All you need to do is lookup the proxy from the JBoss naming service inside your servlet code. The default proxies already use RMI. Lookup the home proxy and use create() to get a remote proxy, and then use it.

                  This is standard EJB programming, the same way you'd do it from a standalone client.

                  -- Juha

                  • 6. Re: jboss to non-j2ee connection
                    bigbinc

                    Maybe I am not understanding. Normally I think of EJB/JBOSS on one server machine and all code is compiled on that machine. I run ANT on this machine the code gets deployed you are off to the races. My bean is deployed on JBOSS, good. Lets say, I want to write a client, but I have to travel far,far,far away to Iraq, the Iraq machine only has j2se, you are telling me I can write a simple client and compile it without any code from the jboss server. And I cant install anything on the Iraq machine. The only connection is knowing the naming of the ejb.

                    I know that is typical client/server but most everything I work with on jboss, I compile/deploy the client and server code on the same machine.

                    • 7. Re: jboss to non-j2ee connection
                      bigbinc

                      Could you show me a simple(5-10) lines of a j2se client. Or just show me what import libraries I would typically use. I was trying to code one out real fast.

                      import javax.naming.*;

                      public class testIt {

                      public static void main(String [] args) {

                      try {
                      Context lContext = new InitialContext();

                      System.out.println("Hello");

                      } catch(

                      } // end of the function main


                      } // end of the class

                      • 8. Re: jboss to non-j2ee connection


                        If you're connecting to an EJB through a servlet all your client needs is a web browser. The sevlet is the client to the EJB.

                        You can compile EJB clients using just standard J2EE interfaces, however at runtime you need app server specific libs (as J2EE only provides the interfaces, not implementation)

                        -- Juha

                        • 9. Re: jboss to non-j2ee connection
                          bigbinc

                          Ok, lets say I dont have a web-browser, how would I talk to the ejb. The client is on another machine.

                          • 10. Re: jboss to non-j2ee connection
                            bigbinc

                            I have read that I should use the Corba objects.

                            • 11. Re: jboss to non-j2ee connection

                              > Ok, lets say I dont have a web-browser, how would I
                              > talk to the ejb. The client is on another machine.

                              This is covered by a multitude of EJB documentation. Check it out. They all work on standard J2EE APIs.

                              -- Juha

                              • 12. Re: jboss to non-j2ee connection

                                > I have read that I should use the Corba objects.


                                Using CORBA forces you to compile stubs that you need to distribute to all your clients.

                                -- Juha

                                • 13. Re: jboss to non-j2ee connection
                                  bigbinc

                                  This kind of what I am looking for.

                                  http://jproxy.com

                                  • 14. Re: jboss to non-j2ee connection

                                    As said earlier, we do have HTTP proxies. It doesn't change how you code your EJB clients though.

                                    -- Juha

                                    1 2 Previous Next