users@glassfish.java.net

Re: Invalid ejb jar ... it contains zero ejb

From: Hong Zhang <hong.hz.zhang_at_oracle.com>
Date: Thu, 11 Aug 2011 10:34:30 -0400

Any exceptions before that in the server.log?

forums_at_java.net wrote:
> Thanks for your response, this is the exception I get...
>
> <code>java.lang.IllegalArgumentException: Invalid ejb jar [myejb.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:76)
>
>
> at
> com.sun.enterprise.deployment.util.ApplicationValidator.accept(ApplicationValidator.java:128)
>
>
> at
> com.sun.enterprise.deployment.EjbBundleDescriptor.visit(EjbBundleDescriptor.java:730)
>
>
> at com.sun.enterprise.deployment.Application.visit(Application.java:1765)
>
> at
> com.sun.enterprise.deployment.archivist.ApplicationArchivist.validate(ApplicationArchivist.java:816)
>
>
> at
> com.sun.enterprise.deployment.archivist.ApplicationArchivist.openWith(ApplicationArchivist.java:277)
>
>
> at
> com.sun.enterprise.deployment.archivist.ApplicationFactory.openWith(ApplicationFactory.java:240)
>
>
> at
> org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:171)
>
>
> at
> org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:93)
>
>
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:828)
>
>
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:770)
>
>
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:368)
>
>
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
>
>
> at
> org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:382)
>
>
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
>
>
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
>
>
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1064)
>
>
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
>
>
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1244)
>
>
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1232)
>
>
> at
> org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:202)
>
> at
> org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:195)
>
> at
> org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:148)
>
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>
>
> at java.lang.reflect.Method.invoke(Method.java:601)
>
> at
> com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
>
>
> at
> com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
>
>
> at
> com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
>
>
> at
> com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
>
>
> at
> com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)
>
>
> at
> com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
>
>
> at
> com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)
>
>
> at
> com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
>
>
> at
> com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
>
>
> at
> com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
>
>
> at
> com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
>
>
> at
> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
>
>
> at
> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
>
>
> at
> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
>
>
> at
> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
>
>
> at
> com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer._service(GrizzlyContainer.java:182)
>
>
> at
> com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer.service(GrizzlyContainer.java:147)
>
>
> at
> org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:184)
>
>
> at
> com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
>
>
> at
> com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
>
>
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:238)
>
>
> at
> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
>
> at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
>
> at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
>
> at
> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
>
>
> at
> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
>
>
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
>
>
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
>
>
> at
> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
>
> at
> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
>
>
> at
> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
>
>
> at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
>
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
>
>
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
>
>
> at java.lang.Thread.run(Thread.java:722)</code>
>
> My persistence jar looks good (package in root, META-INF in root with
> persistence.xml, orm.xml, etc. inside), my ejb jar looks the same just of
> course that I have ejb-jar.xml in META-INF (my ejb-jar.xml only contains
> displayName but as far as I know on ejb 3+ it's optional to put stuff
> there),
> and my ear has all libraries (mypersistence, myejb, hibernate,
> persistence-api, etc.) in root and META-INF with application.xml, etc.
> in it.
> Unless my persistence jar is supposed to be in the ejb jar (I don't
> think so)
> the packages themselves look correct.
>
>
>
>
> --
>
> [Message sent by forum member 'kikujiro']
>
> View Post: http://forums.java.net/node/831197
>
>