m 1987 m 1987 - 1 year ago 111
Java Question

java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory

I am trying to send a notification using this class FCMHelper and im getting errors
errors leading me to an error in httpclient
this is my code ...

public void send() throws IOException{
JsonObject notificationObject = new JsonObject();
notificationObject.addProperty("data", "hello");
notificationObject.addProperty("to", "dSvX_cWo5iY:A......QQT-bkb8x0VO");
FireBase firebase = FireBase.getInstance();
firebase.sendNotification("to", "condition", notificationObject);

i got this error

Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1783)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1633)
... 58 more

what the problem here or if someone could give any other way to do it

.. thanks for your help

Answer Source

It seems "org/apache/commons/logging/LogFactory" is missed. Have you imported the library?