Details

    • Type: Story
    • Status: Closed (View Workflow)
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 1.0.0.Alpha6
    • Component/s: None
    • Labels:
      None

      Description

      I'm playing with wildfly-swarm and websocket, using:
      Creating a Chat Application using Java EE 7, Websockets and GlassFish 4
      http://www.hascode.com/2013/08/creating-a-chat-application-using-java-ee-7-websockets-and-glassfish-4/

      with code source:
      Java EE 7 - GlassFish WebSockets Chat Tutorial
      https://bitbucket.org/hascode/javaee7-websocket-chat/

      It's a very simple application with a unique endpoint. I just used wildfly in place of glassfish.

      Everything runs fine with:

      • mvn compile antrun:run -launcher, i.e. launch directly org.wildfly.swarm.Swarm
      • mvn package antrun:run -Pwildfly-standalone, i.e. create a fat jar and run it

      But when using wildfly-swarm:run:

      • mvn clean wildfly-swarm:run -Pwildfly-embedded

      I get this: {{ ERROR [stderr] (main) [WARN] Unable to create default deployment}}

      Did I miss something?


      End of the log:

      $ mvn clean package wildfly-swarm:run -Pwildfly -Pwildfly-embedded 
      [...]
      [INFO] --- wildfly-swarm-plugin:1.0.0.Alpha4:run (default-cli) @ javaee7-websocket-chat ---
      tmpDir: /tmp
      09:56:25,875 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final
      09:56:26,175 INFO  [org.jboss.as] (MSC service thread 1-6) WFLYSRV0049: WildFly Core 2.0.0.Beta1 "Kenny" starting
      2015-10-08 09:56:26,925 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 10) WFLYNAM0001: Activating Naming Subsystem
      2015-10-08 09:56:26,925 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 8) WFLYIO001: Worker 'default' has auto-configured to 16 core threads with 128 task threads based on your 8 available processors
      2015-10-08 09:56:26,953 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 7) WFLYUT0003: Undertow 1.3.0.Beta6 starting
      2015-10-08 09:56:26,953 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0003: Undertow 1.3.0.Beta6 starting
      2015-10-08 09:56:26,963 INFO  [org.jboss.as.naming] (MSC service thread 1-5) WFLYNAM0003: Starting Naming Service
      2015-10-08 09:56:26,994 INFO  [org.xnio] (MSC service thread 1-5) XNIO version 3.3.1.Final
      2015-10-08 09:56:27,010 INFO  [org.xnio.nio] (MSC service thread 1-5) XNIO NIO Implementation Version 3.3.1.Final
      2015-10-08 09:56:27,088 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-5) WFLYUT0012: Started server default-server.
      2015-10-08 09:56:27,196 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0006: Undertow HTTP listener default listening on /0:0:0:0:0:0:0:0:8084
      2015-10-08 09:56:27,522 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Core 2.0.0.Beta1 "Kenny" started in 1779ms - Started 58 of 64 services (13 services are lazy, passive or on-demand)
      2015-10-08 09:56:27,526 ERROR [stderr] (main) [WARN] Unable to create default deployment
      

      The pom file:

      <?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.hascode.tutorial</groupId>
          <artifactId>javaee7-websocket-chat</artifactId>
          <version>1.0.0</version>
          <packaging>war</packaging>
      
          <name>javaee7-websocket-chat</name>
          <description>
          Rational: to use Wildfly  in embedded mode, in place of Glassfish.
          Presentation:
            Creating a Chat Application using Java EE 7, Websockets and GlassFish 4  
            http://www.hascode.com/2013/08/creating-a-chat-application-using-java-ee-7-websockets-and-glassfish-4/
          Code source:
            Java EE 7 - GlassFish WebSockets Chat Tutorial  
            https://bitbucket.org/hascode/javaee7-websocket-chat/
          </description>
      
          <properties>
      
              <web.port>8084</web.port>
              <context.path>hascode</context.path><!-- letters, digits or underscores only -->
      
              <failOnMissingWebXml>false</failOnMissingWebXml>
      
              <sviperll.extension.version>0.16</sviperll.extension.version>
      
              <!-- JVM Management -->
      
              <project.jdk.version>1.8</project.jdk.version>
              <project.encoding>UTF-8</project.encoding>
      
              <project.build.sourceEncoding>${project.encoding}</project.build.sourceEncoding>
              <project.reporting.outputEncoding>${project.encoding}</project.reporting.outputEncoding>
      
              <maven.compiler.source>${project.jdk.version}</maven.compiler.source>
              <maven.compiler.target>${project.jdk.version}</maven.compiler.target>
              <maven.compiler.compilerVersion>${project.jdk.version}</maven.compiler.compilerVersion>
              <maven.compiler.fork>true</maven.compiler.fork>
              <maven.compiler.verbose>true</maven.compiler.verbose>
              <maven.compiler.optimize>true</maven.compiler.optimize>
              <maven.compiler.debug>true</maven.compiler.debug>
      
              <!-- Maven and Plugin Management -->
              <!-- Version 3.3.1+ required for Maven Extensions -->
              <maven.minimal.version>3.3.1</maven.minimal.version>
      
              <replacer.plugin.version>1.5.3</replacer.plugin.version>
              <maven.antrun.plugin.version>1.8</maven.antrun.plugin.version>
      
              <build.helper.maven.plugin.version>1.9.1</build.helper.maven.plugin.version>
              <maven.enforcer.plugin.version>1.4.1</maven.enforcer.plugin.version>
              <versions.maven.plugin.version>2.2</versions.maven.plugin.version>
              <coreext.maven.plugin.version>${sviperll.extension.version}</coreext.maven.plugin.version>
      
              <maven.compiler.plugin.version>3.3</maven.compiler.plugin.version>
              <maven.clean.plugin.version>2.6.1</maven.clean.plugin.version>
              <maven.resources.plugin.version>2.7</maven.resources.plugin.version>
      
              <maven.surefire.plugin.version>2.18.1</maven.surefire.plugin.version>
              <maven.failsafe.plugin.version>2.18.1</maven.failsafe.plugin.version>
              <maven.jar.plugin.version>2.6</maven.jar.plugin.version>
              <maven.war.plugin.version>2.6</maven.war.plugin.version>
      
              <maven.install.plugin.version>2.5.2</maven.install.plugin.version>
              <maven.deploy.plugin.version>2.8.2</maven.deploy.plugin.version>
              <maven.site.plugin.version>3.4</maven.site.plugin.version>
      
              <glassfish.plugin.version>4.0</glassfish.plugin.version>
      
              <wildfly.maven.plugin.version>1.1.0.Alpha4</wildfly.maven.plugin.version>
              <wildfly.swarm.plugin.version>${wildfly.swarm.version}</wildfly.swarm.plugin.version>
      
              <!-- Dependency Management -->
              <json.api.version>1.0</json.api.version>
              <websocket.api.version>1.1</websocket.api.version>
              <javax.json.version>1.0.4</javax.json.version>
      
              <glassfish.version>4.1</glassfish.version>
      
              <wildfly.swarm.version>1.0.0.Alpha4</wildfly.swarm.version>
      
          </properties>
      
          <!-- just to keep versions-maven-plugin quiet (no Maven plugin projects here) -->
          <prerequisites>
              <maven>${maven.minimal.version}</maven>
          </prerequisites>
      
          <dependencies>
              <dependency>
                  <groupId>javax.websocket</groupId>
                  <artifactId>javax.websocket-api</artifactId>
                  <version>${websocket.api.version}</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>javax.json</groupId>
                  <artifactId>javax.json-api</artifactId>
                  <version>${json.api.version}</version>
                  <scope>provided</scope>
              </dependency>
          </dependencies>
      
          <build>
              <plugins>
                  <plugin>
                      <groupId>com.google.code.maven-replacer-plugin</groupId>
                      <artifactId>replacer</artifactId>
                  </plugin>
              </plugins>
              <pluginManagement>
                  <plugins>
      [...]
                      <plugin>
                          <groupId>com.google.code.maven-replacer-plugin</groupId>
                          <artifactId>replacer</artifactId>
                          <version>${replacer.plugin.version}</version>
                          <executions>
                              <execution>
                                  <id>set-web-socket-port-in-resources</id>
                                  <phase>generate-sources</phase>
                                  <goals>
                                      <goal>replace</goal>
                                  </goals>
                                  <configuration>
                                      <file>${project.basedir}/src/main/webapp/index.html</file>
                                      <regex>true</regex>
                                      <replacements>
                                          <replacement>
                                              <token>(var\s+serviceLocation\s*=\s*"ws://0\.0\.0\.0:)(?!${web.port})\d+/(?!${context.path}/chat/").*?(/chat/")</token>
                                              <value>$1${web.port}/${context.path}$2</value>
                                          </replacement>
                                      </replacements>
                                  </configuration>
                              </execution>
                          </executions>
                      </plugin>
                      <plugin>
                          <groupId>com.github.sviperll</groupId>
                          <artifactId>coreext-maven-plugin</artifactId>
                          <version>${coreext.maven.plugin.version}</version>
                          <configuration>
                              <extensions combine.children="append">
                                  <extension>
                                      <groupId>com.github.sviperll</groupId>
                                      <artifactId>maven-profiledep-extension</artifactId>
                                      <version>${sviperll.extension.version}</version>
                                  </extension>
                              </extensions>
                          </configuration>
                          <executions>
                              <execution>
                                  <id>check-coreext</id>
                                  <goals>
                                      <goal>check</goal>
                                  </goals>
                              </execution>
                          </executions>
                      </plugin>
                      <plugin>
                          <groupId>org.wildfly.plugins</groupId>
                          <artifactId>wildfly-maven-plugin</artifactId>
                          <version>${wildfly.maven.plugin.version}</version>
                      </plugin>
                      <plugin>
                          <groupId>org.wildfly.swarm</groupId>
                          <artifactId>wildfly-swarm-plugin</artifactId>
                          <version>${wildfly.swarm.plugin.version}</version>
                      </plugin>
                  </plugins>
              </pluginManagement>
          </build>
      
          <profiles>
              <profile>
                  <id>wildfly</id>
                  <activation>
                      <property>
                          <name>wildfly</name>
                      </property>
                  </activation>
                  <build>
                      <pluginManagement>
                          <plugins>
                              <plugin>
                                  <groupId>org.wildfly.swarm</groupId>
                                  <artifactId>wildfly-swarm-plugin</artifactId>
                                  <configuration>
                                      <properties>
                                          <jboss.http.port>${web.port}</jboss.http.port>
                                          <wildfly.swarm.context.path>${context.path}</wildfly.swarm.context.path>
                                      </properties>
                                  </configuration>
                                  <executions>
                                      <execution>
                                          <goals>
                                              <goal>package</goal>
                                          </goals>
                                      </execution>
                                  </executions>
                              </plugin>
                              <plugin>
                                  <artifactId>maven-war-plugin</artifactId>
                                  <version>${maven.war.plugin.version}</version>
                                  <configuration>
                                      <packagingExcludes>WEB-INF/lib/wildfly-swarm-*.jar</packagingExcludes>
                                  </configuration>
                              </plugin>
                          </plugins>
                      </pluginManagement>
                  </build>
                  <dependencies>
                      <dependency>
                          <groupId>org.glassfish</groupId>
                          <artifactId>javax.json</artifactId>
                          <version>${javax.json.version}</version>
                      </dependency>
                      <dependency>
                          <groupId>org.wildfly.swarm</groupId>
                          <artifactId>wildfly-swarm-undertow</artifactId>
                          <version>${wildfly.swarm.version}</version>
                      </dependency>
                  </dependencies>
              </profile>
      
              <profile><!-- Embedded Wildfly: 
                  Launch the application without generating a war 
                      mvn clean wildfly-swarm:run -Pwildfly-embedded
                  -->
                  <id>wildfly-embedded</id>
                  <activation>
                      <property>
                          <name>wildfly-embedded</name>
                      </property>
                  </activation>
                  <properties>
                      <profile.depends>wildfly</profile.depends>
                  </properties>
                  <build>
                      <plugins>
                          <plugin>
                              <groupId>org.wildfly.plugins</groupId>
                              <artifactId>wildfly-maven-plugin</artifactId>
                          </plugin>
                          <plugin>
                              <groupId>org.wildfly.swarm</groupId>
                              <artifactId>wildfly-swarm-plugin</artifactId>
                              <configuration>
                                  <properties>
                                      <jboss.http.port>${web.port}</jboss.http.port>
                                  </properties>
                                  <contextPath>${context.path}</contextPath>
                              </configuration>
                          </plugin>
                      </plugins>
                  </build>
              </profile>
      
              <profile><!-- Standalone Wildfly
                      Create a runnable fatjar and launch it with 
                          mvn package antrun:run -Pwildfly-standalone
                      Note. Under M2Eclipse, antrun:run must be used, as with wildfly-swarm:run 
                            the server isn't stopped after its ending has been asked from M2Eclipse. -->
                  <id>wildfly-standalone</id>
                  <activation>
                      <property>
                          <name>wildfly-standalone</name>
                      </property>
                  </activation>
                  <properties>
                      <profile.depends>wildfly</profile.depends>
                  </properties>
                  <build>
                      <plugins>
                          <plugin>
                              <groupId>org.wildfly.swarm</groupId>
                              <artifactId>wildfly-swarm-plugin</artifactId>
                          </plugin>
                          <plugin>
                              <artifactId>maven-antrun-plugin</artifactId>
                              <configuration>
                                  <target>
                                      <java fork="true" jar="${project.build.directory}/${project.build.finalName}-swarm.jar">
                                          <jvmarg value="-Djboss.http.port=${web.port}" />
                                          <jvmarg value="-Dwildfly.swarm.context.path=${context.path}" />
                                      </java>
                                  </target>
                              </configuration>
                          </plugin>
                      </plugins>
                  </build>
              </profile>
      
              <profile><!-- Launch directly the Swarm main class
                          mvn compile antrun:run -launcher
                      -->
                  <id>wildfly-launcher</id>
                  <activation>
                      <property>
                          <name>wildfly-launcher</name>
                      </property>
                  </activation>
                  <properties>
                      <profile.depends>wildfly</profile.depends>
                  </properties>
                  <build>
                      <plugins>
                          <plugin>
                              <groupId>org.wildfly.swarm</groupId>
                              <artifactId>wildfly-swarm-plugin</artifactId>
                          </plugin>
                          <plugin>
                              <artifactId>maven-antrun-plugin</artifactId>
                              <configuration>
                                  <target>
                                      <java fork="true" classname="org.wildfly.swarm.Swarm">
                                          <jvmarg value="-Djboss.http.port=${web.port}" />
                                          <jvmarg value="-Dwildfly.swarm.context.path=${context.path}" />
                                          <classpath refid="maven.compile.classpath" />
                                      </java>
                                  </target>
                              </configuration>
                          </plugin>
                      </plugins>
                  </build>
              </profile>
      [...]
          </profiles>
      </project>
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                atao60 atao60 atao60 (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: