Hi,
 
I am facing very big problem with Orion.
 
Our application is based on JSP/Servlet and EJBs. We have Oracle. Our application is running fine with WebLogic 5.1.
 
Now, we are trying to run it under Orion. First, we faced big problem of lookup which everybody is facing. We solved that after very long exercise. Now we are facing another bigger problem.
 
We have aprox. 60 EJBs in the application. Out of 60, 1 (one) EJB is having it's own Home and Remote interface. Whereas other 59 EJBs are having COMMON Home and Remote interface. We declare it in ejb-jar.xml in the following way:
 
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN" "
http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd">
 
<ejb-jar>
 <description/>
 <enterprise-beans>
   
  <session>
   <display-name>ClientList</display-name>
   <ejb-name>ClientListHome</ejb-name>
   <home>COM.InfoDream.StaffXpert.Reports.DBAccess.HomeObj</home>
   <remote>COM.InfoDream.StaffXpert.Reports.DBAccess.RemoteObj</remote>
   <ejb-class>COM.InfoDream.StaffXpert.Reports.DBAccess.ClientMgr.ClientList.ejb.ClientListEJB</ejb-class>
   <session-type>Stateless</session-type>   
  </session>  
  <session>
         <display-name>General</display-name>
   <ejb-name>GeneralHome</ejb-name>
   <home>COM.InfoDream.StaffXpert.Reports.DBAccess.Common.General.ejb.GeneralHome</home>
   <remote>COM.InfoDream.StaffXpert.Reports.DBAccess.Common.General.ejb.General</remote>
   <ejb-class>COM.InfoDream.StaffXpert.Reports.DBAccess.Common.General.ejb.GeneralEJB</ejb-class>
   <session-type>Stateless</session-type>
  </session>
  <session>
   <display-name>Candidate</display-name>
   <ejb-name>CandidateHome</ejb-name>
   <home>COM.InfoDream.StaffXpert.Reports.DBAccess.HomeObj</home>
   <remote>COM.InfoDream.StaffXpert.Reports.DBAccess.RemoteObj</remote>
   <ejb-class>COM.InfoDream.StaffXpert.Reports.DBAccess.HiringMgr.Candidate.ejb.CandidateEJB</ejb-class>
   <session-type>Stateless</session-type>   
  </session>   
   </enterprise-beans>
 <assembly-descriptor>
      <security-role>
         <description>Users</description>
         <role-name>users</role-name>
      </security-role>
   </assembly-descriptor>
</ejb-jar>
Also, we declare the same in Application-client.xml as described:
 
<?xml version="1.0"?>
<!DOCTYPE application-client PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.2//EN" "
http://java.sun.com/j2ee/dtds/application-client_1_2.dtd">
<application-client>
 <ejb-ref>
  <ejb-link>ClientListHome</ejb-link> 
  <ejb-ref-name>ejb/ClientListHome</ejb-ref-name>
  <ejb-ref-type>Session</ejb-ref-type>
  <home>COM.InfoDream.StaffXpert.Reports.DBAccess.HomeObj</home>
  <remote>COM.InfoDream.StaffXpert.Reports.DBAccess.RemoteObj</remote>
 </ejb-ref> 
 <ejb-ref>
  <ejb-link>GeneralHome</ejb-link>
  <ejb-ref-name>ejb/GeneralHome</ejb-ref-name>
  <ejb-ref-type>Session</ejb-ref-type>
  <home>COM.InfoDream.StaffXpert.Reports.DBAccess.Common.General.ejb.GeneralHome</home>
  <remote>COM.InfoDream.StaffXpert.Reports.DBAccess.Common.General.ejb.General</remote>
 </ejb-ref> 
 <ejb-ref>
  <ejb-link>CandidateHome</ejb-link>        <!--   Note: ejb-link tag have no use at all. It's not working in this case. Can you tell How to use it? -->
  <ejb-ref-name>ejb/CandidateHome</ejb-ref-name>
  <ejb-ref-type>Session</ejb-ref-type>
  <home>COM.InfoDream.StaffXpert.Reports.DBAccess.HomeObj</home>
  <remote>COM.InfoDream.StaffXpert.Reports.DBAccess.RemoteObj</remote>
 </ejb-ref>
</application-client>
Also, we declare the same in web.xml as described:
 
<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "
http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
 
<web-app>
 <display-name>StaffXpert Web Application</display-name>
 
 <context-param>
  <param-name>SXDataSource</param-name>
  <param-value>jdbc/SXDataSource</param-value>
 </context-param>
 <servlet>
  <servlet-name>ReportOutput</servlet-name>
  <display-name>ReportOutput</display-name>
  <description>Servlet that calls the ReportOutput</description>
  <servlet-class>COM.InfoDream.StaffXpert.Reports.Common.ReportOutput</servlet-class>
 </servlet>
 <welcome-file-list>
  <welcome-file>default.jsp</welcome-file>
  <welcome-file>index.html</welcome-file>
 </welcome-file-list>
 <login-config>
  <auth-method>BASIC</auth-method>
 </login-config>
 <ejb-ref>
  <ejb-link>ClientListHome</ejb-link> 
  <ejb-ref-name>ejb/ClientListHome</ejb-ref-name>
  <ejb-ref-type>Session</ejb-ref-type>
  <home>COM.InfoDream.StaffXpert.Reports.DBAccess.HomeObj</home>
  <remote>COM.InfoDream.StaffXpert.Reports.DBAccess.RemoteObj</remote>
 </ejb-ref>
 <ejb-ref>
  <ejb-link>GeneralHome</ejb-link>
  <ejb-ref-name>ejb/GeneralHome</ejb-ref-name>
  <ejb-ref-type>Session</ejb-ref-type>
  <home>COM.InfoDream.StaffXpert.Reports.DBAccess.Common.General.ejb.GeneralHome</home>
  <remote>COM.InfoDream.StaffXpert.Reports.DBAccess.Common.General.ejb.General</remote>
 </ejb-ref>
 <ejb-ref>
  <ejb-link>CandidateHome</ejb-link> 
  <ejb-ref-name>ejb/CandidateHome</ejb-ref-name>
  <ejb-ref-type>Session</ejb-ref-type>
  <home>COM.InfoDream.StaffXpert.Reports.DBAccess.HomeObj</home>
  <remote>COM.InfoDream.StaffXpert.Reports.DBAccess.RemoteObj</remote>
 </ejb-ref>
</web-app>
 
Now, when we lookup for GeneralHome , we get the correct EJB home - GeneralHome.
BUT, when we lookup for Candidate EJB, with the following command: (
It, returns - ClientHome !!!!!!!!!)
 
   Context ctx = getInitialContext();
   HomeObj home;    //Our common Home
   RemoteObj r;        //Our common Remote
   String ejbName = "CandidateHome";
   try
   {
    Object obj = ctx.lookup("java:comp/env/ejb/"+ejbName);
    home = (HomeObj)PortableRemoteObject.narrow(obj,HomeObj.class);
    System.out.println("HomeObj in ReportDelegate : " + home);        //This prints - ClientlistHome !!! (Reference to ClientList EJB)
   }
   catch (Throwable exception)
   {
    throw new Exception("Unable to get home interface: " + exception.toString());
   }
It, returns - Client EJB !!!!!!!!!
 
Also note that, if we write CandidateHome first in ejb-jar.xml, Application-Client.xml, it returns correct home interface - CandidateHome but, when you lookup for ClientHome interface, it will still return you CandidateHome interface during lookup!. It seems that the listing order is key in Orion lookup method.
 
It would be a great help if you can have any clue.
 
Thanks in advance.
 
Manish

Reply via email to