Note that there are some explanatory texts on larger screens.

plurals
  1. POSplitting EJBs and interfaces into separate module -- deployment fails
    text
    copied!<p>I'm having trouble following <a href="https://stackoverflow.com/questions/2417626">this guide</a> to "extract" my interfaces and entities from my EAR to use them from another Web Application:</p> <ul> <li>I use NetBeans 6.8 and Glassfish 3.0.1</li> <li>"Java Class Library" project <ul> <li>contains all the entities and interfaces</li> </ul></li> <li>"Java EE Application" project <ul> <li>class library added to the project, is packaged into the EAR</li> <li>contains EJB implementations, MDBs, Test</li> </ul></li> <li>"Java Web Application" project <ul> <li>class library added to the project, is packaged into the WAR</li> <li>contains REST interface</li> </ul></li> </ul> <p>When I build and deploy the Web Application, all goes well.</p> <p>When I build the Java EE application, I can see the jar-file (interfaces, entities) being included. But when I try to deploy the EAR, Glassfish refuses it with a java.lang.NoClassDefFoundError error:</p> <pre><code>[#|2010-03-28T18:25:59.875+0200|WARNING|glassfishv3.0|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=28;_ThreadName=Thread-1;|Error in annotation processing: java.lang.NoClassDefFoundError: mvs/core/StoreServiceLocal|#] [#|2010-03-28T18:25:59.876+0200|SEVERE|glassfishv3.0|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=28;_ThreadName=Thread-1;|Exception while deploying the app 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. </code></pre> <p>'mvs/core/StoreServiceLocal' is an interface which is defined in the library jar file.</p> <p>What am I doing wrong?</p> <p>I'm using EJB3 Annotations, so there is no bean-specific deployment descriptor:</p> <p>mvs/core/ShopperService.java:</p> <pre><code>@Stateless public class ShopperService implements ShopperServiceLocal, ShopperServiceRemote { } </code></pre> <p>mvs/core/ShopperServiceLocal.java:</p> <pre><code>@Local public interface ShopperServiceLocal { } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload