This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Product Version = NetBeans IDE 6.9 (Build 201006111053) Operating System = Windows 7 version 6.1 running on amd64 Java; VM; Vendor = 1.6.0_21 Runtime = Java HotSpot(TM) 64-Bit Server VM 17.0-b16 I do not know yet if it is a GlassFishv3.0.1 or a NetBeans6.9 issue: I have a NetBeans JavaEE project P1 that includes a JavaEE module M1 defining many EJBs. That project includes as a library a Java project J1 defining a Java class called AbstratFacade. Everything is working OK when called from a JavaWeb project W1: But when I try to deploy M1 from NetBeans, GlassFish says: ATTENTION: Error in annotation processing: java.lang.NoClassDefFoundError: com/corp/model/ejb/AbstractFacade GRAVE: Exception while deploying the app java.lang.IllegalArgumentException: Invalid ejb jar [Common_JavaEE_libraries_and_objects-ejb.jar]: it contains zero ejb. Note: 1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or message-driven bean. 2. EJB3+ entity beans (@Entity) are POJOs and please package them as library jar. 3. If the jar file contains valid EJBs which are annotated with EJB component level annotations (@Stateless, @Stateful, @MessageDriven, @Singleton), please check server.log to see whether the annotations were processed properly. ...
can you attach a sample set of projects that demonstrate the behavior you are describing? I assume P1 is an enterprise application project? I assume M1 depends on J1? I do not understand what you are trying to say with this sentence, "Everything is working OK when called from a JavaWeb project W1"... If you clarify the relationship between W1 and P1, M1, and J1, I might be able to understand the relevance of the comment. Another way to help me understand the issue would be to include step-by-step instructions that will let me reproduce your result.
OK, sorry for my English: Using the NetBeans Wizard: 1: Create a Java EE/ EJB Module project: EJBModule1, enable contexts and dependency injection 2: Add to EJBModule1 a new Session Bean: NewSessionBean, mypackage, Singleton 3: Deploy EJBModule1 3: Create a Java / Java Class Library project: JavaLibrary8 4: Add to JavaLibrary8 a new Class: NewClass, mynewpackage 5: Edit EJBModule1 properties and add JavaLibrary8 as a project in the library tab 6: Edit NewSessionBean and add 'extends NewClass' to the class definition and 'import mynewpackage.NewClass;' to at the top of the file 7: Deploy EJBModule1: On my machine it gives: ATTENTION: Error in annotation processing: java.lang.NoClassDefFoundError: mynewpackage/NewClass GRAVE: Exception while deploying the app java.lang.IllegalArgumentException: Invalid ejb jar [EJBModule1]: it contains zero ejb. Note: 1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or message-driven bean. 2. EJB3+ entity beans (@Entity) are POJOs and please package them as library jar. 3. If the jar file contains valid EJBs which are annotated with EJB component level annotations (@Stateless, @Stateful, @MessageDriven, @Singleton), please check server.log to see whether the annotations were processed properly.
OK. This appears to be an ejb module project with libraries bug... The user created an ear... and then deployed modules bit by bit... which breaks down when you have an ejb jar project that depends on a java library project. I know that DKonecny did some work in this area... so this may have been resolved by his changes. Transferring the issue to him to evaluate.
This is resolved for NB7.0 (and should work in NB7 Beta release). Workaround for 6.9 is to create EAR, add the EJB project to the EAR and deploy EAR instead of directly EJB - that will take care of correctly deploying also required Java Class library. *** This bug has been marked as a duplicate of bug 186331 ***