2 Replies Latest reply on Jul 4, 2017 10:06 AM by Obakeng Balatseng

    Wildfly Swarm runs a deployed artifact using it's hash name

    Obakeng Balatseng Newbie

      I have a standard clean web project that I'm using to build a Wildfly swarm artifact. My POM looks like:

       

      <?xml version="1.0" encoding="UTF-8"?>

          <project xmlns="http://maven.apache.org/POM/4.0.0"

                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

              <modelVersion>4.0.0</modelVersion>

         

              <groupId>com.test.swarm</groupId>

              <artifactId>test_security_module</artifactId>

              <version>1.0-SNAPSHOT</version>

              <packaging>war</packaging>

         

              <dependencyManagement>

                  <dependencies>

                      <dependency>

                          <groupId>org.wildfly.swarm</groupId>

                          <artifactId>bom-all</artifactId>

                          <version>2017.6.1</version>

                          <type>pom</type>

                          <scope>import</scope>

                      </dependency>

                  </dependencies>

              </dependencyManagement>

         

              <dependencies>

                  <dependency>

                      <groupId>javax</groupId>

                      <artifactId>javaee-api</artifactId>

                      <version>7.0</version>

                      <scope>provided</scope>

                  </dependency>

                  <dependency>

                      <groupId>org.wildfly.swarm</groupId>

                      <artifactId>security</artifactId>

                  </dependency>

              </dependencies>

         

              <build>

                  <plugins>

                      <plugin>

                          <groupId>org.wildfly.swarm</groupId>

                          <artifactId>wildfly-swarm-plugin</artifactId>

                          <version>2017.6.1</version>

                          <executions>

                              <execution>

                                  <goals>

                                      <goal>package</goal>

                                  </goals>

                              </execution>

                          </executions>

                      </plugin>

                  </plugins>

              </build>

          </project>

       

      I also have a jboss-web.xml that is supposed to register a context root, and looks like:

       

      <?xml version="1.0" encoding="UTF-8"?>

          <jboss-web xmlns="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 http://www.jboss.org/j2ee/schema/jboss-web_6_0.xsd"

                     version="6.0">   

              <context-root>/Tiles</context-root>

      </jboss-web>

       

      So after building and running the project, the /Tiles context root must be registered, and the application accessible on: http://localhost:8080/Tiles.

       

      But then I try to run the uber jar using the standard java -jar, Swarm deploys the hash name of the project name (as opposed to the project name). It doesn't even register the context root. The snippet of the stack trace is:

       

      2017-07-04 04:32:14,329 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Swarm 2017.6.1 (WildFly Core 2.2.1.Final) started in 5762ms - Started 55 of 59 services (4 services are lazy, passive or on-demand)

      2017-07-04 04:32:14,383 INFO  [org.wildfly.swarm.runtime.deployer] (main) deploying 3d31f81a-29d6-4ea1-b3eb-0a2a98a3c3f5.war

      2017-07-04 04:32:14,405 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0027: Starting deployment of "3d31f81a-29d6-4ea1-b3eb-0a2a98a3c3f5.war" (runtime-name: "3d31f81a-29d6-4ea1-b3eb-0a2a98a3c3f5.war")

      2017-07-04 04:32:14,464 INFO  [org.jboss.as.server] (main) WFLYSRV0010: Deployed "3d31f81a-29d6-4ea1-b3eb-0a2a98a3c3f5.war" (runtime-name : "3d31f81a-29d6-4ea1-b3eb-0a2a98a3c3f5.war")

      2017-07-04 04:32:14,466 INFO  [org.wildfly.swarm] (main) WFSWARM99999: WildFly Swarm is Ready

       

       

      What could cause swarm to run the application using the hash name of the project?