0

I'm using Eclipse with Tomcatserver 8. In my Project I'm using WebSockets, AJAX and SSE. When I tried to run the project i get the Errormessag: "java.lang.ClassNotFoundException: org.json.JSONException" I already tried to delete the Tomcatserver and put it back in to the project but it didn't fixed the problem.

This is the Error:

Caused by: java.lang.NoClassDefFoundError: org/json/JSONException
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    at java.lang.Class.getDeclaredMethods(Unknown Source)
    at org.apache.tomcat.websocket.pojo.PojoMethodMapping.<init>(PojoMethodMapping.java:86)
    at org.apache.tomcat.websocket.server.WsServerContainer.addEndpoint(WsServerContainer.java:190)
    at org.apache.tomcat.websocket.server.WsServerContainer.addEndpoint(WsServerContainer.java:278)
    at org.apache.tomcat.websocket.server.WsSci.onStartup(WsSci.java:120)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5244)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 6 more
Caused by: java.lang.ClassNotFoundException: org.json.JSONException
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)
    ... 15 more

I hope someone can help me.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
WeSt
  • 889
  • 5
  • 14
  • 32

1 Answers1

0

The exception indicates it is missing some JSON library in your webapp. Check your web-inf/lib folder and add that jar file.

  • tanks for your answer. But the JSON lib is included. I removed it and put it back again but it didn't work. Here is a screenshot of the lib http://fs5.directupload.net/images/151212/pbw9ni76.jpg – WeSt Dec 12 '15 at 16:51
  • It looks like a classloading problem. Can you place the json jar in common/lib folder of Tomcat and try it. – Madhusudana Reddy Sunnapu Dec 13 '15 at 04:43