2 Replies Latest reply on Nov 2, 2005 5:32 PM by alvarommz

    EJB 3 Trailblazer problem

    alvarommz

      Hello

      At this moment I have JBoss 4.0.3. RC2, EJB 3.0 RC2, JBoss IDE 1.5. RC1
      installed on my computer, I have also installed an instance of Oracleg 10g database.

      I started my project following the EJB3 TrailBlazers sample project, I applied the same descriptors and .xml files schema uppon my project, (including an hibernate_cfg.xml, to configure the oracle connection), I packaged the project into .jar and .war files, (such as in the blazer), and deployed those files, but at the debugging stage Tomcat reported an error indicating that :

      OCities not bound.

      where OCities is an interface for a stateless session bean to manage an
      OCity entity bean object which persists on an Oracle 10g database.

      This occurs at the init() method of the corresponding servlet
      at the sentence:

      Context cn = new InitialContext();
      OCities Cities = (OCities) cn.lookup(OCities.class.getName());

      I realize it has something to do with Jndi but I don´t know exactly How to manage it. I´m open to suggestions.

      I also wish to mention that in my project the packaging-build.xml file appears decorated by a Bug Icon. I 'd like to know what this decoration Icon means.

      Well that's it
      Thanks a lot in advance.
      Alvaro E Martinez
      alvarommz@yahoo.com

        • 1. Re: EJB 3 Trailblazer problem

          You need to make sure you're looking up the remote interface of your Bean, and not the Bean implementation itself. I don't know if this is the case since I can't see any of your code, but usually it looks something like..

          @Remote
          public interface MySession {
           //..
          }
          
          public class MySessionBean implements MySession {
          //..
          }
          
          ...
          MySession session = (MySession) context.lookup(MySession.class.getName());
          


          If you are using it this way I would double-check your packaging. If you continue having problems, please feel free to post further problems w/ EJB3 to the user forums here:

          http://jboss.com/index.html?module=bb&op=viewforum&f=221

          • 2. Re: EJB 3 Trailblazer problem
            alvarommz

            Mr. marshall

            The example exactly resembles my stateless bean code, but changing MySession to OCities.

            As you have suggested, I´ve posted a more complete definition of the problem to the EJB3 users forum under the heading "Problems on EJB3 - Application".

            I have to ask you for suggestions about it because this application is a real world application that I am developing for Movile Phones distributor.

            Thanks again for your help.
            Alvaro Martinez
            alvaromm@yahoo.com