Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiple Beans for same Home And Remote interfaces  RSS feed

 
subhash koganti
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is for the discussion on the doubts on Multiple Bean implementations for the same home and remote interfaces
 
subhash koganti
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi..

I am writing a class ,say XYZ which extends another EJB class,say ABC .The Home and Remote Interfaces of ABC are already defined and are packed in a jar.


Actually, the Home,Remote and the Bean of the ABC are written and packed in the jars.Now ,what my requirement is to override a function in the ABC.

I didnt write any separate Home and remote interfaces for the class XYZ .i Just included the jar that contains the home and remote of the ABC class, and gave the home and remote interface for the XYZ as the home and remote of ABC.

Did any body worked in this kind of scenario? If yes, please let me know.i have several doubts to ask.Those are not small enough to explain in the text form here.



Seeking help.
Thanks And Regards
Subhash Koganti.
 
Kaustabh Singha Roy
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have never tried this in practical. But I can't recall any rule that stops you from doing this. You just need to make the classes available at the time of deployment and design your ejb-jar.xml carefully with a different ejb name.
 
subhash koganti
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for the reply. I would like to add additional details on how I have done it.
Following interfaces already exist in the supplier jar.
Application 1:
public interface myHomeInterface {

};
public interface myRemoteInterface {

};
public class myBean {

};

ejb-jar.xml for application 1:
<session id="myBean">
<ejb-name>myBean</ejb-name>
<home>application1.myHomeInterface</home>
<remote>application1.myRemoteInterface</remote>
<ejb-class>application1.myBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>

Application 2:

public class myAnotherBean extens myBean{

};

ejb-jar.xml for application 2:
<session id="myAnotherBean">
<ejb-name>myAnotherBean</ejb-name>
<home>application1.myHomeInterface</home>
<remote>application1.myRemoteInterface</remote>
<ejb-class>application2.myAnotherBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
MANIFEST.MF for application 2 (contains jar file of application 1)
application1.jar

The problem here is application1.jar does not contain stubs and skeletons for home and remote interfaces because of deployment code generation for application 2 generating some IO exceptions stating that Stubs and skeletons are not available. So, any suggestions on how to handle this?

Thanks in advance

subhash k.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!