Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2570

WELD-ENV-000033 error using Tomcat 8+ in Eclipse

    XMLWordPrintable

Details

    Description

      I've an standard web project built in Eclipse IDE. My project makes uses of weld and my beans.xml is placed at the following location: build/classes/META-INF/beans.xml

      When I try to start Tomcat, the following exception is thrown:java.lang.IllegalStateException: WELD-ENV-000033: Invalid bean archive scanning result - found multiple results with the same reference: /home/openbravo/src/weld/pi-weld-upgrade/build/classes (Attached you can find the complete stack trace)

      The problem is caused because the WebAppBeanArchiveScanner is finding my beans.xml file twice:

      1) When invoking the scan method of the parent DefaultBeanArchiveScanner class when looking for the META-INF/beans.xml

      2) By the WebAppBeanArchiveScanner itself when looking for the /WEB-INF/classes/META-INF/beans.xml. See here.

      This is causing that Tomcat can not be started using Eclipse. This problem can be reproduced using Tomcat 8, 8.5 and 9.

      Note 1: with this same project structure and location of the beans.xml file, and using and older version of weld (I've tried with 1.1.24) Tomcat 8, 8.5 and 9 start without trouble.

      Note 2: this problem usually does not happen when deploying the applicaton in Tomcat without using Eclipse. In this case the beans.xml file is placed at WEB-INF/classes/META-INF/beans.xml. As this path contains the keyword "WEB-INF" the result found by the DefaultBeanArchiveScanner is discarded here.

      Attachments

        Activity

          People

            Unassigned Unassigned
            caristu Carlos Aristu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: