I am having problems with this guide to “extract” my interfaces and entities from my EAR, so that I can use them from another web application:
- I am using NetBeans 6.8 and Glassfish 3.0.1.
- Java Class Library Project
- contains all objects and interfaces
- Project "Java EE Application"
- the class library added to the project is packaged in an EAR
- contains implementations of EJB, MDB, Test
- Project "Java Web Application"
- class library added to project packaged in WAR
- contains a REST interface
When I create and deploy a web application, everything goes well.
When I create a Java EE application, I see that the jar file (interfaces, entities) are included. But when I try to deploy the EAR, Glassfish refuses it with the java.lang.NoClassDefFoundError error:
[
[
java.lang.IllegalArgumentException: Invalid ejb jar [CoreServer]: 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.
'mvs / core / StoreServiceLocal' is the interface that is defined in the library jar file.
What am I doing wrong?
I use EJB3 annotations, so there is no bean descriptor descriptor:
MVS / core /ShopperService.java:
@Stateless
public class ShopperService implements ShopperServiceLocal, ShopperServiceRemote {
}
MVS / core /ShopperServiceLocal.java:
@Local
public interface ShopperServiceLocal {
}
source
share