Wildfly 8.2 websocket tyrus error
anegri Jun 5, 2015 7:41 AMI am getting this error when deploying a websocket on JBoss 8.2.0 Final, I thought it was supposed to work out of the box? The websocket still seems to work without issues, but I don't understand why I am getting this error and how to fix it?
... 2015-06-04 21:05:41,392 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS] 2015-06-04 21:05:41,435 INFO [org.jboss.ws.common.management] (MSC service thread 1-5) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.3.2.Final 2015-06-04 21:05:41,548 ERROR [io.undertow.websockets.jsr] (MSC service thread 1-5) UT026002: Unable to instantiate server configuration class org.glassfish.tyrus.server.TyrusServerConfiguration: java.lang.InstantiationException: org.glassfish.tyrus.server.TyrusServerConfiguration at java.lang.Class.newInstance(Class.java:359) [rt.jar:1.7.0_55] at org.wildfly.extension.undertow.deployment.UndertowJSRWebSocketDeploymentProcessor.doDeployment(UndertowJSRWebSocketDeploymentProcessor.java:213) at org.wildfly.extension.undertow.deployment.UndertowJSRWebSocketDeploymentProcessor.deploy(UndertowJSRWebSocketDeploymentProcessor.java:165) at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_55] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_55] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_55] ...
package com.test.echo;
import javax.websocket.OnMessage;
import javax.websocket.Session;
import javax.websocket.server.ServerEndpoint;
@ServerEndpoint("/shout")
public class ShoutServerEndpoint {
  @OnMessage
  public void shout(String text, Session client) {
      client.getAsyncRemote().sendText(text.toUpperCase());
  }
}
pom.xml
<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.cra.livio</groupId>
  <artifactId>echo</artifactId>
  <version>1.0</version>
  <packaging>war</packaging>
  <name>echo</name>
  <url>http://maven.apache.org</url>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <!-- JBoss dependency versions -->
    <version.wildfly.maven.plugin>1.0.2.Final</version.wildfly.maven.plugin>
    <!-- other plugin versions -->
    <version.compiler.plugin>3.1</version.compiler.plugin>
    <version.war.plugin>2.5</version.war.plugin>
    <!-- maven-compiler-plugin -->
    <maven.compiler.target>1.7</maven.compiler.target>
    <maven.compiler.source>1.7</maven.compiler.source>
    <!-- Define the version of the JBoss BOMs we want to import to specify tested stacks. -->
    <version.jboss.spec.javaee.7.0>1.0.0.Final</version.jboss.spec.javaee.7.0>
  </properties>
  
  <dependencyManagement>
      <dependencies>
          <!-- JBoss distributes a complete set of Java EE 7 APIs including
              a Bill of Materials (BOM). A BOM specifies the versions of a "stack" (or 
              a collection) of artifacts. We use this here so that we always get the correct 
              versions of artifacts. Here we use the jboss-javaee-7.0 stack (you can read
              this as the JBoss stack of the Java EE 7 APIs) -->
          <dependency>
              <groupId>org.jboss.spec</groupId>
              <artifactId>jboss-javaee-all-7.0</artifactId>
              <version>${version.jboss.spec.javaee.7.0}</version>
              <type>pom</type>
              <scope>import</scope>
          </dependency>
          
      </dependencies>
  </dependencyManagement>
  
  <dependencies>
    <dependency>
      <groupId>javax.websocket</groupId>
      <artifactId>javax.websocket-api</artifactId>
      <version>1.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
     <groupId>org.glassfish.tyrus</groupId>
     <artifactId>tyrus-server</artifactId>
     <version>1.1</version>
  </dependency>
  <dependency>
     <groupId>org.glassfish.tyrus</groupId>
     <artifactId>tyrus-client</artifactId>
     <version>1.1</version>
  </dependency>
  <dependency>
     <groupId>org.glassfish.tyrus</groupId>
     <artifactId>tyrus-container-grizzly</artifactId>
     <version>1.1</version>
  </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <compilerVersion>1.7</compilerVersion>
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.4</version>
        <configuration>
            <outputDirectory>C:\Users\anegri\wildfly-8.2.0.Final\standalone\deployments</outputDirectory>
            <!-- <outputDirectory>C:\Users\anegri\jboss-eap-6.1\standalone\deployments</outputDirectory> -->
            <!-- <outputDirectory>C:\Users\anegri\jboss-as-7.1.1.Final\standalone\deployments</outputDirectory> -->
            <!-- <outputDirectory>/home/cyber/jboss-as-7.1.1.Final/standalone/deployments</outputDirectory> -->
        </configuration>
      </plugin>
    </plugins>
  </build>
  
</project>
Any suggestions? I think its a simple fix, like a missing config file of some sort... I followed this project to make it work shekhargulati/websocket-reverse-echo-example · GitHub
Thanks!
-Alex
 
    