File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

Deploying to Glassfish

Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

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|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_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|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=30;_ThreadName=Thread-1;|Error in annotation processing: java.lang.NoClassDefFoundError: ejb/Item|#]

[#|2010-02-11T08:09:07.437+0200|SEVERE|glassfishv3.0|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=30;_ThreadName=Thread-1;|Exception while deploying the app
java.lang.IllegalArgumentException: Invalid ejb jar [EJBActionBazaar.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.
at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:72)
at com.sun.enterprise.deployment.util.ApplicationValidator.accept(ApplicationValidator.java:124)
at com.sun.enterprise.deployment.EjbBundleDescriptor.visit(EjbBundleDescriptor.java:722)
at com.sun.enterprise.deployment.Application.visit(Application.java:1744)
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.validate(ApplicationArchivist.java:774)
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openWith(ApplicationArchivist.java:253)
at com.sun.enterprise.deployment.archivist.ApplicationFactory.openWith(ApplicationFactory.java:222)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:145)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:78)
at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:612)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:554)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:262)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:310)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
at org.glassfish.deployment.autodeploy.AutoOperation.run(AutoOperation.java:141)
at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:573)
at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:459)
at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:391)
at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:376)
at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:195)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
|#]


===>SCJP 1.5(72%)<===
==>SCWCD1.5(76%)<===
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Please, UseAMeaningfulSubjectLine
Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

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

Joined: Nov 09, 2008
Posts: 598

***SOLVED****

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

Joined: Mar 14, 2009
Posts: 73
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: http://aspose.com/file-tools
 
subject: Deploying to Glassfish
 
Similar Threads
Glassfish EAR deployment error
Glassfish deployment issues
Strange Glassfish 3 Exception on failed deployment ("SAME URL PATTERN" EXCEPTION)
Can't deploy EJB jar to Glassfish
war file failed to deploy