Boa tarde pessoal, há mais de 1 semana estou tentando fazer um teste unitário utilizando EJB embedded, conforme exemplo
https://netbeans.org/kb/docs/javaee/javaee-entapp-junit.html
Porém não roda…já baixei o exemplo pronto do site e não rodou…já reinstalei o netbeans com o glassfish e nada
Estou utilizando NB 7.3 e GF 3.2.2
Apresenta o seguinte erro
Jun 04, 2013 4:00:22 PM org.glassfish.ha.store.spi.BackingStoreFactoryRegistry register
INFO: Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry
Jun 04, 2013 4:00:22 PM org.hibernate.validator.internal.util.Version <clinit>
INFO: HV000001: Hibernate Validator 4.3.0.Final
Jun 04, 2013 4:00:23 PM com.sun.enterprise.v3.server.AppServerStartup run
INFO: GlassFish Server Open Source Edition 3.1.2.2 (5) hora de inicialização : Embedded (521ms), serviços de inicialização(944ms), total(1.465ms)
Jun 04, 2013 4:00:23 PM org.glassfish.admin.mbeanserver.JMXStartupService$JMXConnectorsStarterThread run
INFO: JMX006: JMXStartupService had disabled JMXConnector system
Jun 04, 2013 4:00:24 PM org.glassfish.admin.mbeanserver.JMXStartupService shutdown
INFO: JMX001: JMXStartupService and JMXConnectors have been shut down.
Jun 04, 2013 4:00:24 PM com.sun.enterprise.v3.server.AppServerStartup stop
INFO: Procedimento de shutdown finalizado
Jun 04, 2013 4:00:24 PM AppServerStartup run
INFO: [Thread[GlassFish Kernel Main Thread,5,main]] exiting
Jun 04, 2013 4:00:24 PM org.glassfish.ha.store.spi.BackingStoreFactoryRegistry register
INFO: Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry
Jun 04, 2013 4:00:24 PM com.sun.enterprise.v3.server.AppServerStartup run
INFO: GlassFish Server Open Source Edition 3.1.2.2 (5) hora de inicialização : Embedded (2.976ms), serviços de inicialização(51ms), total(3.027ms)
Jun 04, 2013 4:00:24 PM org.glassfish.admin.mbeanserver.JMXStartupService$JMXConnectorsStarterThread run
INFO: JMX006: JMXStartupService had disabled JMXConnector system
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping module: javax.resource.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping module: javax.management.j2ee.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping module: javax.security.auth.message.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping module: javax.mail.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping module: javax.enterprise.deploy.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping module: javax.servlet.jsp-api.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping module: weld-osgi-bundle.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping module: javax.servlet-api.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping module: javax.servlet.jsp.jstl.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping module: jaxb-osgi.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping module: webservices-osgi.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping module: javax.transaction.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping module: jersey-core.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping module: javax.faces.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping module: bean-validator.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping module: javax.el-api.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping module: javax.ejb.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping module: javax.security.jacc.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping entry with a Manifest file with a special attribute: webservices-api-osgi.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping module: javax.servlet.jsp.jstl-api.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping entry with a Manifest file with a special attribute: javax.annotation.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping module: javax.jms.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping module: javax.persistence.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl skipJar
INFO: ... skipping entry with a Manifest file with a special attribute: glassfish-embedded-static-shell.jar
Jun 04, 2013 4:00:25 PM org.glassfish.ejb.embedded.DeploymentElement getOrCreateApplication
INFO: [DeploymentElement] adding lib to exploded ear isEJBModule? false isWebApp? false
Jun 04, 2013 4:00:26 PM org.glassfish.ejb.embedded.DeploymentElement getOrCreateApplication
INFO: [DeploymentElement] adding ant-launcher.jar to exploded ear isEJBModule? false isWebApp? false
Jun 04, 2013 4:00:26 PM org.glassfish.ejb.embedded.DeploymentElement getOrCreateApplication
INFO: [DeploymentElement] adding jaxb-api-osgi.jar to exploded ear isEJBModule? false isWebApp? false
Jun 04, 2013 4:00:26 PM org.glassfish.ejb.embedded.DeploymentElement getOrCreateApplication
INFO: [DeploymentElement] adding ant-junit4.jar to exploded ear isEJBModule? false isWebApp? false
Jun 04, 2013 4:00:26 PM org.glassfish.ejb.embedded.DeploymentElement getOrCreateApplication
INFO: [DeploymentElement] adding ant.jar to exploded ear isEJBModule? false isWebApp? false
Jun 04, 2013 4:00:26 PM org.glassfish.ejb.embedded.DeploymentElement getOrCreateApplication
INFO: [DeploymentElement] adding classes to exploded ear isEJBModule? true isWebApp? false
Jun 04, 2013 4:00:26 PM org.glassfish.ejb.embedded.DeploymentElement getOrCreateApplication
INFO: [DeploymentElement] adding WebAppJUnit to exploded ear isEJBModule? true isWebApp? false
Jun 04, 2013 4:00:26 PM org.glassfish.ejb.embedded.DeploymentElement getOrCreateApplication
INFO: [DeploymentElement] adding jaxm-api.jar to exploded ear isEJBModule? false isWebApp? false
Jun 04, 2013 4:00:26 PM org.glassfish.ejb.embedded.DeploymentElement getOrCreateApplication
INFO: [DeploymentElement] adding classes to exploded ear isEJBModule? false isWebApp? false
Jun 04, 2013 4:00:26 PM org.glassfish.ejb.embedded.DeploymentElement getOrCreateApplication
INFO: [DeploymentElement] adding ant-junit.jar to exploded ear isEJBModule? false isWebApp? false
Jun 04, 2013 4:00:26 PM org.glassfish.ejb.embedded.DeploymentElement getOrCreateApplication
INFO: [DeploymentElement] adding junit-4.10.jar to exploded ear isEJBModule? false isWebApp? false
Jun 04, 2013 4:00:26 PM org.glassfish.ejb.embedded.EJBContainerImpl deploy
INFO: [EJBContainerImpl] Deploying app: /tmp/ejb-app7631511468611719865
Jun 04, 2013 4:00:29 PM org.glassfish.api.ActionReport failure
SEVERE: Exceção ao implantar a aplicação [ejb-app]
Jun 04, 2013 4:00:29 PM com.sun.enterprise.v3.server.ApplicationLifecycle deploy
SEVERE: Invalid ejb jar [WebAppJUnit.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.
java.lang.IllegalArgumentException: Invalid ejb jar [WebAppJUnit.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:830)
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:175)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:94)
at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:827)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:769)
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:389)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:129)
at org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:142)
at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:134)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:127)
at bean.MyBeanTest.setUpClass(MyBeanTest.java:35)
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 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:520)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1060)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:911)
Jun 04, 2013 4:00:29 PM org.glassfish.deployment.admin.DeployCommand execute
SEVERE: Exceção ao implantar a aplicação [ejb-app] : Invalid ejb jar [WebAppJUnit.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.
Jun 04, 2013 4:00:29 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl createEJBContainer
INFO: [EJBContainerProviderImpl] Cleaning up on failure ...
Jun 04, 2013 4:00:29 PM org.glassfish.admin.mbeanserver.JMXStartupService shutdown
INFO: JMX001: JMXStartupService and JMXConnectors have been shut down.
Jun 04, 2013 4:00:29 PM org.glassfish.admin.mbeanserver.JMXStartupService shutdown
INFO: JMX001: JMXStartupService and JMXConnectors have been shut down.
Jun 04, 2013 4:00:29 PM com.sun.enterprise.v3.server.AppServerStartup stop
INFO: Procedimento de shutdown finalizado
Jun 04, 2013 4:00:29 PM AppServerStartup run
INFO: [Thread[GlassFish Kernel Main Thread,5,main]] exiting