java - A single jar throws ClassNotFoundException AFTER I have compiled -
i have 9 jar files in project/lib folder , classpath appears accurate. works fine before compile, after compiling single jar, stringtree-json-2.0.5.jar, throws classnotfoundexception when try run it.
things i've tried:
- using '*' load in lib folder @ once
- switched using jackson (assuming jar specific), stringtree has exact same problem. offending jar json parser use once (in pivotal area).
- tried altering classpath before , after compile insure it's correct.
- probably lot more don't remember... been stuck on week or so.
here's error it's thrown:
org.bukkit.command.commandexception: unhandled exception executing command 'rate' in plugin pariah v1 @ org.bukkit.command.plugincommand.execute(plugincommand.java:46) @ org.bukkit.command.simplecommandmap.dispatch(simplecommandmap.java:189) @ org.bukkit.craftbukkit.v1_5_r2.craftserver.dispatchcommand(craftserver.java:523) @ net.minecraft.server.v1_5_r2.playerconnection.handlecommand(playerconnection.java:966) @ net.minecraft.server.v1_5_r2.playerconnection.chat(playerconnection.java:884) @ net.minecraft.server.v1_5_r2.playerconnection.a(playerconnection.java:841) @ net.minecraft.server.v1_5_r2.packet3chat.handle(packet3chat.java:44) @ net.minecraft.server.v1_5_r2.networkmanager.b(networkmanager.java:292) @ net.minecraft.server.v1_5_r2.playerconnection.d(playerconnection.java:110) @ net.minecraft.server.v1_5_r2.serverconnection.b(sourcefile:35) @ net.minecraft.server.v1_5_r2.dedicatedserverconnection.b(sourcefile:30) @ net.minecraft.server.v1_5_r2.minecraftserver.r(minecraftserver.java:580) @ net.minecraft.server.v1_5_r2.dedicatedserver.r(dedicatedserver.java:225) @ net.minecraft.server.v1_5_r2.minecraftserver.q(minecraftserver.java:476) @ net.minecraft.server.v1_5_r2.minecraftserver.run(minecraftserver.java:409) @ net.minecraft.server.v1_5_r2.threadserverapplication.run(sourcefile:573) caused by: java.lang.noclassdeffounderror: org/stringtree/json/jsonreader @ pariah.allmethods.ratingcall(allmethods.java:351) @ pariah.allmethods.getpathrankrating(allmethods.java:308) @ pariah.pariah.oncommand(pariah.java:63) @ org.bukkit.command.plugincommand.execute(plugincommand.java:44) ... 15 more caused by: java.lang.classnotfoundexception: org.stringtree.json.jsonreader @ java.net.urlclassloader$1.run(urlclassloader.java:217) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(urlclassloader.java:205) @ org.bukkit.plugin.java.pluginclassloader.findclass0(pluginclassloader.java:80) @ org.bukkit.plugin.java.pluginclassloader.findclass(pluginclassloader.java:53) @ java.lang.classloader.loadclass(classloader.java:321) @ java.lang.classloader.loadclass(classloader.java:266) ... 19 more
this current classpath:
<?xml version="1.0" encoding="utf-8"?> <classpath> <classpathentry including="**/*.java" kind="src" output="target/classes" path="src"> <attributes> <attribute name="optional" value="true"/> <attribute name="maven.pomderived" value="true"/> </attributes> </classpathentry> <classpathentry kind="src" output="target/test-classes" path="test"> <attributes> <attribute name="optional" value="true"/> <attribute name="maven.pomderived" value="true"/> </attributes> </classpathentry> <classpathentry exported="true" kind="lib" path="lib/commons-codec-1.6.jar"/> <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.1.1.jar"/> <classpathentry exported="true" kind="lib" path="lib/httpclient-4.2.2.jar"/> <classpathentry exported="true" kind="lib" path="lib/httpclient-cache-4.2.2.jar"/> <classpathentry exported="true" kind="lib" path="lib/httpcore-4.2.2.jar"/> <classpathentry exported="true" kind="lib" path="lib/httpmime-4.2.2.jar"/> <classpathentry exported="true" kind="lib" path="lib/stringtree-json-2.0.5.jar"/> <classpathentry exported="true" kind="lib" path="lib/bukkit-1.5.1-r0.1-20130325.184829-14.jar"/> <classpathentry kind="con" path="org.eclipse.jdt.junit.junit_container/4"/> <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.jre_container/org.eclipse.jdt.internal.debug.ui.launcher.standardvmtype/javase-1.6"> <attributes> <attribute name="maven.pomderived" value="true"/> </attributes> </classpathentry> <classpathentry exported="true" kind="con" path="org.eclipse.m2e.maven2_classpath_container"> <attributes> <attribute name="maven.pomderived" value="true"/> </attributes> </classpathentry> <classpathentry kind="output" path="target/classes"/> </classpath>
i'm using eclipse develop , compile. 1 oft repeated suggestion solving export project runnable jar file. however, plugin , has no 'main' method.
any other ideas out there? feel i've exhausted (...myself and) options i've found on google , stackoverflow.
thanks!
just thinking around transitive dependencies of jar. think have following class jsonreader in 1 of jars. using jackson or such frameworks, have come across transitive dependency of jars, jackson jar dependent on other jars. @ compile time transitive dependencies not required @ run time , end facing noclassdeffound error.
if case, suggest use maven avoiding such dependencies hassles.
Comments
Post a Comment