users@glassfish.java.net

Error deploying EJB jar to GF 3

From: <glassfish_at_javadesktop.org>
Date: Mon, 04 Oct 2010 10:01:01 PDT

I am trying to deploy an EJB 3.1 jar that contains 4 @Stateless classes. Using maven, I have included the interfaces for these EJBs as a dependency. The EJB interface jar includes my JPA 2.0 @Entity classes jar file as a dependency. So it looks like this:

myproj-jpa-1.0.jar (contains the JPA classes annotated with @Entity)
myproj-ejb-api-1.0.jar (EJB remote and local interfaces. includes the above jar as a compile scoped dependency)
myproj-ejb-1.0.jar (EJB classes annotated with @Stateless. include the ejb interface jar as a compile scoped dependency)

All three of these projects build successfully with maven. However, when I deploy the myprog-ejb-1.0.jar to Glassfish using the Glassfish administration console, I get an error that says the project contains zero ejb.

I can successfully deploy the ejb jar to Glassfish if I put all of the code into one project, but I need the jpa and ejb interface code separate since I will have several war projects that depend on them. These war projects need to include the jpa and ejb interface jars as dependencies. I can't package all of the war projects under one ear because I can't afford to redeploy all of the wars when I fix just one.

I guess I don't know the "standard" way to package and compile these projects. In the end, I would really like to have an EAR that contains all of the shared EJB files so all of the different war-based web apps can access them remotely. I don't want duplicate jpa and ejb interface files since that would be a nightmare to update all of them when I make a minor change.

I have gone around in circles for days on this and am not getting any closer to the solution. Any help and/or advice would be appreciated.
[Message sent by forum member 'skullbolix']

http://forums.java.net/jive/thread.jspa?messageID=484323