Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-9970

WildFly 12.0.0.Final + Java 9 ignores @WebServlet

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 12.0.0.Final
    • EE
    • None
    • Hide

      1. Download simple project from github
      ```
      git clone https://github.com/anatoly-spb/simple-annotated-servlet
      ```
      2. Enter into project directory
      ```
      cd simple-annotated-servlet
      ```
      3. Build project with Java 9:
      ```
      set JAVA_HOME=%JAVA9_HOME%
      set PATH=%JAVA_HOME%\bin;%PATH%
      mvn clean install
      copy /Y target*.war F:\wildfly-12.0.0.Final\standalone\deployments\
      ```
      4. Check that servlet is not initialized, because there is not `initinig` message from our servlet in the log:
      ```
      13:15:07,995 INFO [org.jboss.as.repository] (DeploymentScanner-threads - 1) WFLYDR0001: Content added at location F:\tools\wildfly-12.0.0.Final\standalone\data\content\ca\7aa2a316c34941ab2dc1230d64523b4eba4c49\content
      13:15:08,004 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool – 19) WFLYUT0022: Unregistered web context: '/myservlet-1.0-SNAPSHOT' from server 'default-server'
      13:15:08,136 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0028: Stopped deployment myservlet-1.0-SNAPSHOT.war (runtime-name: myservlet-1.0-SNAPSHOT.war) in 135ms
      13:15:08,138 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0027: Starting deployment of "myservlet-1.0-SNAPSHOT.war" (runtime-name: "myservlet-1.0-SNAPSHOT.war")
      13:15:08,316 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool – 72) WFLYUT0021: Registered web context: '/myservlet-1.0-SNAPSHOT' for server 'default-server'
      13:15:08,402 INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0016: Replaced deployment "myservlet-1.0-SNAPSHOT.war" with deployment "myservlet-1.0-SNAPSHOT.war"
      13:15:08,405 INFO [org.jboss.as.repository] (DeploymentScanner-threads - 1) WFLYDR0002: Content removed from location F:\tools\wildfly-12.0.0.Final\standalone\data\content\e5\61ef7d0c4b695ba0e71aeb1e5ab2a3e69f58a4\content
      ```
      5. Build project with Java 8:
      ```
      set JAVA_HOME=%JAVA8_HOME%
      set PATH=%JAVA_HOME%\bin;%PATH%
      mvn clean install
      copy /Y target*.war F:\wildfly-12.0.0.Final\standalone\deployments\
      ```
      6. Check that our servlet is initialized because there is `[my.ScriptServlet] (ServerService Thread Pool – 74) initinig` in the log:
      ```
      13:17:08,512 INFO [org.jboss.as.repository] (DeploymentScanner-threads - 1) WFLYDR0001: Content added at location F:\tools\wildfly-12.0.0.Final\standalone\data\content\d9\ba6f286c582b522f90ea51b956b0b27f899623\content
      13:17:08,526 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool – 73) WFLYUT0022: Unregistered web context: '/myservlet-1.0-SNAPSHOT' from server 'default-server'
      13:17:08,563 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) WFLYSRV0028: Stopped deployment myservlet-1.0-SNAPSHOT.war (runtime-name: myservlet-1.0-SNAPSHOT.war) in 48ms
      13:17:08,580 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0027: Starting deployment of "myservlet-1.0-SNAPSHOT.war" (runtime-name: "myservlet-1.0-SNAPSHOT.war")
      13:17:08,779 INFO [my.ScriptServlet] (ServerService Thread Pool – 74) initinig
      13:17:08,780 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool – 74) WFLYUT0021: Registered web context: '/myservlet-1.0-SNAPSHOT' for server 'default-server'
      13:17:08,814 INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0016: Replaced deployment "myservlet-1.0-SNAPSHOT.war" with deployment "myservlet-1.0-SNAPSHOT.war"
      13:17:08,816 INFO [org.jboss.as.repository] (DeploymentScanner-threads - 1) WFLYDR0002: Content removed from location F:\tools\wildfly-12.0.0.Final\standalone\data\content\ca\7aa2a316c34941ab2dc1230d64523b4eba4c49\content
      ```

      Show
      1. Download simple project from github ``` git clone https://github.com/anatoly-spb/simple-annotated-servlet ``` 2. Enter into project directory ``` cd simple-annotated-servlet ``` 3. Build project with Java 9: ``` set JAVA_HOME=%JAVA9_HOME% set PATH=%JAVA_HOME%\bin;%PATH% mvn clean install copy /Y target*.war F:\wildfly-12.0.0.Final\standalone\deployments\ ``` 4. Check that servlet is not initialized, because there is not `initinig` message from our servlet in the log: ``` 13:15:07,995 INFO [org.jboss.as.repository] (DeploymentScanner-threads - 1) WFLYDR0001: Content added at location F:\tools\wildfly-12.0.0.Final\standalone\data\content\ca\7aa2a316c34941ab2dc1230d64523b4eba4c49\content 13:15:08,004 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool – 19) WFLYUT0022: Unregistered web context: '/myservlet-1.0-SNAPSHOT' from server 'default-server' 13:15:08,136 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0028: Stopped deployment myservlet-1.0-SNAPSHOT.war (runtime-name: myservlet-1.0-SNAPSHOT.war) in 135ms 13:15:08,138 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0027: Starting deployment of "myservlet-1.0-SNAPSHOT.war" (runtime-name: "myservlet-1.0-SNAPSHOT.war") 13:15:08,316 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool – 72) WFLYUT0021: Registered web context: '/myservlet-1.0-SNAPSHOT' for server 'default-server' 13:15:08,402 INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0016: Replaced deployment "myservlet-1.0-SNAPSHOT.war" with deployment "myservlet-1.0-SNAPSHOT.war" 13:15:08,405 INFO [org.jboss.as.repository] (DeploymentScanner-threads - 1) WFLYDR0002: Content removed from location F:\tools\wildfly-12.0.0.Final\standalone\data\content\e5\61ef7d0c4b695ba0e71aeb1e5ab2a3e69f58a4\content ``` 5. Build project with Java 8: ``` set JAVA_HOME=%JAVA8_HOME% set PATH=%JAVA_HOME%\bin;%PATH% mvn clean install copy /Y target*.war F:\wildfly-12.0.0.Final\standalone\deployments\ ``` 6. Check that our servlet is initialized because there is ` [my.ScriptServlet] (ServerService Thread Pool – 74) initinig` in the log: ``` 13:17:08,512 INFO [org.jboss.as.repository] (DeploymentScanner-threads - 1) WFLYDR0001: Content added at location F:\tools\wildfly-12.0.0.Final\standalone\data\content\d9\ba6f286c582b522f90ea51b956b0b27f899623\content 13:17:08,526 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool – 73) WFLYUT0022: Unregistered web context: '/myservlet-1.0-SNAPSHOT' from server 'default-server' 13:17:08,563 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) WFLYSRV0028: Stopped deployment myservlet-1.0-SNAPSHOT.war (runtime-name: myservlet-1.0-SNAPSHOT.war) in 48ms 13:17:08,580 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0027: Starting deployment of "myservlet-1.0-SNAPSHOT.war" (runtime-name: "myservlet-1.0-SNAPSHOT.war") 13:17:08,779 INFO [my.ScriptServlet] (ServerService Thread Pool – 74) initinig 13:17:08,780 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool – 74) WFLYUT0021: Registered web context: '/myservlet-1.0-SNAPSHOT' for server 'default-server' 13:17:08,814 INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0016: Replaced deployment "myservlet-1.0-SNAPSHOT.war" with deployment "myservlet-1.0-SNAPSHOT.war" 13:17:08,816 INFO [org.jboss.as.repository] (DeploymentScanner-threads - 1) WFLYDR0002: Content removed from location F:\tools\wildfly-12.0.0.Final\standalone\data\content\ca\7aa2a316c34941ab2dc1230d64523b4eba4c49\content ```
    • Hide

      wildfly-12.0.0.Final\modules\system\layers\base\org\jboss\jandex\main\jandex-2.0.4.Final.jar must be replaced on jandex-2.0.3.Final.jar from wildfly-11.0.0.Final

      Show
      wildfly-12.0.0.Final\modules\system\layers\base\org\jboss\jandex\main\jandex-2.0.4.Final.jar must be replaced on jandex-2.0.3.Final.jar from wildfly-11.0.0.Final

      I have WildFly 12.0.0.Final server running on JDK 9. I have simple maven based annotated servlet project: https://github.com/anatoly-spb/simple-annotated-servlet .

      If I build my project with Java 9, WildFly does not see @WebServlet annotation. If I build my project with Java 1.8, WildFly uses @WebServlet annotation and works as expected.

              Unassigned Unassigned
              anatolys_jira Анатолий Широков (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: