1 Reply Latest reply on May 11, 2011 5:33 PM by Anthony Brock

    Issues testing with arquillian-weld-ee-embedded-1.1 v1.0.0.Alpha5 and weld v1.1.0.Final

    Anthony Brock Newbie

      Hello,

       

      We have been using arquillian-weld-ee-embedded-1.1 version 1.0.0.Alpha5 to run unit tests on code using Weld version 1.1.0.Beta2.  We recently tried upgrading to Weld version 1.1.0.Final.  Our app builds and deploys (to tomcat) fine now with the new version, but our Arquillian tests break giving the following error:

       

      org.jboss.weld.exceptions.WeldException: javassist.util.proxy.ProxyObject.getHandler()
                at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:287)
                at org.jboss.weld.bean.AbstractClassBean.createEnhancedSubclass(AbstractClassBean.java:673)
                at org.jboss.weld.bean.AbstractClassBean.initEnhancedSubclass(AbstractClassBean.java:659)
                at org.jboss.weld.bean.AbstractClassBean.initializeAfterBeanDiscovery(AbstractClassBean.java:354)
                at org.jboss.weld.bean.ManagedBean.initializeAfterBeanDiscovery(ManagedBean.java:420)
                at org.jboss.weld.bootstrap.BeanDeployment.doAfterBeanDiscovery(BeanDeployment.java:232)
                at org.jboss.weld.bootstrap.BeanDeployment.afterBeanDiscovery(BeanDeployment.java:221)
                at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:369)
                at org.jboss.arquillian.container.weld.ee.embedded_1_1.mock.TestContainer.startContainer(TestContainer.java:257)
                at org.jboss.arquillian.container.weld.ee.embedded_1_1.WeldEEMockContainer.deploy(WeldEEMockContainer.java:92)
                at org.jboss.arquillian.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:141)
                at org.jboss.arquillian.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:115)
                at org.jboss.arquillian.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:226)
                at org.jboss.arquillian.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:114)
                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.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
                at org.jboss.arquillian.impl.core.EventContextImpl.invokeObservers(EventContextImpl.java:98)
                at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:80)
                at org.jboss.arquillian.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:100)
                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.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
                at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:87)
                at org.jboss.arquillian.impl.client.ContainerDeploymentContextHandler.createContainerContext(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.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
                at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:87)
                at org.jboss.arquillian.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:51)
                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.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
                at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:87)
                at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:126)
                at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:106)
                at org.jboss.arquillian.impl.core.EventImpl.fire(EventImpl.java:67)
                at org.jboss.arquillian.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:86)
                at org.jboss.arquillian.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:79)
                at org.jboss.arquillian.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:217)
                at org.jboss.arquillian.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.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.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
                at org.jboss.arquillian.impl.core.EventContextImpl.invokeObservers(EventContextImpl.java:98)
                at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:80)
                at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:126)
                at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:106)
                at org.jboss.arquillian.impl.core.EventImpl.fire(EventImpl.java:67)
                at org.jboss.arquillian.impl.client.ContainerEventController.execute(ContainerEventController.java:69)
                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.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
                at org.jboss.arquillian.impl.core.EventContextImpl.invokeObservers(EventContextImpl.java:98)
                at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:80)
                at org.jboss.arquillian.impl.TestContextHandler.createClassContext(TestContextHandler.java:68)
                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.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
                at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:87)
                at org.jboss.arquillian.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:54)
                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.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)
                at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:87)
                at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:126)
                at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:106)
                at org.jboss.arquillian.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:70)
                at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:170)
                at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:303)
                at org.jboss.arquillian.junit.Arquillian.access$300(Arquillian.java:45)
                at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:187)
                at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
                at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:127)
                at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59)
                at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:120)
                at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:103)
                at org.apache.maven.surefire.Surefire.run(Surefire.java:169)
                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.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
                at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
      Caused by: org.jboss.weld.exceptions.WeldException: javassist.util.proxy.ProxyObject.getHandler()
                at org.jboss.weld.bean.proxy.InterceptedSubclassFactory.addSpecialMethods(InterceptedSubclassFactory.java:370)
                at org.jboss.weld.bean.proxy.InterceptedSubclassFactory.addMethods(InterceptedSubclassFactory.java:104)
                at org.jboss.weld.bean.proxy.ProxyFactory.createProxyClass(ProxyFactory.java:387)
                at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:283)
                ... 99 more
      Caused by: java.lang.NoSuchMethodException: javassist.util.proxy.ProxyObject.getHandler()
                at java.lang.Class.getDeclaredMethod(Class.java:1937)
                at org.jboss.weld.bean.proxy.InterceptedSubclassFactory.addSpecialMethods(InterceptedSubclassFactory.java:364)
                ... 102 more
      
      

       

      When we first upgraded to the new version of Weld, we were getting this same error when trying to deploy the app -- adding a dependency for javassist to our pom fixed that.  I have tried for the past couple of days to work some magic in the pom to try get around this error, but we're still seeing it when trying to run tests with Arquillian. Here is the current state of the pom:

       

      <properties>
                <netbeans.hint.deploy.server>Tomcat60</netbeans.hint.deploy.server>
                <weld.version>1.1.0.Final</weld.version>
                <arquillian.version>1.0.0.Alpha5</arquillian.version>
                <shrinkwrap.version>1.0.0-alpha-12</shrinkwrap.version>
                <javax.faces.version>2.1.0-b04</javax.faces.version>
                <org.richfaces.bom.version>4.0.0.Final</org.richfaces.bom.version>
      </properties>
      
      <dependencies>
                  <dependency>
                          <groupId>javax.servlet</groupId>
                          <artifactId>servlet-api</artifactId>
                          <version>2.5</version>
                          <scope>provided</scope>
                </dependency>
                  <dependency>
                          <groupId>javax.mail</groupId>
                          <artifactId>mail</artifactId>
                          <version>1.4.4</version>
                          <scope>provided</scope>
                </dependency>
                  <dependency>
                          <groupId>javax.servlet.jsp</groupId>
                          <artifactId>jsp-api</artifactId>
                          <version>2.2</version>
                          <scope>provided</scope>
                </dependency>
                <dependency>
                          <groupId>javax.el</groupId>
                          <artifactId>el-api</artifactId>
                          <version>2.2</version>
                          <scope>provided</scope>
                </dependency>
                <dependency>
                          <groupId>com.sun.faces</groupId>
                          <artifactId>jsf-api</artifactId>
                          <version>${javax.faces.version}</version>
                </dependency>
                <dependency>
                          <groupId>com.sun.faces</groupId>
                          <artifactId>jsf-impl</artifactId>
                          <version>${javax.faces.version}</version>
                </dependency>
                <dependency>
                          <groupId>javax.resource</groupId>
                          <artifactId>connector-api</artifactId>
                          <version>1.5</version>
                </dependency>
                <dependency>
                          <groupId>org.apache.tomcat</groupId>
                          <artifactId>catalina</artifactId>
                          <version>6.0.29</version>
                          <scope>provided</scope>
                </dependency>
                <dependency>
                          <groupId>org.richfaces.ui</groupId>
                          <artifactId>richfaces-components-ui</artifactId>
                          <version>${org.richfaces.bom.version}</version>
                </dependency>
                <dependency>
                          <groupId>org.richfaces.core</groupId>
                          <artifactId>richfaces-core-impl</artifactId>
                          <version>${org.richfaces.bom.version}</version>
                </dependency>
                <dependency>
                          <groupId>org.hibernate</groupId>
                          <artifactId>hibernate-core</artifactId>
                          <version>3.5.2-Final</version>
                </dependency>
                <dependency>
                          <groupId>org.hibernate</groupId>
                          <artifactId>hibernate-annotations</artifactId>
                          <version>3.5.2-Final</version>
                </dependency>
                <dependency>
                          <groupId>org.hibernate</groupId>
                          <artifactId>hibernate-entitymanager</artifactId>
                          <version>3.5.2-Final</version>
                </dependency>
                <dependency>
                          <groupId>org.hibernate</groupId>
                          <artifactId>hibernate-validator</artifactId>
                          <version>4.0.2.GA</version>
                </dependency>
                <dependency>
                          <groupId>javax.validation</groupId>
                          <artifactId>validation-api</artifactId>
                          <version>1.0.0.GA</version>
                </dependency>
                <dependency>
                          <groupId>org.hibernate.javax.persistence</groupId>
                          <artifactId>hibernate-jpa-2.0-api</artifactId>
                          <version>1.0.0.Final</version>
                </dependency>
                <dependency>
                          <groupId>org.ow2.jotm</groupId>
                          <artifactId>jotm-core</artifactId>
                          <version>2.2.1</version>
                </dependency>
                <dependency>
                          <groupId>javax.enterprise</groupId>
                          <artifactId>cdi-api</artifactId>
                          <version>1.0-SP4</version>
                </dependency>
                <dependency>
                          <groupId>org.jboss.weld.servlet</groupId>
                          <artifactId>weld-servlet</artifactId>
                          <version>${weld.version}</version>
                </dependency>
                <dependency>
                          <groupId>org.javassist</groupId>
                          <artifactId>javassist</artifactId>
                          <version>3.14.0-GA</version>
                </dependency>
                <dependency>
                          <groupId>com.google.guava</groupId>
                          <artifactId>guava</artifactId>
                          <version>r06</version>
                </dependency>
                <dependency>
                          <groupId>org.hsqldb</groupId>
                          <artifactId>hsqldb</artifactId>
                          <version>2.0.0</version>
                </dependency>
                <dependency>
                          <groupId>com.ibm.db2</groupId>
                          <artifactId>db2jcc4</artifactId>
                          <version>1.0</version>
                </dependency>
                <dependency>
                          <groupId>commons-dbcp</groupId>
                          <artifactId>commons-dbcp</artifactId>
                          <version>1.4</version>
                </dependency>
                <dependency>
                          <groupId>commons-lang</groupId>
                          <artifactId>commons-lang</artifactId>
                          <version>2.5</version>
                </dependency>
                <dependency>
                          <groupId>net.sf.opencsv</groupId>
                          <artifactId>opencsv</artifactId>
                          <version>2.1</version>
                </dependency>
                <dependency>
                          <groupId>org.slf4j</groupId>
                          <artifactId>slf4j-api</artifactId>
                          <version>1.5.11</version>
                </dependency>
                <dependency>
                          <groupId>org.quartz-scheduler</groupId>
                          <artifactId>quartz</artifactId>
                          <version>1.8.4</version>
                </dependency>
                <dependency>
                          <groupId>joda-time</groupId>
                          <artifactId>joda-time</artifactId>
                          <version>1.6</version>
                </dependency>
                <dependency>
                          <groupId>junit</groupId>
                          <artifactId>junit</artifactId>
                          <version>4.8.2</version>
                          <scope>test</scope>
                </dependency>
                <dependency>
                          <groupId>org.jboss.shrinkwrap</groupId>
                          <artifactId>shrinkwrap-api</artifactId>
                          <version>${shrinkwrap.version}</version>
                </dependency>
                <dependency>
                          <groupId>org.jboss.shrinkwrap</groupId>
                          <artifactId>shrinkwrap-impl-base</artifactId>
                          <version>${shrinkwrap.version}</version>
                          <scope>test</scope>
                </dependency>
                <dependency>
                          <groupId>org.jboss.arquillian.container</groupId>
                          <artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
                          <version>${arquillian.version}</version>
                          <scope>test</scope>
                </dependency>
                <dependency>
                          <groupId>org.jboss.arquillian</groupId>
                          <artifactId>arquillian-junit</artifactId>
                          <version>${arquillian.version}</version>
                          <scope>test</scope>
                </dependency>
                <dependency>
                          <groupId>org.jboss.ejb3</groupId>
                          <artifactId>jboss-ejb3-api</artifactId>
                          <version>3.1.0</version>
                          <scope>test</scope>
                </dependency>
      </dependencies>
      
      
      <build>
                <plugins>
                          <plugin>
                                    <groupId>org.apache.maven.plugins</groupId>
                                    <artifactId>maven-compiler-plugin</artifactId>
                                    <version>2.0.2</version>
                                    <configuration>
                                              <fork>true</fork>
                                              <source>1.6</source>
                                              <target>1.6</target>
                                              <debug>true</debug>
                                    </configuration>
                          </plugin>
                          <plugin>
                                    <groupId>org.apache.maven.plugins</groupId>
                                    <artifactId>maven-surefire-plugin</artifactId>
                                    <version>2.6</version>
                                    <configuration>
                                              <systemPropertyVariables>
                                                        <ENVIRONMENT>test</ENVIRONMENT>
                                              </systemPropertyVariables>
                                    </configuration>
                          </plugin>
                </plugins>
      
                <finalName>SimpleWebMonitor</finalName>
      
      </build>
      
      

       

      The documentation shows arquillian 1.0.0.Alpha5 using Weld 1.1.0.Final, so it seems like it should just work.  Is there something I'm missing?

       

      Any help you can offer is greatly appreciated.

       

      Thanks.

       

      - Tony