wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB Netbeans: Entity Beans" Watch "EJB Netbeans: Entity Beans" New topic
Author

EJB Netbeans: Entity Beans

Sunny Jassal
Greenhorn

Joined: Feb 08, 2011
Posts: 13
Hello,

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 http://wiki.netbeans.org/DevelopJavaEE6App 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
Greenhorn

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: http://aspose.com/file-tools
 
subject: EJB Netbeans: Entity Beans
 
Similar Threads
EJB remote interface problem over internet
EJB3 help needed
NetBeans and MySQL
Is it possible to call session bean from plain java class within same project?
My SCEA Part 1Study Notes