Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-1429

Spock Appender is missing org.objectweb.asm package

XMLWordPrintable

      ASM is used in Groovy, which leads to CNFE when run in server.

      @Produces
          @PersistenceContext(unitName = "pushee-default", type = PersistenceContextType.EXTENDED)
          @Default
          EntityManager entityManager;
      
          @Inject
          PushApplicationDao pushAppDao;
      
          def "find all registered apps"() {
              when: "Check for all registered apps"
              List<PushApplication> apps = pushAppDao.findAll();
      
              then: "DAO was injected"
              pushAppDao!=null
              and: "No applications were defined"
              apps.size()==0
          }
      

      leads to:

      17:19:55,691 INFO  [org.jboss.web] (MSC service thread 1-1) JBAS018210: Registering web context: /test
      17:19:55,742 INFO  [org.jboss.as.server] (management-handler-thread - 2) JBAS018559: Deployed "test.war"
      17:19:56,485 WARN  [org.jboss.modules] (http--127.0.0.1-8080-1) Failed to define class org.codehaus.groovy.ast.FieldNode in Module "deployment.test.war:main" from Service Module Loader: java.lang.LinkageError: Failed to link org/codehaus/groovy/ast/FieldNode (Module "deployment.test.war:main" from Service Module Loader)
              at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)
              at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)
              at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)
              at org.jboss.modules.Module.loadModuleClass(Module.java:517)
              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)
              at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
              at java.lang.Class.getDeclaredConstructors0(Native Method) [rt.jar:1.7.0_21]
              at java.lang.Class.privateGetDeclaredConstructors(Class.java:2413) [rt.jar:1.7.0_21]
              at java.lang.Class.getConstructor0(Class.java:2723) [rt.jar:1.7.0_21]
              at java.lang.Class.newInstance0(Class.java:345) [rt.jar:1.7.0_21]
              at java.lang.Class.newInstance(Class.java:327) [rt.jar:1.7.0_21]
              at org.codehaus.groovy.vmplugin.VMPluginFactory.createPlugin(VMPluginFactory.java:56) [arquillian-spock.jar:]
              at org.codehaus.groovy.vmplugin.VMPluginFactory.<clinit>(VMPluginFactory.java:41) [arquillian-spock.jar:]
              at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:99) [arquillian-spock.jar:]
              at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:71) [arquillian-spock.jar:]
              at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:33) [arquillian-spock.jar:]
              at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:162) [arquillian-spock.jar:]
              at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:192) [arquillian-spock.jar:]
              at org.jboss.aerogear.connectivity.jpa.dao.impl.PushDaoSpecification.$getStaticMetaClass(PushDaoSpecification.groovy) [3728ce10-7709-4805-ac00-a0983db929fd.jar:]
              at org.jboss.aerogear.connectivity.jpa.dao.impl.PushDaoSpecification.<init>(PushDaoSpecification.groovy) [3728ce10-7709-4805-ac00-a0983db929fd.jar:]
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_21]
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_21]
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_21]
              at java.lang.reflect.Constructor.newInstance(Constructor.java:525) [rt.jar:1.7.0_21]
              at java.lang.Class.newInstance0(Class.java:374) [rt.jar:1.7.0_21]
              at java.lang.Class.newInstance(Class.java:327) [rt.jar:1.7.0_21]
              at org.spockframework.runtime.BaseSpecRunner.createSpecInstance(BaseSpecRunner.java:121) [arquillian-spock.jar:]
              at org.spockframework.runtime.BaseSpecRunner.run(BaseSpecRunner.java:80) [arquillian-spock.jar:]
              at org.spockframework.runtime.Sputnik.run(Sputnik.java:63) [arquillian-spock.jar:]
              at org.jboss.arquillian.spock.container.SpockTestRunner.runTest(SpockTestRunner.java:81) [arquillian-spock.jar:]
              at org.jboss.arquillian.spock.container.SpockTestRunner.execute(SpockTestRunner.java:61) [arquillian-spock.jar:]
              at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.executeTest(ServletTestRunner.java:160) [arquillian-protocol.jar:]
              at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.execute(ServletTestRunner.java:126) [arquillian-protocol.jar:]
              at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.doGet(ServletTestRunner.java:90) [arquillian-protocol.jar:]
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
              at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
              at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
              at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
              at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]
      Caused by: java.lang.NoClassDefFoundError: org/objectweb/asm/Opcodes
              at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_21]
              at java.lang.ClassLoader.defineClass(ClassLoader.java:791) [rt.jar:1.7.0_21]
              at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) [rt.jar:1.7.0_21]
              at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)
              at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)
              ... 55 more
      Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.Opcodes from [Module "deployment.test.war:main" from Service Module Loader]
              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
              at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
              ... 60 more
      
      

      The problematic part is that asm suffers the same problem as Groovy pre 2.1.4 version (http://jira.codehaus.org/browse/GROOVY-6158)

              kpiwko Karel Piwko
              kpiwko Karel Piwko
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: