title: Access to a long value in a JSON string from Java
body: <p>I want to get the value of the long "transmitBytes" in this JSON string</p>
  
  <pre><code>[
  
      {
         "portNumber" : 2,
  
         "queueId" : 0,
  
         "transmitBytes" : 1944145,
  
         "transmitPackets" : 1684,
  
         "transmitErrors" : 0
      }
  
  ]
  </code></pre>
  
  <p>I have used the org.json library and implemented the code: </p>
  
  <pre><code>    String queueJson = [{"portNumber":2,"queueId":0,"transmitBytes":1944145,"transmitPackets":1684,"transmitErrors":0}];
  
      System.out.println("The JSON string is: " + queueJson);
  
  
       JSONObject obj; 
  
       try { 
       obj = new JSONObject(queueJson); 
       long TXbytes =  obj.getLong("transmitBytes");
       System.out.println("The amount of transmittet bytes is " + TXbytes);
       } catch (JSONException e) { 
               // TODO Auto-generated catch block
       e.printStackTrace(); 
       }
  </code></pre>
  
  <p>The issue occurs, when I'm running the Apache tomcat web server. Following error occurs: </p>
  
  <pre><code>SEVERE: A child container failed during start
  </code></pre>
  
  <p>with following:</p>
  
  <pre><code>org.apache.catalina.LifecycleException: Failed to start component
  </code></pre>
  
  <p>When I remove the JSONObject class and the corresponding org.json library, everything works fine, and the server runs without any issues. Does anyone know why this issue occurs, and are there another libraries available to access a long value in a JSON string from Java ?. </p>
  
  <p>Thanks in advance </p>