title: Found class org.eclipse.jetty.websocket.api.UpgradeRequest, but interface was expected
body: <p>I'm new in Java development and I faced this error when trying to get querystring variables by <strong>getParameterMap()</strong> method:</p>
  
  <pre><code>Found class org.eclipse.jetty.websocket.api.UpgradeRequest, but interface was expected
  </code></pre>
  
  <p>The code I use is this:</p>
  
  <pre><code>public class TranscribeSocket extends WebSocketAdapter implements ApiStreamObserver&lt;StreamingRecognizeResponse&gt; {
  
  private String speechLanguage = "en-US";
  
  @Override
  public void onWebSocketConnect(Session sess) {
      UpgradeRequest request = sess.getUpgradeRequest();
      Map&lt;String, List&lt;String&gt;&gt; params = request.getParameterMap();
  
      List&lt;String&gt; language = params.get("lang");
      if (language != null &amp;&amp; language.size() &gt; 0) {
          String lang = language.get(0);
          switch (lang) {
              case "en":
                  speechLanguage = "en-US";
                  break;
              case "fr":
                  speechLanguage = "fr-FR";
                  break;
              default:
                  speechLanguage = "en-US";
          }
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>UPDATE</p>
  
  <p>Here you can find the dependency tree</p>
  
  <pre><code>[INFO] be.smartconcept.speech:speaking-with-a-page:war:1.0-SNAPSHOT
  [INFO] +- javax.servlet:javax.servlet-api:jar:3.1.0:provided
  [INFO] +- org.eclipse.jetty.websocket:websocket-servlet:jar:9.4.1.v20170120:compile
  [INFO] |  \- org.eclipse.jetty.websocket:websocket-api:jar:9.4.1.v20170120:compile
  [INFO] +- com.google.cloud:google-cloud-speech:jar:0.49.0-alpha:compile
  [INFO] |  +- com.google.cloud:google-cloud-core:jar:1.31.0:compile
  [INFO] |  |  +- com.google.guava:guava:jar:20.0:compile
  [INFO] |  |  +- joda-time:joda-time:jar:2.9.2:compile
  [INFO] |  |  +- com.google.http-client:google-http-client:jar:1.23.0:compile
  [INFO] |  |  |  \- org.apache.httpcomponents:httpclient:jar:4.0.1:compile
  [INFO] |  |  |     +- org.apache.httpcomponents:httpcore:jar:4.0.1:compile
  [INFO] |  |  |     +- commons-logging:commons-logging:jar:1.1.1:compile
  [INFO] |  |  |     \- commons-codec:commons-codec:jar:1.3:compile
  [INFO] |  |  +- com.google.code.findbugs:jsr305:jar:3.0.1:compile
  [INFO] |  |  +- com.google.api:api-common:jar:1.5.0:compile
  [INFO] |  |  +- com.google.api:gax:jar:1.25.0:compile
  [INFO] |  |  |  \- org.threeten:threetenbp:jar:1.3.3:compile
  [INFO] |  |  +- com.google.protobuf:protobuf-java-util:jar:3.5.1:compile
  [INFO] |  |  +- com.google.api.grpc:proto-google-common-protos:jar:1.11.0:compile
  [INFO] |  |  \- com.google.api.grpc:proto-google-iam-v1:jar:0.12.0:compile
  [INFO] |  +- com.google.cloud:google-cloud-core-grpc:jar:1.31.0:compile
  [INFO] |  |  +- com.google.auth:google-auth-library-credentials:jar:0.9.1:compile
  [INFO] |  |  +- com.google.protobuf:protobuf-java:jar:3.5.1:compile
  [INFO] |  |  +- io.grpc:grpc-protobuf:jar:1.10.1:compile
  [INFO] |  |  |  \- io.grpc:grpc-protobuf-lite:jar:1.10.1:compile
  [INFO] |  |  +- io.grpc:grpc-context:jar:1.10.1:compile
  [INFO] |  |  \- com.google.api:gax-grpc:jar:1.25.0:compile
  [INFO] |  +- com.google.api.grpc:proto-google-cloud-speech-v1beta1:jar:0.14.0:compile
  [INFO] |  +- com.google.api.grpc:proto-google-cloud-speech-v1p1beta1:jar:0.14.0:compile
  [INFO] |  +- com.google.api.grpc:proto-google-cloud-speech-v1:jar:0.14.0:compile
  [INFO] |  +- io.grpc:grpc-netty-shaded:jar:1.10.1:compile
  [INFO] |  |  \- io.grpc:grpc-core:jar:1.10.1:compile (version selected from constraint [1.10.1,1.10.1])
  [INFO] |  |     +- com.google.errorprone:error_prone_annotations:jar:2.1.2:compile
  [INFO] |  |     \- io.opencensus:opencensus-contrib-grpc-metrics:jar:0.11.0:compile
  [INFO] |  +- io.grpc:grpc-stub:jar:1.10.1:compile
  [INFO] |  \- io.grpc:grpc-auth:jar:1.10.1:compile
  [INFO] +- com.google.cloud:google-cloud-storage:jar:1.37.1:compile
  [INFO] |  +- com.google.cloud:google-cloud-core-http:jar:1.37.1:compile
  [INFO] |  |  +- com.google.auth:google-auth-library-oauth2-http:jar:0.9.1:compile
  [INFO] |  |  +- com.google.oauth-client:google-oauth-client:jar:1.23.0:compile
  [INFO] |  |  +- com.google.api-client:google-api-client:jar:1.23.0:compile
  [INFO] |  |  +- com.google.http-client:google-http-client-appengine:jar:1.23.0:compile
  [INFO] |  |  +- com.google.http-client:google-http-client-jackson:jar:1.23.0:compile
  [INFO] |  |  |  \- org.codehaus.jackson:jackson-core-asl:jar:1.9.11:compile
  [INFO] |  |  +- com.google.http-client:google-http-client-jackson2:jar:1.23.0:compile
  [INFO] |  |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.1.3:compile
  [INFO] |  |  +- com.google.api:gax-httpjson:jar:0.46.0:compile
  [INFO] |  |  +- io.opencensus:opencensus-api:jar:0.12.3:compile
  [INFO] |  |  \- io.opencensus:opencensus-contrib-http-util:jar:0.12.3:compile
  [INFO] |  \- com.google.apis:google-api-services-storage:jar:v1-rev131-1.23.0:compile
  [INFO] \- com.google.code.gson:gson:jar:2.8.0:compile
  </code></pre>
  
  <p>As a matter of fact this code was taken from google speech to text example, which provides transcription of the streamed speech. I need to pass the language of the speech to gcloud, and the front-end is build in PHP, so the only way I see is to pass the appropriate value by querystring to websocket.</p>