Reputation: 4600
I am simple trying to Instantiate and instance of Factual class like so:
Factual factual = new Factual(key, secret);
Every time I start the load i get error:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/google/api/client/http/HttpResponseException
I have loaded all the correct jar files and rechecked all the code to make sure I wasn't missing anything. All my imports are correct and dependencies are good.
Stack:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/google/api/client/http/HttpResponseException
at mygasfeedquery.FactualHelper.<init>(FactualHelper.java:19)
at mygasfeedquery.mainGUI.jButton1ActionPerformed(mainGUI.java:320)
at mygasfeedquery.mainGUI.access$200(mainGUI.java:18)
at mygasfeedquery.mainGUI$3.actionPerformed(mainGUI.java:188)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2713)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707)
at java.awt.EventQueue.access$000(EventQueue.java:101)
at java.awt.EventQueue$3.run(EventQueue.java:666)
at java.awt.EventQueue$3.run(EventQueue.java:664)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:680)
at java.awt.EventQueue$4.run(EventQueue.java:678)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:677)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.ClassNotFoundException: com.google.api.client.http.HttpResponseException
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
Upvotes: 0
Views: 2454
Reputation: 1974
This error may occurs when any library jar file missing or unable to locate, if you're using netbeans framework and your project name in left side bar is displaying in red font color it indicates project need some fixing. To resolve this right-click on your project name then click on resolve project problem there it will tell you what the exactly problem there and which files are missing or unable to locate then you can set that missing files to your framework.
Upvotes: 0
Reputation: 4600
This error was for dependency http://mvnrepository.com/artifact/com.google.http-client/google-http-client/1.7.0-beta
Once I loaded the google-api-client jar it gave me a new error. But then then someone mentioned that dependencies may depend of other dependencies. So I looked in the repo and found the ones that I needed based on that.
Basically I did not have all the jars that I needed for each one and I didn't know that dependencies can depend of each other.
Upvotes: 1