Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Firebase [jvm v2.5.0] - class not found

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am just starting to use firebase in a Java program (not Android) and so far, everything was fine (I could login, create user, add data, retrieve data and delete data from firebase). But, all of a sudden, I keep getting the following error:

Caused by: java.lang.ClassNotFoundException: com.firebase.client.Firebase$AuthResultHandler
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source) ... 20 more


The part that is getting this error is:


I am really stumped as to what to do because I didn't have this error previously and one night once I close my pc and restart, this error keeps coming up.

*I am using Eclipse MARS

Note: I would like to say that I first posted this question on Stack Overflow yet there was no answer there at all thus the repost over here.
Link to question in stack overflow: http://stackoverflow.com/questions/35324744/firebase-jvm-v2-5-0-class-not-found
 
Marshal
Posts: 26481
81
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch!

When you say you are using Firebase, that must mean that you got some code from somewhere and put it into your classpath. And when you did that, somehow that inner class didn't get included in the process. So could you describe how you got the code and how you copied it to your system?
 
Lee Kiong Tan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I right click on it (do remember I am using Eclipse Mars) and add to build path.
 
Paul Clapham
Marshal
Posts: 26481
81
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is the thing you right-click on a jar file?

And if so, who put the jar file into your computer? As far as I know Firebase isn't included as part of Eclipse Mars -- I don't have it in my copy, for example.
 
Lee Kiong Tan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ouch!
So sorry for not being explicit enough.

I downloaded the firebase jar file from (http://mvnrepository.com/artifact/com.firebase/firebase-client-jvm/2.2.3). No, I didn't use maven as the project is not a maven project.

yes. I right click on the jar file to add it into the build path.
On viewing the contents of the jar file, the class "com.firebase.client.Firebase$AuthResultHandler" is present.
Thus, I am not sure as to where would the sub class would be added into the build path?
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, this is at runtime, so maybe its not on the runtime path?
The code could be quite happy compiling, but the jar may not be accessible when you try and run it.
 
Paul Clapham
Marshal
Posts: 26481
81
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for reporting the cross-post on Stack Overflow, by the way. We appreciate knowing about that sort of thing.

Not surprising it didn't get an answer, though. Stack Overflow is strictly a question and answer site so the best you would get over there is "java.lang.ClassNotFoundException always means the class isn't on your classpath". And since the question must have already been asked over there tens of thousands of times already, perhaps SO people are uninterested in answering it yet again.

However beginners are often unaware of what the classpath is, or how to set it, or the fact that it has to be set properly every time you run a Java app, or that it works differently in web apps and executable jars, and on and on. At least here you'll get some discussion about the problem.
 
Just let me do the talking. Ahem ... so ... you see ... we have this tiny ad...
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic