3

I have created a new EnterpriseApplication (EA) in NetBeans 7.1. Added some JPA entities in the EJBModule. Now I want to add some Remote SessionBeans in the EnterpriseApplication.

Then right clicked on the EJBModule, selected Session Bean for Entity Classes. Then selected the Entities for which Session Bean is required. In the Step 3 window, i select the Remote interface check box and select the Class Library Project from the combo box.

That is when i get an Error message stating "EJBRemote Interface depends on JPA Entity Classes. JPA Entities are inaccessible if they are located in the "myejb"

Is this a bug in NetBeans 7.1 or am i missing something?

JustTrying
  • 121
  • 1
  • 2
  • 11

1 Answers1

3

You should create the entity classes in the Class Library Project, include the project in the EJBModule project dependencies and then create the session beans for entity classes in the EJBModule project. The remote interfaces will be created in the Class Library project.

remigio
  • 4,101
  • 1
  • 26
  • 28
  • HI, thank you, what you describe is a somehow complicated for me as a new netbeans user... Between i made some search find this http://www.youtube.com/watch?v=uUspRCPKiWU . Is it what you describe? I found another respons from the netbeans forom saying "You should place your Entity Classes into the Java Class Library as well." but I don't know where is the Java Class Library. – JustTrying Jan 13 '13 at 15:25
  • The "Java Class Library" is a project containing Java code that produces a jar file, you can create it with New Project and choosing Java Class Library. Just create your entities in the newly created project and then add it as a dependency to the EJB Module project (right click the Libraries node and choose Add Project). Now you can create your session beans. – remigio Jan 13 '13 at 16:44
  • I am going to do what this comment says too. +1 – le3th4x0rbot May 17 '13 at 15:28
  • this is a very interesting question and answer. Is there further reading on this topic, perhaps? I don't see much mention of EJB Facade in the books I've found. – Thufir Oct 12 '14 at 11:08