jpanetbeans-7session-bean

Session Bean for Entity Classes error message: "EJB Remote Interface depends on JPA Entity classes ..."


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?


Solution

  • 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.