File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes EJB Netbeans: Entity Beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of RabbitMQ in Depth this week in the Open Source forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB Netbeans: Entity Beans" Watch "EJB Netbeans: Entity Beans" New topic

EJB Netbeans: Entity Beans

Sunny Jassal

Joined: Feb 08, 2011
Posts: 13

I am going through the tutorials and trying to create my first Remote EJB using Netbeans. I am stumped at one area. Hoping that someone can share there thoughts:

I followed instructions on to create an EJB project. The one thing that I did different was create a Remote EJB vs a local EJB. When I created the project I got EJBTestClient, EJBMyProject, EJBMyProject-ejb and EJBMyProjectRemoteInterface. I created a new MyBean (package com.myproject.ejb) in EJBMyProject-ejb and added a business method. This worked flawlessly. The method was inserted in MyBean in EJBMyProject and a signature of it was created in MyBeanRemote in the EJBMyProjectRemoteInterface.

Here is the problem:

Problem 1

I added some entity classes using the database (package com.myproject.entity) in EJBMyProject-ejb. This worked fine. When I add a business method in MyBean using the entity class I get no problems in EJBMyProject-ejb. The business method is automatically also added in MyBeanRemote which is located in EJBMyProjectRemoteInterface, however package com.myproject.entity is never found. I would think that the reference for the entity beans would be automatically added, but they are not.

Problem 2

I created a new web application and added a session bean which is trying to access the Remote EJB. The project finds EBJMyProjectRemote with no problem, however it cannot find the entity classes. I am assuming I need to add the jar file for the entity classes here. But where would I find them?

Hopefully I am clear in explaining the above.

Thanks for your help in advance.

Sunny Jassal

Joined: Feb 08, 2011
Posts: 13
I was able to resolve problem two by going to the web project and adding a library for EJBMyProject-jar. When I try to add this to the EJBMyProjectRemoteInterface I get a circular reference issue.
I agree. Here's the link:
subject: EJB Netbeans: Entity Beans