1 Reply Latest reply on Aug 29, 2012 11:37 AM by Gaspar Kuhnen

    Arquillian + Multi Module Maven Project + Glassfish Embedded

    Gaspar Kuhnen Newbie

      I cant test my EJBs with glassfish embedded.

      A Hibernate errors appears.

       

      My projects structure:

           project

           ---project-base

            ---project-ejb

           ---project-web

           ---project-ear

       

      I running my tests on project-ejb.

       

       

      Test class:

       

      @RunWith(Arquillian.class)
      public class InutilizacaoTest {
      
        
                @Deployment
                public static final Archive<?> criarArquivoDeploy(){
                          EnterpriseArchive arquivoTeste = ShrinkWrap
                                 .create(ZipImporter.class, "test.ear")
                                 .importFrom(new File("/home/gaspar/projetos/trunk/nfe-webservice/nfe-webservice-ear/target/nfe-webservice-ear.ear"))
                                 .as(EnterpriseArchive.class);
        
                          return arquivoTeste;
                }
        
                @EJB
                private INFeInutilizacaoBO bo;
        
                @Test
                public void verificarRegraInutilizacaoI08(){
                          Inutilizacao obj = new Inutilizacao();
                          obj.setTipoAmbiente(1);
                          try {
                                    bo.verificarRegraInutilizacaoI08(obj);
                          } catch (SefazException e) {
                                    e.printStackTrace();
                                    Assert.assertFalse(false);
                          }
                          Assert.assertTrue(true);
                }
      
      
                public INFeInutilizacaoBO getBo() {
                          return bo;
                }
      
      
                public void setBo(INFeInutilizacaoBO bo) {
                          this.bo = bo;
                }
      
      

       

      arquillian.xml:

       

      <arquillian xmlns="http://jboss.org/schema/arquillian"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="
              http://jboss.org/schema/arquillian
              http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
      
      <container qualifier="teste-glassfish-e" default="true">
              <configuration>
                  <property name="resourcesXml">
                      src/test/resources/glassfish-resources.xml
                  </property>
                  <property name="installRoot">/home/gaspar/java/servidorJEE/glassfishEmbedded/glassfish</property>
              </configuration>
          </container>
      </arquillian>
      

       

       

      pom from project-ejb:

       

       

      <dependencyManagement>
                    <dependencies>
                              <dependency>
                            <groupId>org.jboss.arquillian</groupId>
                            <artifactId>arquillian-bom</artifactId>
                            <version>1.0.2.Final</version>
                            <scope>import</scope>
                            <type>pom</type>
                        </dependency>
                    </dependencies>
          </dependencyManagement>
      
                    <dependencies>
      <dependency>
                              <groupId>org.jboss.arquillian.junit</groupId>
                              <artifactId>arquillian-junit-container</artifactId>
                              <scope>test</scope>
                              <version>1.0.2.Final</version>
                          </dependency>
        
                          <dependency>
                                    <groupId>org.slf4j</groupId>
                                    <artifactId>slf4j-api</artifactId>
                                    <version>1.6.6</version>
                                    <scope>test</scope>
                          </dependency>
                  
        
                          <dependency>
                              <groupId>org.slf4j</groupId>
                              <artifactId>slf4j-simple</artifactId>
                              <version>1.6.6</version>
                              <scope>test</scope>
                          </dependency>
      
                          ...
      
                    </dependencies>
      <build>
              <plugins>
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                                  <artifactId>maven-ejb-plugin</artifactId>
                                  <version>2.3</version>
                                  <configuration>
                          <ejbVersion>3.0</ejbVersion>
                          <archive>
                              <manifest>
                                  <addClasspath>true</addClasspath>
                              </manifest>
                          </archive>
                      </configuration>
                  </plugin>
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                                              <artifactId>maven-eclipse-plugin</artifactId>
      
      
                                              <version>2.9</version>
                      <configuration>
                          <wtpversion>2.0</wtpversion>
      
      
                          <additionalConfig>
                              <file>
                                  <name>.settings/org.eclipse.wst.common.project.facet.core.xml</name>
                                  <content>
                                                                                   <![CDATA[<faceted-project>
                                                                                        <fixed facet="jst.java"/>
                                                                                        <fixed facet="jst.ejb"/>
                                                                                        <installed facet="jst.java" version="6.0"/>
                                                                                        <installed facet="jst.ejb" version="3.0"/>
                                                                                      </faceted-project>
                                                                                   ]]>
                                  </content>
                              </file>
                          </additionalConfig>
                      </configuration>
                  </plugin>
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-compiler-plugin</artifactId>
                      <version>2.3.2</version>
                      <configuration>
                          <source>1.6</source>
                          <target>1.6</target>
                      </configuration>
                  </plugin>
                  <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-surefire-plugin</artifactId>
                                                <version>2.12.2</version>
                                                <configuration>
                                                  <classpathDependencyExcludes>
                                                            <!-- exclude code absent api -->
                                                            <classpathDependencyExclude>javax:javaee-api</classpathDependencyExclude>
                                                            <classpathDependencyExclude>javax:javaee-web-api</classpathDependencyExclude>
                                                          </classpathDependencyExcludes>
                                              </configuration>
                                    </plugin>
              </plugins>
              <finalName>nfe-webservice-ejb</finalName>
          </build>
      
      <profile>
                              <id>teste-glassfish-e</id>
                              <dependencies>
                                        <dependency>
                          <groupId>org.jboss.arquillian.container</groupId>
                          <artifactId>arquillian-glassfish-embedded-3.1</artifactId>
                          <version>1.0.0.CR3</version>
                          <scope>test</scope>
                      </dependency>
                      <dependency>
                          <groupId>org.glassfish.main.extras</groupId>
                          <artifactId>glassfish-embedded-all</artifactId>
                          <version>3.1.2</version>
                          <scope>provided</scope>
                      </dependency>
                  </dependencies>
                              <build>
                                  <testResources>
                                      <testResource>
                                          <directory>src/test/resources</directory>
                                      </testResource>
                                      <testResource>
                                          <directory>src/test/resources-glassfish-remote</directory>
                                      </testResource>
                                  </testResources>
                              </build>
                          </profile>
      
      
      
      
      

       

       

      and during de test i got this error:

       

       

      [INFO] Scanning for projects...
      [INFO] ------------------------------------------------------------------------
      [INFO] Building nfe-webservice-ejb v4.0
      [INFO]    task-segment: [test]
      [INFO] ------------------------------------------------------------------------
      [INFO] [resources:resources {execution: default-resources}]
      [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
      [INFO] Copying 4 resources
      [INFO] snapshot gov.sefaz.nfe.webservice:nfe-webservice-base:4.0.1-SNAPSHOT: checking for updates from central
      [INFO] snapshot org.jwebservice:jwebservice-core:2.0.1-SNAPSHOT: checking for updates from central
      [INFO] snapshot gov.sefaz.nfe:nfe-core-base:2.0.1-SNAPSHOT: checking for updates from central
      [INFO] snapshot gov.sefaz.nfe:nfe-core:2.0.1-SNAPSHOT: checking for updates from central
      [INFO] snapshot gov.sefaz.nfe:sefaz-utils:2.0.1-SNAPSHOT: checking for updates from central
      [INFO] snapshot gov.sefaz.persistencia:sefaz-persistencia:2.0.1-SNAPSHOT: checking for updates from central
      [INFO] snapshot org.commons.xml:commons-xml:2.0.1-SNAPSHOT: checking for updates from central
      [INFO] snapshot org.jresources:jresources-core:2.0.1-SNAPSHOT: checking for updates from central
      [INFO] snapshot org.jresources:jresources:2.0.1-SNAPSHOT: checking for updates from central
      [INFO] snapshot org.jaxbean:jax-bean-core:2.0.1-SNAPSHOT: checking for updates from central
      [INFO] snapshot org.jaxbean:org.jaxbean:2.0.1-SNAPSHOT: checking for updates from central
      [INFO] [compiler:compile {execution: default-compile}]
      [INFO] Nothing to compile - all classes are up to date
      [INFO] [resources:testResources {execution: default-testResources}]
      [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
      [INFO] Copying 6 resources
      [INFO] skip non existing resourceDirectory /home/gaspar/projetos/trunk/nfe-webservice/nfe-webservice-ejb/src/test/resources-glassfish-remote
      [INFO] [compiler:testCompile {execution: default-testCompile}]
      [INFO] Nothing to compile - all classes are up to date
      [INFO] [surefire:test {execution: default-test}]
      [INFO] Surefire report directory: /home/gaspar/projetos/trunk/nfe-webservice/nfe-webservice-ejb/target/surefire-reports
      
      
      -------------------------------------------------------
       T E S T S
      -------------------------------------------------------
      Running gov.sefaz.nfe.webservice.InutilizacaoTest
      29/08/2012 09:58:30 com.sun.enterprise.v3.server.CommonClassLoaderServiceImpl findDerbyClient
      INFO: Cannot find javadb client jar file, derby jdbc driver will not be available by default.
      SLF4J: Class path contains multiple SLF4J bindings.
      SLF4J: Found binding in [jar:file:/home/gaspar/.m2/repository/org/slf4j/slf4j-simple/1.6.6/slf4j-simple-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: Found binding in [jar:file:/home/gaspar/.m2/repository/org/glassfish/main/extras/glassfish-embedded-all/3.1.2/glassfish-embedded-all-3.1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
      SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
      4 [main] INFO org.hibernate.validator.util.Version - Hibernate Validator 4.2.0.Final
      29/08/2012 09:58:31 com.sun.enterprise.v3.services.impl.GrizzlyService createNetworkProxy
      INFO: Network listener https-listener on port 0 disabled per domain.xml
      29/08/2012 09:58:31 com.sun.enterprise.v3.services.impl.GrizzlyProxy$2$1 onReady
      INFO: Grizzly Framework 1.9.46 started in: 95ms - bound to [0.0.0.0:8181]
      29/08/2012 09:58:31 com.sun.enterprise.v3.server.AppServerStartup run
      INFO: GlassFish Server Open Source Edition 3.1.2 (java_re-private) startup time : Embedded (1.357ms), startup services(1.015ms), total(2.372ms)
      29/08/2012 09:58:32 org.glassfish.admin.mbeanserver.JMXStartupService$JMXConnectorsStarterThread run
      INFO: JMX006: JMXStartupService had disabled JMXConnector system
      29/08/2012 09:58:35 org.jboss.arquillian.container.glassfish.embedded_3_1.GlassFishContainer executeCommand
      INFO: command add-resources result: PlainTextActionReporterSUCCESSDescription: add-resources AdminCommandnull
          JDBC connection pool nfeCoreOnLineDS created successfully.
          JDBC connection pool cteDS created successfully.
          JDBC connection pool nfeCoreOffLineDS created successfully.
          JDBC connection pool fronteirasXADS created successfully.
          JDBC connection pool nfeLogXADS created successfully.
          JDBC connection pool teste-jms-DS created successfully.
          JDBC connection pool fronteirasDS created successfully.
          JDBC resource jdbc/cteDS created successfully.
          JDBC resource jdbc/nfeCoreOnLineDS created successfully.
          JDBC resource jdbc/nfeCoreOffLineDS created successfully.
          JDBC resource jdbc/ctePersistence created successfully.
          JDBC resource jdbc/nfePersistence created successfully.
          JDBC resource jdbc/teste-jms-DS created successfully.
          JDBC resource jdbc/fronteirasDS created successfully.
          JDBC resource jdbc/nfeLogDS created successfully.
          JDBC resource jdbc/nfeLogFronteirasDS created successfully.
          Connector connection pool jms/nfeIntegracaoQueuePool created.
          Connector connection pool jms/nfeRecepcaoQueueFactory created.
          Connector connection pool jms/nfeDistribuidorPool created.
          Connector connection pool jms/testePool created.
          Connector resource jms/nfeRecepcaoRFBQueueResource created.
          Connector resource jms/ideBDFAZQueueResource created.
          Connector resource jms/nfeCompartilhamentoQueueFactory created.
          Administered object jms/nfeFronteirasVirtualQueue created.
          Administered object jms/nfeFronteirasQueue created.
          Administered object nfeIntegracaoQueue2 created.
          Administered object jms/nfeRecepcaoRFBQueue created.
          Administered object jms/ideBDFAZQueue created.
          Administered object jms/nfeFronteirasOutrasUFQueue created.
          Connector resource jms/nfeRecepcaoQueueFactory created.
          Administered object jms/nfeRecepcaoQueue2 created.
          Connector resource jms/nfeRecepcaoQueueResource created.
          Connector resource jms/nfeDistribuidorResource created.
          Administered object jms/nfeDistribuidorQueue created.
          Connector resource jms/nfeFronteirasResource created.
          Connector resource jms/testeResource created.
          Administered object jms/testeQueue created.
      
      
      29/08/2012 09:58:50 org.glassfish.apf.impl.DefaultErrorHandler warning
      AVISO: Incorrect @Resource annotation class definition - missing lookup attribute
       symbol: FIELD
       location: private javax.jms.ConnectionFactory gov.sefaz.nfe.webservice.negocio.impl.NFeRecepcaoLoteAS.nfeRecepcaoQueueFactory
      
      
      
      
      29/08/2012 09:58:50 org.glassfish.apf.impl.DefaultErrorHandler warning
      AVISO: Incorrect @Resource annotation class definition - missing lookup attribute
       symbol: FIELD
       location: private javax.jms.Queue gov.sefaz.nfe.webservice.negocio.impl.NFeRecepcaoLoteAS.nfeRecepcaoQueue
      
      
      
      
      29/08/2012 09:58:51 org.glassfish.apf.impl.DefaultErrorHandler warning
      AVISO: Incorrect @Resource annotation class definition - missing lookup attribute
       symbol: FIELD
       location: private javax.jms.Queue gov.sefaz.nfe.core.modelo.impl.EnvioDistribuidorBO.nfeDistribuidorQueue
      
      
      
      
      29/08/2012 09:58:51 org.glassfish.apf.impl.DefaultErrorHandler warning
      AVISO: Incorrect @Resource annotation class definition - missing lookup attribute
       symbol: FIELD
       location: private javax.jms.ConnectionFactory gov.sefaz.nfe.core.modelo.impl.EnvioDistribuidorBO.nfeDistribuidorPool
      
      
      
      
      29/08/2012 09:58:51 com.sun.ejb.containers.EjbContainerUtilImpl createThreadPoolExecutor
      INFO: Created EjbThreadPoolExecutor with thread-core-pool-size 16 thread-max-pool-size 32 thread-keep-alive-seconds 60 thread-queue-capacity 2147483647 allow-core-thread-timeout false 
      29/08/2012 09:58:51 com.sun.enterprise.security.SecurityLifecycle <init>
      INFO: SEC1002: Security Manager is OFF.
      29/08/2012 09:58:51 com.sun.enterprise.security.SecurityLifecycle onInitialization
      INFO: SEC1010: Entering Security Startup Service
      29/08/2012 09:58:51 com.sun.enterprise.security.PolicyLoader loadPolicy
      INFO: SEC1143: Loading policy provider com.sun.enterprise.security.jacc.provider.SimplePolicyProvider.
      29/08/2012 09:58:52 com.sun.enterprise.security.auth.realm.Realm doInstantiate
      INFO: SEC1115: Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
      29/08/2012 09:58:52 com.sun.enterprise.security.auth.realm.Realm doInstantiate
      INFO: SEC1115: Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
      29/08/2012 09:58:52 com.sun.enterprise.security.auth.realm.Realm doInstantiate
      INFO: SEC1115: Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created.
      29/08/2012 09:58:52 com.sun.enterprise.security.SecurityLifecycle onInitialization
      INFO: SEC1011: Security Service(s) Started Successfully
      22393 [main] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.2.0.Final
      22402 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.6.10.Final
      22407 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
      22412 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
      22418 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
      22504 [main] INFO org.hibernate.ejb.Version - Hibernate EntityManager 3.6.10.Final
      29/08/2012 09:58:53 org.glassfish.api.ActionReport failure
      GRAVE: Exception while preparing the app
      29/08/2012 09:58:53 com.sun.enterprise.v3.server.ApplicationLifecycle deploy
      GRAVE: tried to access method org.hibernate.engine.CascadeStyle.<init>()V from class org.hibernate.engine.EJB3CascadeStyle$1
      java.lang.IllegalAccessError: tried to access method org.hibernate.engine.CascadeStyle.<init>()V from class org.hibernate.engine.EJB3CascadeStyle$1
                at org.hibernate.engine.EJB3CascadeStyle$1.<init>(EJB3CascadeStyle.java:44)
                at org.hibernate.engine.EJB3CascadeStyle.<clinit>(EJB3CascadeStyle.java:39)
                at org.hibernate.ejb.event.EJB3PersistEventListener.<clinit>(EJB3PersistEventListener.java:39)
                at org.hibernate.ejb.EventListenerConfigurator.<init>(EventListenerConfigurator.java:101)
                at org.hibernate.ejb.Ejb3Configuration.<init>(Ejb3Configuration.java:163)
                at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72)
                at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:206)
                at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:120)
                at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:224)
                at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:495)
                at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:233)
                at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168)
                at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:871)
                at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:290)
                at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:86)
                at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:141)
                at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:138)
                at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:215)
                at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:224)
                at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:250)
                at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:138)
                at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:871)
                at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:410)
                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 com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:105)
                at org.jboss.arquillian.container.glassfish.embedded_3_1.GlassFishContainer.deploy(GlassFishContainer.java:202)
                at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:161)
                at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:128)
                at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:271)
                at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:127)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
                at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
                at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:78)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
                at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:57)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
                at org.jboss.arquillian.container.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:50)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
                at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
                at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:95)
                at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:80)
                at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachDeployment(ContainerDeployController.java:263)
                at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:239)
                at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:79)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
                at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
                at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
                at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:101)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
                at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
                at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
                at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
                at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)
                at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:182)
                at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)
                at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)
                at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)
                at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
                at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)
                at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
                at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
                at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
                at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
                at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
                at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:113)
                at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
      classLoader = WebappClassLoader (delegate=true; repositories=WEB-INF/classes/)
      SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@2cc5c76c
      classLoader = WebappClassLoader (delegate=true; repositories=WEB-INF/classes/)
      SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@2cc5c76c
      29/08/2012 09:58:53 org.glassfish.deployment.admin.DeployCommand execute
      GRAVE: Exception while preparing the app : tried to access method org.hibernate.engine.CascadeStyle.<init>()V from class org.hibernate.engine.EJB3CascadeStyle$1
      29/08/2012 09:58:53 com.sun.enterprise.web.WebContainer createHttpListener
      INFO: WEB0169: Created HTTP listener [http-listener] on host/port [0.0.0.0:8181]
      29/08/2012 09:58:53 com.sun.enterprise.web.WebContainer createHosts
      INFO: WEB0171: Created virtual server [server]
      29/08/2012 09:58:53 com.sun.enterprise.web.WebContainer loadSystemDefaultWebModules
      INFO: WEB0172: Virtual server [server] loaded default web module []
      29/08/2012 09:58:54 com.sun.enterprise.web.VirtualServer$1 log
      INFO: PWC1412: WebModule[null] ServletContext.log():No Spring WebApplicationInitializer types detected on classpath
      PlainTextActionReporterFAILUREApplication test is not deployed on this target [server]Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 26.554 sec <<< FAILURE!
      29/08/2012 09:58:54 com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl sendStopToResourceAdapter
      INFO: RAR7094: __ds_jdbc_ra shutdown successful.
      29/08/2012 09:58:54 org.glassfish.admin.mbeanserver.JMXStartupService shutdown
      INFO: JMX001: JMXStartupService and JMXConnectors have been shut down.
      29/08/2012 09:58:54 com.sun.enterprise.v3.server.AppServerStartup stop
      INFO: Shutdown procedure finished
      29/08/2012 09:58:54 AppServerStartup run
      INFO: [Thread[GlassFish Kernel Main Thread,5,main]] exiting
      
      
      Results :
      
      
      Tests in error: 
        verificarRegraInutilizacaoI08(gov.sefaz.nfe.webservice.InutilizacaoTest): ArquillianServletRunner not found. Could not determine ContextRoot from ProtocolMetadata, please contact DeployableContainer developer.
      
      
      Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
      
      
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] There are test failures.
      
      
      Please refer to /home/gaspar/projetos/trunk/nfe-webservice/nfe-webservice-ejb/target/surefire-reports for the individual test results.
      [INFO] ------------------------------------------------------------------------
      [INFO] For more information, run Maven with the -e switch
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 32 seconds
      [INFO] Finished at: Wed Aug 29 09:58:54 AMT 2012
      [INFO] Final Memory: 27M/174M
      [INFO] ------------------------------------------------------------------------
      
      

       

      Any ideas?

        • 1. Re: Arquillian + Multi Module Maven Project + Glassfish Embedded
          Gaspar Kuhnen Newbie

          Adding

           

          <dependency>

                              <groupId>org.hibernate</groupId>

                              <artifactId>hibernate-core</artifactId>

                              <version>3.6.10.Final</version>

                          </dependency>

           

                          <dependency>

                              <groupId>org.hibernate</groupId>

                              <artifactId>hibernate-annotations</artifactId>

                              <version>3.3.0.ga</version>

                          </dependency>

           

                          <dependency>

                              <groupId>org.hibernate</groupId>

                              <artifactId>hibernate-entitymanager</artifactId>

                              <version>3.6.10.Final</version>

                          </dependency>

           

           

          to profile solve the problem, but the EJB was not injected. I got a NullPointerException on ejb reference.

          HELP!!!!