3 Replies Latest reply on Feb 14, 2005 3:48 PM by osterday

    Running EJBs from JBoss via web

    luthier

      OK, I mistaked the question *AND* the forum yesterday, I hope now I get it right. I'm following the EJB3 tutorial and everything goes OK in console (at least the calculator and the shopping cart), but I'd like to access the Beans from another computer via web... Any idea on how can I do it? I took a look at almost every tutorial here and found no reference, sorry if I skipped one or if it's really obvious. Thanks :-)

      LuTHieR

        • 1. Re: Running EJBs from JBoss via web
          luthier

          Sorry to insist, but it's very important to me to know how to access EJBs remotely. As I said in my question in the other forum (EJB Developers, I think), I have to impart a class on Monday about EJBs and so far I have only got them to work locally (with JBoss 4.0.1RC1, EJB 3.0 Preview 2 and Apache Ant 1.6.2), but the idea is to make it possible for the students to access each other's beans remotely, either via web or by any other mean. If anyone has any information about it please post it here. Thanks a lot again

          LuTHieR

          • 2. Re: Running EJBs from JBoss via web

            I'm not sure if i understand wat u r trying to say , but if i get right u want to acsess yr beans remotely from diiferent clients...
            Then use Java client and make sure yr beans are deployed using Remote interface not local interfaces...
            And acces the name server by its ip address / by name not teh one on loachost...as thi s wil give reference to the bean, to invoke opearations on it.

            This is the main feataure of EJBs... to acess the business logic encapsulated in them by front tier which can be web lient or a Thick/Thin Client

            Vishal

            • 3. Re: Running EJBs from JBoss via web
              osterday

              Have you used EJBs before? I'm new to the EJB world and haven't used EJB3 yet. I would recommend learning EJB2 first - although the EJB2 might be just as applicable to EJB3. I also found the J2EE patterns very valuable. Best to code the EJBs with only LOCAL interfaces and use a session "facade" EJB for the REMOTE one with a controller servlet accessing the session facade bean. That serlvet can be accessed from the web. I recommend the books "Teach yourself EJB in 21 days" and "XDoclet in Action". Also, check the java.sun.com site for the core J2EE patterns. (Of course some more experienced EJB coders might have better insight than me!)

              Hope that helps! Using MyEclipse and XDoclet, I was able to get a simple J2EE/EJB app up and running in JBoss 4 very quickly, and from my understanding, coded "the right way".