eclipse-archived / californium.core

Californium project
86 stars 69 forks source link

java.lang.NoClassDefFoundError with Netbeans and maven project #15

Closed mcicolella closed 10 years ago

mcicolella commented 10 years ago

Hi, I'm experimenting a problem with my project including californium lib. I added repositories and dependency in my pom.xml. Compilation is OK. But when I run the application there is the following error Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/californium/core/CoapClient I noted that in lib folder there is the file californium-core-1.0.0-SNAPSHOT.jar but in MANIFEST.MF in classpath it's reported as lib/californium-core-1.0.0-20140715.144519-3.jar (the last part changes at any new recompilation date/hour). Changing manually the path in MANIFEST.MF the previous problem is fixed but I have

Create standard properties with file Californium.properties Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/californium/elements/Connector

Maybe I'm missing something. Can you help me? Thanks

jvermillard commented 10 years ago

Are you using OSGi?

mcicolella commented 10 years ago

No. My code is available at https://github.com/mcicolella/freedomotic/tree/coap-client/plugins/devices/coap-client

jvermillard commented 10 years ago

Great :) Let me check

jvermillard commented 10 years ago

hmm I see no problem with eclipse

blemmens commented 10 years ago

Might be related to this bug in maven-jar-plugin. Try either the proposed workaround (add <useUniqueVersions>false</useUniqueVersions> at https://github.com/mcicolella/freedomotic/blob/coap-client/pom.xml#L520) or try a different version of the maven-jar-plugin.

mcicolella commented 10 years ago

Hi all, @blemmens your workround solved the problem. Thanks a lot for help.