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

NoClassDefFoundError org/jboss/weld/proxy/WeldConstruct exception when accessing beans with arquillian Tomcat 10 managed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • None
    • None
    • Tomcat Containers
    • None
    • Hide

      I forked the arquillian tomcat container repo and created a minimal reproducible example on a branch: https://github.com/tasso94/arquillian-container-tomcat/tree/tomcat-10-test

      Clone the repo, checkout branch tomcat-10-test and run mvn clean install.

      The test org.jboss.arquillian.container.tomcat.managed.bean.AccessBeanIT should fail.

      Show
      I forked the arquillian tomcat container repo and created a minimal reproducible example on a branch: https://github.com/tasso94/arquillian-container-tomcat/tree/tomcat-10-test Clone the repo, checkout branch tomcat-10-test and run mvn clean install . The test org.jboss.arquillian.container.tomcat.managed.bean.AccessBeanIT should fail.

      Environment

      • arquillian-tomcat-managed-10:1.2.1.Final
      • arquillian-core 1.8.0.Final
      • Tomcat 10.1.24
      • Weld 5.1.2.Final
      • Camunda 7.22.0-alpha1

      This problem didn't occur with arquillian-tomcat-managed-8:1.1.0.Final, arquillian-core 1.7.0, and Tomcat 9.

      Please find attached the WAR and the full test output.

      When I remove org.jboss.weld.servlet:weld-servlet-shaded from the WAR's lib folder and drop it into Tomcats global server library folder, the test succeeds.

      Observed behavior

      I got the following exception when accessing beans with arquillian Tomcat 10 managed:

      Caused by: org.jboss.weld.exceptions.WeldException: WELD-001524: Unable to load proxy class for bean Producer Method [ProcessEngine] with qualifiers [@Default @Any @Named] declared as [[BackedAnnotatedMethod] @Produces @Named @ApplicationScoped public org.camunda.bpm.engine.cdi.impl.ProcessEngineServicesProducer.processEngine()] with class class java.lang.Object
      	at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:421)
      	at org.jboss.weld.bean.proxy.ProxyFactory.run(ProxyFactory.java:372)
      	at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:364)
      	at org.jboss.weld.bean.proxy.ClientProxyFactory.create(ClientProxyFactory.java:83)
      ...
      Caused by: java.lang.NoClassDefFoundError: org/jboss/weld/proxy/WeldConstruct
      	at java.base/java.lang.ClassLoader.defineClass0(Native Method)
      	at java.base/java.lang.System$2.defineClass(System.java:2307)
      	at java.base/java.lang.invoke.MethodHandles$Lookup$ClassDefiner.defineClass(MethodHandles.java:2439)
      	at java.base/java.lang.invoke.MethodHandles$Lookup$ClassDefiner.defineClass(MethodHandles.java:2416)
      	at java.base/java.lang.invoke.MethodHandles$Lookup.defineClass(MethodHandles.java:1843)
      	at org.jboss.weld.bean.proxy.util.WeldDefaultProxyServices.defineWithMethodLookup(WeldDefaultProxyServices.java:153)
      	at org.jboss.weld.bean.proxy.util.WeldDefaultProxyServices.defineClass(WeldDefaultProxyServices.java:62)
      	at org.jboss.weld.bean.proxy.ProxyFactory.toClass(ProxyFactory.java:968)
      	at org.jboss.weld.bean.proxy.ProxyFactory.createProxyClass(ProxyFactory.java:509)
      	at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:413)
      	... 281 more
      Caused by: java.lang.ClassNotFoundException: org.jboss.weld.proxy.WeldConstruct
      	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
      	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
      	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
      	... 291 more
      

      Expected behavior

      The test succeeds.

        1. org.jboss.arquillian.container.tomcat.managed.bean.AccessBeanIT.txt
          28 kB
          Tassilo Weidner
        2. test.war
          4.72 MB
          Tassilo Weidner

              rhn-engineering-rhusar Radoslav Husar
              tassmunda Tassilo Weidner (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: