0 Replies Latest reply on Jul 3, 2014 12:09 PM by Alex Aguiarle

    Glassfish4 (Remote) + Jpa hibernate. I get ClassNotFoundException:

    Alex Aguiarle Newbie

      Please, I get this error:

       

       

      SEVERE:   Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method

      SEVERE:   java.lang.RuntimeException: java.lang.ClassNotFoundException: org.hibernate.jpa.HibernatePersistenceProvider

        at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:167)

        at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:107)

        at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223)

        at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510)

        at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230)

        at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168)

        at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:922)

        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:431)

        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)

        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)

        at java.security.AccessController.doPrivileged(Native Method)

        at javax.security.auth.Subject.doAs(Subject.java:356)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)

        at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:235)

        at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:257)

        at org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:329)

        at org.glassfish.admin.rest.resources.TemplateListOfResource.post(TemplateListOfResource.java:164)

        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.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)

        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:125)

        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152)

        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:91)

        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:346)

        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:341)

        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:101)

        at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:224)

        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)

        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)

        at org.glassfish.jersey.internal.Errors.process(Errors.java:315)

        at org.glassfish.jersey.internal.Errors.process(Errors.java:297)

        at org.glassfish.jersey.internal.Errors.process(Errors.java:267)

        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)

        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:198)

        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:946)

        at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:331)

        at org.glassfish.admin.rest.adapter.RestAdapter$2.service(RestAdapter.java:318)

        at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:181)

        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)

        at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)

        at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)

        at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)

        at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)

        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)

        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)

        at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)

        at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)

        at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)

        at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)

        at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)

        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)

        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)

        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)

        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)

        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)

        at java.lang.Thread.run(Thread.java:722)

      Caused by: java.lang.ClassNotFoundException: org.hibernate.jpa.HibernatePersistenceProvider

        at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1761)

        at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1611)

        at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:161)

        ... 64 more

      SEVERE:   Exception while preparing the app

      SEVERE:   Exception during lifecycle processing

      java.lang.RuntimeException: java.lang.ClassNotFoundException: org.hibernate.jpa.HibernatePersistenceProvider

        at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:167)

        at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:107)

        at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223)

        at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510)

        at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230)

        at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168)

        at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:922)

        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:431)

        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)

        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)

        at java.security.AccessController.doPrivileged(Native Method)

        at javax.security.auth.Subject.doAs(Subject.java:356)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)

        at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:235)

        at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:257)

        at org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:329)

        at org.glassfish.admin.rest.resources.TemplateListOfResource.post(TemplateListOfResource.java:164)

        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.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)

        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:125)

        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152)

        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:91)

        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:346)

        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:341)

        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:101)

        at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:224)

        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)

        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)

        at org.glassfish.jersey.internal.Errors.process(Errors.java:315)

        at org.glassfish.jersey.internal.Errors.process(Errors.java:297)

        at org.glassfish.jersey.internal.Errors.process(Errors.java:267)

        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)

        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:198)

        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:946)

        at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:331)

        at org.glassfish.admin.rest.adapter.RestAdapter$2.service(RestAdapter.java:318)

        at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:181)

        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)

        at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)

        at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)

        at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)

        at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)

        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)

        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)

        at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)

        at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)

        at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)

        at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)

        at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)

        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)

        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)

        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)

        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)

        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)

        at java.lang.Thread.run(Thread.java:722)

      Caused by: java.lang.ClassNotFoundException: org.hibernate.jpa.HibernatePersistenceProvider

        at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1761)

        at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1611)

        at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:161)

        ... 64 more

       

       

      SEVERE:   Exception while preparing the app : java.lang.ClassNotFoundException: org.hibernate.jpa.HibernatePersistenceProvider

      java.lang.ClassNotFoundException: org.hibernate.jpa.HibernatePersistenceProvider

        at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1761)

        at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1611)

        at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:161)

        at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:107)

        at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223)

        at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510)

        at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230)

        at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168)

        at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:922)

        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:431)

        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)

        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)

        at java.security.AccessController.doPrivileged(Native Method)

        at javax.security.auth.Subject.doAs(Subject.java:356)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)

        at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:235)

        at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:257)

        at org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:329)

        at org.glassfish.admin.rest.resources.TemplateListOfResource.post(TemplateListOfResource.java:164)

        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.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)

        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:125)

        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152)

        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:91)

        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:346)

        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:341)

        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:101)

        at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:224)

        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)

        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)

        at org.glassfish.jersey.internal.Errors.process(Errors.java:315)

        at org.glassfish.jersey.internal.Errors.process(Errors.java:297)

        at org.glassfish.jersey.internal.Errors.process(Errors.java:267)

        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)

        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:198)

        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:946)

        at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:331)

        at org.glassfish.admin.rest.adapter.RestAdapter$2.service(RestAdapter.java:318)

        at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:181)

        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)

        at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)

        at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)

        at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)

        at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)

        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)

        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)

        at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)

        at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)

        at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)

        at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)

        at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)

        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)

        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)

        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)

        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)

        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)

        at java.lang.Thread.run(Thread.java:722)

       

      My Teste

       

      package br.com.aguiarle.beans;
      
      
      import javax.ejb.EJB;
      import org.jboss.arquillian.container.test.api.Deployment;
      import org.jboss.arquillian.junit.Arquillian;
      import org.jboss.shrinkwrap.api.Archive;
      import org.jboss.shrinkwrap.api.ShrinkWrap;
      import org.jboss.shrinkwrap.api.asset.EmptyAsset;
      import org.jboss.shrinkwrap.api.spec.WebArchive;
      import org.junit.After;
      import org.junit.AfterClass;
      import org.junit.Before;
      import org.junit.BeforeClass;
      import org.junit.Test;
      import static org.junit.Assert.*;
      import org.junit.runner.RunWith;
      
      
      /**
      *
      * @author Alex
      */
      @RunWith(Arquillian.class)
      public class EmpresasFacadeTest {
      
      
          @EJB
          private EmpresasFacade ejbEmpresas;
      
      
          @Deployment
          public static Archive<?> createTestArchive() {
      
      
              return ShrinkWrap.create(WebArchive.class)
                      .addPackages(true, "br.com.aguiarle.entidades")
                      .addPackages(true, "br.com.aguiarle.beans")
                      .addAsResource("test-persistence.xml", "META-INF/persistence.xml")
                      .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
      
      
          }
      
      
          public EmpresasFacadeTest() {
          }
      
      
          @BeforeClass
          public static void setUpClass() {
          }
      
      
          @AfterClass
          public static void tearDownClass() {
          }
      
      
          @Before
          public void setUp() {
          }
      
      
          @After
          public void tearDown() {
          }
      
      
          /**
           * Test of getNovo method, of class EmpresasFacade.
           */
          @Test
          public void testGetNovo() {
              System.out.println("getNovo");
      
      
              assertNotNull(ejbEmpresas);
      
      
          }
      
      
      }
      

       

       

       

       

      My Pom

       

       

      <url>http://arquillian.org/guides/getting_started/</url>
      
      
          <properties>
              <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
          </properties>
      
      
          <build>
              <plugins>
                  <plugin>
                      <artifactId>maven-compiler-plugin</artifactId>
                      <version>2.3.2</version>
                      <configuration>
                          <source>1.6</source>
                          <target>1.6</target>
                      </configuration>
                  </plugin>
                  <plugin>
                      <artifactId>maven-surefire-plugin</artifactId>
                      <version>2.12</version>
                  </plugin>
              </plugins>
          </build>
          <dependencyManagement>
              <dependencies>
                  <dependency>
                      <groupId>org.jboss.arquillian</groupId>
                      <artifactId>arquillian-bom</artifactId>
                      <version>1.0.3.Final</version>
                      <scope>import</scope>
                      <type>pom</type>
                  </dependency>
              </dependencies>
          </dependencyManagement>
          <dependencies>
              <dependency>
                  <groupId>junit</groupId>
                  <artifactId>junit</artifactId>
                  <version>4.8.1</version>
                  <scope>test</scope>
              </dependency>
              <dependency>
                  <groupId>org.jboss.arquillian.junit</groupId>
                  <artifactId>arquillian-junit-container</artifactId>
                  <scope>test</scope>
              </dependency>
          <dependency>
            <groupId>org.jboss.shrinkwrap.resolver</groupId>
            <artifactId>shrinkwrap-resolver-depchain</artifactId>
            <version>2.0.0</version> <!-- Or whatever version you need -->
            <scope>test</scope>
            <type>pom</type>
          </dependency>
              <dependency>
                  <groupId>org.jboss.spec</groupId>
                  <artifactId>jboss-javaee-6.0</artifactId>
                  <version>1.0.0.Final</version>
                  <type>pom</type>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>org.jboss.weld</groupId>
                  <artifactId>weld-api</artifactId>
                  <version>1.1.Final</version>
                  <scope>test</scope>
              </dependency>
              <dependency>
                  <groupId>org.jboss.arquillian.container</groupId>
                  <artifactId>arquillian-glassfish-remote-3.1</artifactId>
                  <version>1.0.0.CR3</version>
                  <scope>test</scope>
              </dependency>
      
      
      <dependency>
                  <groupId>org.hibernate</groupId>
                  <artifactId>hibernate-core</artifactId>
                  <version>4.3.5.Final</version>
              </dependency>
      
      
              <!-- for JPA, use hibernate-entitymanager instead of hibernate-core -->
               <dependency>
                  <groupId>org.hibernate</groupId>
                  <artifactId>hibernate-entitymanager</artifactId>
                  <version>4.3.5.Final</version>
              </dependency>
      
      
              <!-- optional -->
      
      
              <dependency>
                  <groupId>org.hibernate</groupId>
                  <artifactId>hibernate-osgi</artifactId>
                  <version>4.3.5.Final</version>
              </dependency>
              <dependency>
                  <groupId>org.hibernate</groupId>
                  <artifactId>hibernate-envers</artifactId>
                  <version>4.3.5.Final</version>
              </dependency>
              <dependency>
                  <groupId>org.hibernate</groupId>
                  <artifactId>hibernate-c3p0</artifactId>
                  <version>4.3.5.Final</version>
              </dependency>
              <dependency>
                  <groupId>org.hibernate</groupId>
                  <artifactId>hibernate-proxool</artifactId>
                  <version>4.3.5.Final</version>
              </dependency>
              <dependency>
                  <groupId>org.hibernate</groupId>
                  <artifactId>hibernate-infinispan</artifactId>
                  <version>4.3.5.Final</version>
              </dependency>
              <dependency>
                  <groupId>org.hibernate</groupId>
                  <artifactId>hibernate-ehcache</artifactId>
                  <version>4.3.5.Final</version>
              </dependency>
      
      
      
          </dependencies>
      
      
      </project>
      

       

      My test-persistence.xml

       

      <?xml version="1.0" encoding="UTF-8"?>
      <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
          <persistence-unit name="TesteGerentePU" transaction-type="JTA">
              <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
              <exclude-unlisted-classes>false</exclude-unlisted-classes>
              <properties>
                  <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.SunOneJtaPlatform"/>
                  <property name="hibernate.hbm2ddl.auto" value="update"/>
                  <property name="hibernate.enable_lazy_load_no_trans" value="true"/>
                  <property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
                  <property name="javax.persistence.jdbc.url" value="jdbc:hsqldb:mem:testdb"/>
                  <property name="javax.persistence.jdbc.user" value="sa"/>
                  <property name="javax.persistence.jdbc.password" value=""/>
              </properties>
          </persistence-unit>
      </persistence>
      

       

      I am not using arquillian.xml

       

      I am using hsqld with it jar

      tcks