• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB Remote Interface Inheritance

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have 2 applications deployed in seperate ear files. Application A has a session bean deployed as follows:

<session>
<ejb-name>ReaderEjbCH</ejb-name>
<home>org.library.ReaderEjbCHHome</home>
<remote>ejb.CH</remote>
<ejb-class>org.library.ReaderEjbCHBean</ejb-class>

where ejb.CH is packaged in a common jar file. The jndi name for this bean is "CH/ReaderEjbCH". The Home interface extends a tagging interface (BookCHHome), which is part of application B, which extends the ejb.CHHome interface, which contains the create for ejb.CH.

Application B does a jndi lookup of the CH context, finds the session bean from Application A, and tries to do the following narrow:

CHHome home = (CHHome) javax.rmi.PortableRemoteObject.narrow(obj, ti);
CH ch = home.create();

where obj is the looked up object, and ti is the tagging interface as explained. The tagging interface is a Home interface for a bean that is not defined. WebSphere throws a classCastException, because it can't find the stub for the tagging interface. If I manually create an iiop stub for that tagging interface's class, and include it in the ejb.jar for applicationB I get past the narrow, but then the create fails with a remote exception. From the stack trace it looks like it is trying to call a create() in the tagging interface rather than in the CHHome, which it has been cast to.

[8/18/04 9:43:11:905 EDT] 2e936ed7 SystemErr R at javax.rmi.CORBA.Util.wrapException(Util.java:295)
[8/18/04 9:43:11:905 EDT] 2e936ed7 SystemErr R at org.library.book._BookCHHome_Stub.create(Unknown Source)

This all works for WebLogic, Sun, Oracle, and JBoss. Any clues as to why it might not be working for Websphere 5.1? and what I can try?

tia,

Mike
 
Mike Horwitz
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The ejb-jar.xml is as follows (the tags got dropped from my first post)

"<session>
<ejb-name>ReaderEjbCH</ejb-name>
<home>org.library.ReaderEjbCHHome</home>
<remote>ejb.CH</remote>
<ejb-class>org.library.ReaderEjbCHBean</ejb-class>"
 
Mike Horwitz
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One more try:

ejb-name: ReaderEjbCH
home: org.library.ReaderEjbCHHome
remote: ejb.CH
ejb-class: org.library.ReaderEjbCHBean"
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic