aspose file tools*
The moose likes JBoss/WildFly and the fly likes EJB 3.0 Entity Bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "EJB 3.0 Entity Bean" Watch "EJB 3.0 Entity Bean" New topic
Author

EJB 3.0 Entity Bean

Ajan Raj
Greenhorn

Joined: Jan 29, 2008
Posts: 10
Can anyone tell me the steps to create EJB 3.0 Entity Bean in Eclipse 3.3.2 with JBoss Applicaion server. I had created a sample Application but while lookup its throwing error such as javax.naming.NameNotFoundException: EntityBean not bound
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10266
    
168

"Aj an"

Please click the "My Private Messages" link (at the top of this page) for a message from JavaRanch.


[My Blog] [JavaRanch Journal]
Ajan Raj
Greenhorn

Joined: Jan 29, 2008
Posts: 10
Jaikiran Pai wrote:"Aj an"

Please click the "My Private Messages" link (at the top of this page) for a message from JavaRanch.



Hey i don't understand what you are expecting me to do. Eventhough i had changed the name you are sending the same message.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10266
    
168

Ajan Raj wrote:

Eventhough i had changed the name you are sending the same message.


I sent it only once, before you changed your display name.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5843
    
    7

Could you post the source for your entity bean? And the code that is using it, which I assume is the code that is getting the NameNotFoundException. Don't forget to wrap the code in 'code' tags.


JBoss In Action
Ajan Raj
Greenhorn

Joined: Jan 29, 2008
Posts: 10
Peter Johnson wrote:Could you post the source for your entity bean? And the code that is using it, which I assume is the code that is getting the NameNotFoundException. Don't forget to wrap the code in 'code' tags.


I am new to EJB. I had download a sample example and work on that.

In the servlet i am Using

These are the files which i am using in the ejb.
Book.java
BookBean.java
BookLocal.java
BookRemote.java.

And herewith i have given the code.

BookLocal.java




BookRemote


BookBean.java

Book.java


Can you help me out from this problem


Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10266
    
168

...
import javax.persistence.PersistenceContext;
...

public class BookBean implements BookLocal, BookRemote {


This one is missing the @Stateless annotation. Hence its not considered a bean.

Add this:
Ajan Raj
Greenhorn

Joined: Jan 29, 2008
Posts: 10
Thanks a lot jaikiran. It works fine. Can you please tell me the site to get EJB 3.0 tutorial. By google search i am getting a lot. But i want to know from the basic. Can you suggest me the site.



Jaikiran Pai wrote:
...
import javax.persistence.PersistenceContext;
...

public class BookBean implements BookLocal, BookRemote {


This one is missing the @Stateless annotation. Hence its not considered a bean.

Add this:
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10266
    
168

EJB3.0 tutorial for JBossAS5 is here. For AS4.x, its here
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB 3.0 Entity Bean