MiguelAngelVega / openid4java

Automatically exported from code.google.com/p/openid4java
Apache License 2.0
0 stars 0 forks source link

ClientProtocolException NoClassDefFoundError on 0.9.6 #149

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using the jar for 0.9.6 I am getting a NoClassDefFoundError error when trying 
to create an instance of the ConsumerManager.

I'm using Railo, a cfml engine, to create the object so the errors may not look 
the same as the normal java application.

org/apache/http/client/ClientProtocolException
   at java.net.URLClassLoader$1.run(URLClassLoader.java:217):217
   at java.security.AccessController.doPrivileged(Native Method):-2
   at java.net.URLClassLoader.findClass(URLClassLoader.java:205):205
   at java.lang.ClassLoader.loadClass(ClassLoader.java:321):321
   at java.lang.ClassLoader.loadClass(ClassLoader.java:266):266
   at org.openid4java.consumer.ConsumerManager.<init>(ConsumerManager.java:167):167
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method):-2
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57):57
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45):45
   at java.lang.reflect.Constructor.newInstance(Constructor.java:532):532

To test you can download the express version of railo 
(http://www.getrailo.org/index.cfm/download/) and put this in the webroot's 
index.cfm page along with the jar in the same directory:

<cfset openIDConsumer = createObject('java', 
'org.openid4java.consumer.ConsumerManager', 'openid4java-0.9.6.jar').init() />

<cfdump var="#openIDConsumer#" />

It was working fine with 0.9.5. If you switch between using the 0.9.5 jar and 
0.9.6 jar you will need to restart railo.

Original issue reported on code.google.com by Zoram...@gmail.com on 20 Apr 2011 at 10:25

GoogleCodeExporter commented 9 years ago
I had the same problem and solved it. My app runs on struts2 instead of Railo, 
but I hope this could be of some help.

The 0.9.6 doesn't come with httpclient.jar(I think), and it is depending on you 
to have it in your classpath. I added httpclient-4.0.1.jar to my app's 
classpath and this exception went away.

More class-not-found exceptions need to be fixed after this to allow 
ConsumerManager to initiate ok. Like httpclient.jar, you just need to find the 
missing jars, and add to your classpath. For me they are:

guice-3.0.jar, javax.inject.jar(comes with guice package), and 
httpcore-4.0.1.jar.

Original comment by cindyzho...@gmail.com on 30 Jan 2012 at 9:12

GoogleCodeExporter commented 9 years ago
Httpclient is part of the distribution, see README and INSTALL.

Original comment by Johnny.B...@gmail.com on 31 Oct 2012 at 10:12