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

Embedded Tomcat 8.5 not picked up as Tomcat environment

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Can't Do
    • Icon: Major Major
    • None
    • 2.3.5.Final
    • None

      Assuming the following dependencies in a project:

       <dependency>
                  <groupId>org.jboss.weld.se</groupId>
                  <artifactId>weld-se-core</artifactId>
                  <version>2.3.5.Final</version>
              </dependency>
              <dependency>
                  <groupId>org.jboss.weld.servlet</groupId>
                  <artifactId>weld-servlet</artifactId>
                  <version>2.3.5.Final</version>
              </dependency>
              <dependency>
                  <groupId>org.apache.tomcat.embed</groupId>
                  <artifactId>tomcat-embed-core</artifactId>
                  <version>8.5.3</version>
              </dependency>
              <dependency>
                  <groupId>org.apache.tomcat.embed</groupId>
                  <artifactId>tomcat-embed-el</artifactId>
                  <version>8.5.3</version>
              </dependency>
              <dependency>
                  <groupId>org.apache.tomcat</groupId>
                  <artifactId>tomcat-juli</artifactId>
                  <version>8.5.3</version>
              </dependency>
              <dependency>
                  <groupId>org.apache.tomcat.embed</groupId>
                  <artifactId>tomcat-embed-websocket</artifactId>
                  <version>8.5.3</version>
              </dependency>
      

      And the following bootstrap code:

      new Weld().disableDiscovery().addBeanClass(TomcatWebServer.class).initialize();
              tomcat = new Tomcat();
              tomcat.setPort(8080);
              File base = new File("./target");
              Context ctx = tomcat.addContext("/",base.getAbsolutePath());
              try {
                  tomcat.start();
                  Runnable r = () -> tomcat.getServer().await();
                  new Thread(r).start();
              } catch (LifecycleException e) {
                  e.printStackTrace();
              }
      

      You'll see that Weld is not enabled. I checked, the class being checked is present. I am using an uber jar deployment.

              Unassigned Unassigned
              meetoblivion_jira John Ament (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: