-2

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

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
m 1987
  • 153
  • 2
  • 14
  • 1
    Did you Try posting The Exception in Google – Kukeltje Nov 28 '16 at 16:21
  • i tried but never got a solution – m 1987 Nov 28 '16 at 16:23
  • i posted the error in google and found lots of hints that point to what is in the answer below – Kukeltje Nov 28 '16 at 23:04
  • i tried the solution below but nothing changed ... Kukeltje – m 1987 Nov 28 '16 at 23:16
  • I doubt that if you added Apache commons logging **correctly** this error still happens – Kukeltje Nov 28 '16 at 23:18
  • as mentioned before .. when i added Apache commons logging to my project .. the server error stack is gone .. but that didn't solve my real problem – m 1987 Nov 28 '16 at 23:29
  • The title of this question is kind of to broad. The class not found exception is gone so this real problem is solved and this question is a duplicate of ,any others. Close it, remove it or whatever amd create a new question about the next problem and describe and analyze it carefully. – Kukeltje Nov 29 '16 at 08:51
  • And above you said you tried ot and nothing changed... contradictory comments – Kukeltje Nov 29 '16 at 08:52
  • I 'corrected' the title and tags for you, so you have an impression what a better title is and the tags to. I removed the android tag since this real CNFE occures server side and is not related to using android (it would fail from a desktop to) – Kukeltje Nov 29 '16 at 09:02

1 Answers1

0

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

FrancescoAzzola
  • 2,666
  • 2
  • 15
  • 22