Sender Class - GCM Example - Java App Engine

I am using a Google example (gcm-demo-appengine - Google Demo )

but I think there may be some problems with google source code, when I run it, it throws


java.lang.NoClassDefFoundError: com / google / android / gcm / server / Sender
in cloud.spam.filter.server.SendMessageServlet.newSender (SendMessageServlet.java:63)
in cloud.spam.filter.server.SendMessageServlet.init (SendMessageServlet .java: 54)

There are some problems with the sender class (seriously?)
Is it possible to replace the sender class with something else? This is the first time I use GCM, so I have no idea how important the sender class is and what it is used for.
Many thanks.

+5
source share
3 answers

Make sure your gcm-server.jar is located in the war / WEB-INF / lib folder of your project. Nothing else will do

+5
source

The sender needs lib for JSON to work. In my case, just put the json-simple-1.1.1.jar file in war / WEB-INF / lib and set the jar path as a link. Finally, the NoClassDefFoundError problem has been resolved.

0
source

Just clear the project, make sure you include json-simple-1.1.1.jar. If this does not work, add the jar files to the libraries in the java build path and clean up the project.

0
source

All Articles