6 Replies Latest reply on May 6, 2002 6:06 AM by saint1

    Monson-Haefel example - Client_1

    deanp

      Hi All - I'm trying to run the Client_1 example which uses the first draft of the TravelAgent EJB.

      My issue is when the TravelAgentBean executes the JNDI lookup - it always throws a ClassNotFoundException when looking for the com.titan.cabin.CabinHome class (which is in the cabin.jar).

      I've seen a similar thread and implemented the changes mentioned - but nothing seems to work - and I'm on the way to going crazy...

      Please help!

      Thanks,
      Dean

        • 1. Re: Monson-Haefel example - Client_1
          sebaseba

          Which thread do you mean?

          Sound like a classpath issue, but you probably already guessed that much :-)

          /Sebastian

          • 2. Re: Monson-Haefel example - Client_1
            saint1

            You must look at "CabinBean" :-)

            jndiContext.lookup("CabinBean")
            hope it works. You should look in documentation of JBOSS there is a describtion of that. You need a jboss.xml file
            where you specify the reference between your EntityBean and the SessionBean.

            Pierre

            • 3. Re: Monson-Haefel example - Client_1
              deanp

              Mmmm - still no luck...

              the call I am making TravelAgentBean is...

              Context jndiContext = new InitialContext();
              Object obj = jndiContext.lookup("java:comp/env/ejb/CabinHome");

              In the ejb-jar.xml file we have...

              ...
              <ejb-ref>
              <ejb-ref-name>ejb/CabinHome</ejb-ref-name>
              <ejb-ref-type>Entity</ejb-ref-type>
              com.titan.cabin.CabinHome
              com.titan.cabin.Cabin
              </ejb-ref>
              ...

              and the jboss.xml file looks like:


              <enterprise-beans>

              <ejb-name>TravelAgentBean</ejb-name>
              <ejb-ref>
              <ejb-ref-name>ejb/CabinHome</ejb-ref-name>
              <jndi-name>CabinBean</jndi-name>
              </ejb-ref>

              </enterprise-beans>


              Now - I assume that the TravelAgentBean looks for "ejb/CabinHome" from ejb-jar.xml (which is then mapped to CabinBean by jboss.xml) and then looks for the com.titan.cabin.CabinHome class - which is where it fails...

              Do I need to set a CLASSPATH? or some kind of classpath extension in a configuration file?

              Oh - Thanks for the suggestions so far...help is much appreciated.

              Thanks,
              Dean

              • 4. Re: Monson-Haefel example - Client_1
                saint1

                You must put the Cabin classes into your Travelagent.jar.

                Pierre

                • 5. Re: Monson-Haefel example - Client_1
                  deanp

                  Thanks Pierre - that worked!

                  Is putting the Cabin Bean classes used by the TravelAgent Bean standard for EJB development/deployment or is it a particular aspect of JBoss?

                  • 6. Re: Monson-Haefel example - Client_1
                    saint1

                    I havnt worked with other containers. I think it is a paticular aspect of jboss.

                    regards Pierre