Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

[SOLVED] multiple EJB modules

Jan VerveckenMar 18 2007 — edited Mar 26 2007
hi

I'm trying to find a good approach to use a stateless session bean available in another EJB module, from a stateless session bean in the same J2EE application.

I've created a example application to show what I'm trying to do (only about 21 kB, no database required):
http://verveja.footsteps.be/~verveja/files/oracle/MultipleEJBModules-v0.01.zip

There seems to be no problem if both session beans are in the same EJB module. I can use this:
@Stateless(name="MySessionBeanAOne")
public class MySessionBeanAOneBean
	implements MySessionBeanAOneLocal
{
	@EJB
	MySessionBeanATwoLocal fMySessionBeanATwoLocal;

	// ...
}
If the session beans are in different EJB modules, this doesn't seem to work.

I've found some alternative approach (see mejbm.ejbmoduleb.MySessionBeanBThreeBean.alternativeFindMySessionBeanCFourLocal()) but this looks like it is headed for trouble if I would try to deploy it on something other than the JDeveloper Embedded OC4J Server.

question :
Could someone please suggest how I should use EJB session beans, available in different EJB modules in the same J2EE application, together?

many thanks
Jan Vervecken
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 23 2007
Added on Mar 18 2007
5 comments
754 views