Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-19086

[GSS] (7.3.z) WFLY-13293 - When deploying "ROOT.war" in EAP7.x, the context root value output through jboss-cli is not valid

XMLWordPrintable

      When deploying "ROOT.war" default context-root is "/" even though i set a specific context-root in jboss-web.xml. However, If I check resources by jboss-cli, it seems like context-root value refers to jboss-web.xml and this value is invalid.

      ROOT.war/WEB-INF/jboss-web.xml

      <jboss-web version="7.0" 
              xmlns:jboss="http://www.jboss.com/xml/ns/javaee" 
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
              xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee jboss-web_7_0.xsd">
         <context-root>/hello</context-root>
      </jboss-web>
      [standalone@192.168.122.1:10090 /] deployment-info
      NAME     RUNTIME-NAME PERSISTENT ENABLED STATUS 
      ROOT.war ROOT.war     true       true    OK  
      

      server.log

      2020-03-24 10:35:56,344 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 78) WFLYUT0021: Registered web context: '/' for server 'default-server'
      2020-03-24 10:35:56,354 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0010: Deployed "ROOT.war" (runtime-name : "ROOT.war")
      

      However, If I check resource by jboss-cli, it seems like context-root value refers to jboss-web.xml and this vaule is invalid.

      [standalone@192.168.122.1:10090 /] /deployment=ROOT.war/subsystem=undertow:read-resource(include-runtime=true)
      {
          "outcome" => "success",
          "result" => {
              "active-sessions" => 0,
              "context-root" => "/hello",   => this is invalid, the real value is "/"
              "expired-sessions" => 0,
              "highest-session-count" => 0,
              "max-active-sessions" => -1,
              "rejected-sessions" => 0,
              "server" => "default-server",
              "session-avg-alive-time" => 0,
              "session-max-alive-time" => 0,
              "sessions-created" => 0,
              "virtual-host" => "default-host",
              "servlet" => undefined,
              "websocket" => undefined
          }
      }
      

      valid context-root is "/"

      [hyoskim@hyoskim sophia]$ curl -v http://192.168.122.1:8180/test.jsp
      * About to connect() to 192.168.122.1 port 8180 (#0)
      *   Trying 192.168.122.1...
      * Connected to 192.168.122.1 (192.168.122.1) port 8180 (#0)
      > GET /test.jsp HTTP/1.1
      > User-Agent: curl/7.29.0
      > Host: 192.168.122.1:8180
      > Accept: */*
      > 
      < HTTP/1.1 200 OK
      < Connection: keep-alive
      < X-Powered-By: JSP/2.3
      < Set-Cookie: JSESSIONID=_Ej56uTEuy1B0U2Oi94pcVtCNwg7ngRNr7HO7TQ7.worker1; path=/
      < Content-Type: text/html;charset=ISO-8859-1
      < Content-Length: 6
      < Date: Tue, 24 Mar 2020 01:37:53 GMT
      < 
      hello
      
      [hyoskim@hyoskim sophia]$ curl -v http://192.168.122.1:8180/hello/test.jsp
      * About to connect() to 192.168.122.1 port 8180 (#0)
      *   Trying 192.168.122.1...
      * Connected to 192.168.122.1 (192.168.122.1) port 8180 (#0)
      > GET /hello/test.jsp HTTP/1.1
      > User-Agent: curl/7.29.0
      > Host: 192.168.122.1:8180
      > Accept: */*
      > 
      < HTTP/1.1 404 Not Found
      < Connection: keep-alive
      < Content-Type: text/html;charset=UTF-8
      < Content-Length: 74
      < Date: Tue, 24 Mar 2020 01:37:23 GMT
      < 
      * Connection #0 to host 192.168.122.1 left intact
      <html><head><title>Error</title></head><body>/hello/test.jsp</body></html>

              rhn-support-rmartinc Ricardo Martin Camarero
              rhn-support-rmartinc Ricardo Martin Camarero
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: