-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

9
  • 1
    Did you Try posting The Exception in Google Commented Nov 28, 2016 at 16:21
  • i tried but never got a solution Commented Nov 28, 2016 at 16:23
  • i posted the error in google and found lots of hints that point to what is in the answer below Commented Nov 28, 2016 at 23:04
  • i tried the solution below but nothing changed ... Kukeltje Commented Nov 28, 2016 at 23:16
  • I doubt that if you added Apache commons logging correctly this error still happens Commented Nov 28, 2016 at 23:18

1 Answer 1

0

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

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

5 Comments

im not using LogFactory in my bean neither the class FCMHelper do .. why should i import it ??
The log says ClassNotFoundException...so you should try IMO
i tried it and got nothing .. but the server error stack didn't appear
im still fresh student in JSF and android and mr @ FrancescoAzzola gave a reasonable solution .. but it didn't work in my case
i receive notification from firebase console but i couldn't send json from jsf to firebase ..

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.