title: Selenium Hub Exception with JsonPrimitive.isPrimitiveOrString
body: <p>Instance of Selenium standalone server the node returns a 500 Error response NullPointerException raised at com.google.gson.JsonPrimitive.isPrimitiveOrString </p>
  
  <p>Any tips to troubleshooting this error are apreciated.</p>
  
  <p>Start the Selenium Server Hub and Node 
  Check that the node is listed on the server console.</p>
  
  <p>Software version:</p>
  
  <ul>
  <li>Apache Maven 3.5.0</li>
  <li>selenium-server-standalone-3.5.0</li>
  <li>ChromeDriver 2.31 - geckodriver-v0.18.0-win64</li>
  <li>Chrome v 60.0.3112.101 (64-bit)</li>
  <li>Firefox 55.0.2 (64-bit)</li>
  <li>Java 1.8.0_92 (64-bit)</li>
  </ul>
  
  <p>Server startup command:</p>
  
  <pre><code>java -jar "selenium-server-standalone-3.5.0.jar" -role hub 
  java -Dwebdriver.gecko.driver="C:/selenium/geckodriver.exe" -jar "selenium-server-standalone-3.5.0.jar" -role node -hub http://localhost:4444/grid/register 
  </code></pre>
  
  <p>Maven POM:</p>
  
  <pre><code>&lt;groupId&gt;junit&lt;/groupId&gt;
  &lt;artifactId&gt;junit&lt;/artifactId&gt;
  &lt;version&gt;4.11&lt;/version&gt;
  &lt;scope&gt;test&lt;/scope&gt;
  
  &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
  &lt;artifactId&gt;selenium-java&lt;/artifactId&gt;
  &lt;version&gt;3.4.0&lt;/version&gt;
  </code></pre>
  
  <p>Java Class (imports excluded):</p>
  
  <pre><code>public class GoogleSearchTest extends TestCase {
  public void testApp() throws MalformedURLException {
      DesiredCapabilities cap = DesiredCapabilities.firefox();
      cap.setPlatform(Platform.ANY);
  
      driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), cap);
      driver.navigate().to("http://www.google.com/");    
  }     }
  </code></pre>
  
  <p>Error stack:</p>
  
  <pre><code>Problem accessing /wd/hub/session. Reason:
  Caused by: java.lang.NullPointerException **    at com.google.gson.JsonPrimitive.isPrimitiveOrString(JsonPrimitive.java:278)
  at com.google.gson.JsonPrimitive.setValue(JsonPrimitive.java:101)
  at com.google.gson.JsonPrimitive.&amp;lt;init&amp;gt;(JsonPrimitive.java:65)
  at org.openqa.selenium.remote.server.ExceptionHandler.lambda$execute$0(ExceptionHandler.java:82)
  at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
  at java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source)
  at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
  at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
  at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
  at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
  at java.util.stream.ReferencePipeline.collect(Unknown Source)
  </code></pre>
  
  <p>This error appears to occur very early in the automation test. Questions i don't yet have the answer to: What would be the JSON payload that is sent, Are there additional Capabilities that i need to configure.</p>
  
  <p>Similar Post</p>