Link to home
Start Free TrialLog in
Avatar of marcelocbf
marcelocbf

asked on

Another java.lang.noClassDefFoundError (JRADIUS)

Hello,

I'm developing an application to use a library JRadius. I downloaded their package with some .JAR files in it. I added them to Netbeans, developed, tested (some parts, because of the nature of the application, but runs fine).

But I get NoClassDefFoundError when trying to run on the server ... I really have no idea what that should be, and I'm tired of testing .. maybe there is something I'm missing.

The .JAR files are on the classpath, I downloaded them 3 times to make sure they are not corrupted

Below is my ClassPath variable

CLASSPATH=/var/lib/jre1.6.0_11/lib/mysql-connector-java-5.1.6-bin.jar:/var/lib/jre1.6.0_11/lib/jradius-core-1.0.0.jar:/var/lib/jre1.6.0_11/lib/jradius-dictionary-1.0.0.jar:/var/lib/jre1.6.0_11/lib/jradius-extended-1.0.0.jar:/var/lib/jre1.6.0_11/lib/gnu-crypto-2.0.1.jar:/var/lib/jre1.6.0_11/lib/bcprov-jdk15-140.jar:/var/lib/jre1.6.0_11/lib


Thanks in advance,

Here is the error ...

Exception in thread "main" java.lang.NoClassDefFoundError: net/jradius/packet/attribute/RadiusAttribute
Caused by: java.lang.ClassNotFoundException: net.jradius.packet.attribute.RadiusAttribute
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        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)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Open in new window

Avatar of Mick Barry
Mick Barry
Flag of Australia image

how are you running it on the server?

Avatar of marcelocbf
marcelocbf

ASKER

I invoked it in a lot of ways ...
My class is in a JAR file with it as a Main class ...

java -jar MYJAR.jar
java -jar MYJAR.jar -Xdebug
java -cp MYJAR.jar my.package.MainClass

java -cp var/lib/jre1.6.0_11/lib/mysql-connector-java-5.1.6-bin.jar:/var/lib/jre1.6.0_11/lib/jradius-core-1.0.0.jar:/var/lib/jre1.6.0_11/lib/jradius-dictionary-1.0.0.jar:/var/lib/jre1.6.0_11/lib/jradius-extended-1.0.0.jar:/var/lib/jre1.6.0_11/lib/gnu-crypto-2.0.1.jar:/var/lib/jre1.6.0_11/lib/bcprov-jdk15-140.jar:/var/lib/jre1.6.0_11/lib -jar MYJAR.jar

ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
java -cp var/lib/jre1.6.0_11/lib/mysql-connector-java-5.1.6-bin.jar:/var/lib/jre1.6.0_11/lib/jradius-core-1.0.0.jar:/var/lib/jre1.6.0_11/lib/jradius-dictionary-1.0.0.jar:/var/lib/jre1.6.0_11/lib/jradius-extended-1.0.0.jar:/var/lib/jre1.6.0_11/lib/gnu-crypto-2.0.1.jar:/var/lib/jre1.6.0_11/lib/bcprov-jdk15-140.jar:/var/lib/jre1.6.0_11/lib:MYJAR.jar my.package.MainClass

Man ... Just three words I LOVE YOU !!!!

Three days I've spent on this ...

How can't I find this information elsewhere on the web ????

Thanks again ...
cause theres so much rubbish on the web these days its becoming increasingly difficult to find the answers you need.

glad I could help you out :)