File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Deploying to Glassfish Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Deploying to Glassfish" Watch "Deploying to Glassfish" New topic

Deploying to Glassfish

Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 608

Hi all,

I am struggling to deploy a SLSB on Glassfish.Everytime I export the EAR to Glassfish's autodeploy folder I get the error below.None of the errors make sense to me.First off,it says that there are zero-ejbs in the EAR.Which is wrong,I have an SLSB(althought it's interfaces are in a client-jar) .Also,I can see that the ejb-jar.xml has an entry for the ejb-client-jar.Secondly it tells me that ejb/Item could not be found.I don't know how this can be because the SLSB project has a reference to my Entity project(visible under the build path->projects tab in Eclipse).Also my entity project has the package ejb and it has a persistence.xml stating the fully qualified class-names of my entities.Something that I find odd is that if I select the EAR and show the JavaEE modules I can see my entity project but the option to add the entity project to the lib of the EAR is not available...Please advise...

Below is the stack trace....

[#|2010-02-11T08:09:06.515+0200|INFO|glassfishv3.0||_ThreadID=30;_ThreadName=Thread-1;|[AutoDeploy] Selecting file D:\Program Files\Glassfish\glassfish\domains\domain1\autodeploy\EJBActionBazaarEAR.ear for autodeployment.|#]

[#|2010-02-11T08:09:07.437+0200|SEVERE|glassfishv3.0|global|_ThreadID=30;_ThreadName=Thread-1;|Class [ ejb/Item ] not found. Error while loading [ class ejb.ItemManager ]|#]

[#|2010-02-11T08:09:07.437+0200|WARNING|glassfishv3.0||_ThreadID=30;_ThreadName=Thread-1;|Error in annotation processing: java.lang.NoClassDefFoundError: ejb/Item|#]

[#|2010-02-11T08:09:07.437+0200|SEVERE|glassfishv3.0||_ThreadID=30;_ThreadName=Thread-1;|Exception while deploying the app
java.lang.IllegalArgumentException: Invalid ejb jar [EJBActionBazaar.jar]: it contains zero ejb.
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.
at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(
at com.sun.enterprise.deployment.util.ApplicationValidator.accept(
at com.sun.enterprise.deployment.EjbBundleDescriptor.visit(
at com.sun.enterprise.deployment.Application.visit(
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.validate(
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openWith(
at com.sun.enterprise.deployment.archivist.ApplicationFactory.openWith(
at org.glassfish.javaee.core.deployment.DolProvider.load(
at org.glassfish.javaee.core.deployment.DolProvider.load(
at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(
at org.glassfish.deployment.admin.DeployCommand.execute(
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(
at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(
at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(
at org.glassfish.deployment.autodeploy.AutoDeployService$
at java.util.TimerThread.mainLoop(

===>SCJP 1.5(72%)<===
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Please, UseAMeaningfulSubjectLine
Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 608

Tried deleting and recreating the glassfish domain.Still not working..
Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 608


I didn't have a sun-ejb-jar....
David McWilliams
Ranch Hand

Joined: Mar 14, 2009
Posts: 74
Hi Duran,

I am getting the exact error. can you tell me what you mean by you not having a sun-ejb-jar?
I agree. Here's the link:
subject: Deploying to Glassfish
It's not a secret anymore!