Hi

I have just start to look at Orion and I am having problems getting my
Session bean to access my other Session bean. I wrote a servlet to access my
session which in turn calls another session bean to do something. I suspect
it must have something to do with my deployment descriptors. I really
appreciate if someone can help me out.

The error message I am getting is
Time stamp: Tue Aug 29 09:12:47 GMT+08:00 2000
Hello type: Hello_StatelessSessionBeanWrapper0 Error calling the Hello bean
com.evermind.server.rmi.OrionRemoteException:
javax.naming.NameNotFoundException: ejb/codeReferenceUtilHome not found in
Hello; nested exception is: javax.naming.NameNotFoundException:
ejb/codeReferenceUtilHome not found in Hello


I am running Orion 1.2.0 on JDK 1.2.2 and I used KAWA 5.0 to develop my
beans. I have been able to get the session to session bean talking in Sun
J2EE RI. My two beans are

Session Bean

HelloEJB, Hello, HelloHome

Entity

CodeReferenceUtilEJB, CodeReferenceUtil, CodeReferenceUtilHome


My META-INF\ejb-jar.xml is

                <session>
                        <description>no description</description>
                        <display-name>Hello</display-name>
                        <ejb-name>com.consultech.portal.util.Hello</ejb-name>
                        <home>com.consultech.portal.util.HelloHome</home>
                        <remote>com.consultech.portal.util.Hello</remote>
                        <ejb-class>com.consultech.portal.util.HelloEJB</ejb-class>
                        <session-type>Stateless</session-type>
                        <transaction-type>Bean</transaction-type>
                <ejb-ref>
                        <ejb-ref-name>ejb/codeReferenceUtil</ejb-ref-name>
                        <ejb-ref-type>Session</ejb-ref-type>
                        <home>com.consultech.portal.util.CodeReferenceUtilHome</home>
                        <remote>com.consultech.portal.util.CodeReferenceUtil</remote>
                    </ejb-ref>
                </session>
                <session>
                        <description>no description</description>
                        <display-name>Code Reference</display-name>
                        
<ejb-name>com.consultech.portal.util.CodeReferenceUtil</ejb-name>
                        <home>com.consultech.portal.util.CodeReferenceUtilHome</home>
                        <remote>com.consultech.portal.util.CodeReferenceUtil</remote>
                        
<ejb-class>com.consultech.portal.util.CodeReferenceUtilEJB</ejb-class>
                        <session-type>Stateless</session-type>
                        <transaction-type>Bean</transaction-type>
                        <resource-ref>
                          <res-ref-name>jdbc/fbsPortalDataSource</res-ref-name>
                          <res-type>javax.sql.DataSource</res-type>
                          <res-auth>Container</res-auth>
                        </resource-ref>
                </session>



My HelloEJB.java session bean access method is

        protected Object getHome(String name, Class type) {
                try  {
                        Context context  = new javax.naming.InitialContext();
                        Object ref = context.lookup("java:comp/env/ejb/"+name);
                        return PortableRemoteObject.narrow(ref,type);
                } catch (javax.naming.NamingException ne) {
                        throw new EJBException( ne);
                }
        }


        public String getHello2()
        {
                //
                // Get access to the sequence object...
                try  {
                        CodeReferenceUtilHome codehome =
CodeReferenceUtilHome)this.getHome( "codeReferenceUtilHome",
CodeReferenceUtilHome.class );
                        CodeReferenceUtil coderef = codehome.create();
                        Integer partytype = coderef.getIndividualType();
                        System.out.println("individual type returned is " +
String.valueOf(partytype));
                        return "individual type return is " + 
String.valueOf(partytype);
                } catch (CreateException ce) {
                        throw new EJBException("Fail to create keypool ejb");
                } catch (RemoteException re) {
                        throw  new EJBException(re);
                }
        }

My CodeReferenceUtilHome.java is

public interface CodeReferenceUtilHome extends EJBHome
{
        CodeReferenceUtil create() throws RemoteException, CreateException;
}


Reply via email to