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.

0

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

2 Comments

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 fs5.directupload.net/images/151212/pbw9ni76.jpg
It looks like a classloading problem. Can you place the json jar in common/lib folder of Tomcat and try it.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.