File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to call ENtity Bean from Message driven bean

 
karthik kummar
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How to call Entity Bean from MDB. whether is it possible.
if it is possible ,could you explain how to configure.
 
E Armitage
Rancher
Posts: 989
9
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know how to call it from a session bean?
Use the same approach.
 
karthik kummar
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont know about this(calling session bean from MDB ). I am new to EJB beans, could you please explain with some example. It could help me to understand.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of EJB are you on? The rules are very different by version.
 
karthik kummar
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using EJB 3.0
 
Vaibhav Bhardwaj
Greenhorn
Posts: 5
Hibernate Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For example , Hello is Entity Bean whom you want to invoke.
So from client class i.e. your MDB , you can use below code & MDB is nothing but a java class with annotation "@MessageDriven".


Context ctx = new InitialContext();
Hello hello = (Hello)ctx.lookUp("JNDIName");

now use "hello" to invoke business methods.
 
Mahendr Shinde
Ranch Hand
Posts: 38
Eclipse IDE Java Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In EJB 3.0, Entity's are NOT Beans, they are simple POJO classes. You can use them just like any other java classes.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic