ClassNotFoundException after refactoring - java

I recently refactored my Java Project, and when performing a login task, I receive the following error (Note that it actually loads up fine) :
java.lang.ClassNotFoundException: org.chal614.model.player.Player
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)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:266)
at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:623)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1610)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at org.entice.util.Serializer.load(Serializer.java:63)
at org.entice.util.Serializer.LoadAccount(Serializer.java:124)
at org.entice.net.codec.LoginDecoder.decode(LoginDecoder.java:103)
at org.entice.net.codec.ConnectionWorker.run(ConnectionWorker.java:43)
at org.entice.net.ServerChannelHandler.messageReceived(ServerChannelHandler.java:107)
at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:98)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:560)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:555)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:345)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:332)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:323)
at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:275)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:196)
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at org.jboss.netty.util.internal.IoWorkerRunnable.run(IoWorkerRunnable.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
My previous packaging was org.chal614, however it is now org.entice
Naturally I have checked around, and there are no signs of chal614 references. I am now assuming this is something to do with IDE, rather than within the java code itself. Help would be appreciated.

Related

java.lang.NoClassDefFoundError: org/apache/http/client/ClientProtocolException while using the jsonparser()

java.lang.NoClassDefFoundError: org/apache/http/client/ClientProtocolException
at situasses.Situassess.<init>(Situassess.java:24)
at myproject.RecomAgent.setup(RecomAgent.java:33)
at jade.core.Agent$ActiveLifeCycle.init(Agent.java:1522)
at jade.core.Agent.run(Agent.java:1468)
at java.lang.Thread.run(Thread.java:744)Caused by: java.lang.ClassNotFoundException: org.apache.http.client.ClientProtocolException
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:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 5 more
ERROR: Agent user61 died without being properly terminated !!!
State was 2
Add HTTPClient.jar to your classpath. And also check this for details.

nodejs connecting to hbase via phoenix and druid

I have Phoenix installed phoenix-4.3.1 and successfully connected to it to hbase via sqline
Both on a machine that is part of the cluster as well as a machine that is not part of the cluster and has no hadoop components; just access to zookeeper
sqlline access is fine, but connecting via app (npm) via druid is running into an error
I found npm
https://github.com/gaodazhu/phoenix-client
I am getting the following
May 22, 2015 2:08:25 AM com.alibaba.druid.pool.DruidDataSource error
SEVERE: dataSource init error
java.sql.SQLException: org.apache.phoenix.jdbc.PhoenixDriver
at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:514)
at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:565)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:878)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:874)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:97)
at com.mlsc.DBClient.query(DBClient.java:134)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
Caused by: java.lang.ClassNotFoundException: org.apache.phoenix.jdbc.PhoenixDriver
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:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:191)
at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:512)
... 9 more
May 22, 2015 2:08:25 AM com.alibaba.druid.pool.DruidDataSource info
INFO: {dataSource-1} inited
java.sql.SQLException: org.apache.phoenix.jdbc.PhoenixDriver
at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:514)
at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:565)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:878)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:874)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:97)
at com.mlsc.DBClient.query(DBClient.java:134)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
Caused by: java.lang.ClassNotFoundException: org.apache.phoenix.jdbc.PhoenixDriver
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:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:191)
at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:512)
Have you tried create a 'TEST' table in Phoenix? And make sure to insert some rows into the 'TEST' table.

OpenCV Libraries in Hadoop

I wrote one simple application in which I am using OpenCV. I put all the jar files in /usr/local/hadoop/lib folder. While running the hadoop job, I am getting the following error:
java.lang.Exception: java.lang.NoClassDefFoundError: com/googlecode/javacv/cpp/opencv_core$CvArr
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:399)
Caused by: java.lang.NoClassDefFoundError: com/googlecode/javacv/cpp/opencv_core$CvArr
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at org.apache.hadoop.conf.Configuration.getClassByNameOrNull(Configuration.java:1486)
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:1456)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1545)
at org.apache.hadoop.mapreduce.task.JobContextImpl.getMapperClass(JobContextImpl.java:186)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:686)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:333)
at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:231)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.ClassNotFoundException: com.googlecode.javacv.cpp.opencv_core$CvArr
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:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 15 more
Any idea how to resolve this?
You could try using the option libjars when running the hadoop job. Try the following:
hadoop jar yourjar.jar MainClass -libjars /path/to/external/jar
More information here.

Runtime error upon running compiled Groovy code in IntelliJ IDEA 13

I keep getting this error when I attempt to run compiled Groovy code in IntelliJ IDEA 13:
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin/java -Didea.launcher.port=7539 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 13.app/bin" -Dfile.encoding=UTF-8 -classpath "/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/lib/javafx-doclet.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/htmlconverter.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Users/Insanity/Documents/Programming/Programming Languages/Groovy/Asteroids!/out/production/Asteroids!:/Users/Insanity/Desktop/:usr:local/opt/groovy/libexec/lib/ant-1.9.2.jar:local/opt/groovy/libexec/lib/ant-antlr-1.9.2.jar:local/opt/groovy/libexec/lib/ant-junit-1.9.2.jar:local/opt/groovy/libexec/lib/ant-launcher-1.9.2.jar:local/opt/groovy/libexec/lib/antlr-2.7.7.jar:local/opt/groovy/libexec/lib/asm-4.1.jar:local/opt/groovy/libexec/lib/asm-analysis-4.1.jar:local/opt/groovy/libexec/lib/asm-commons-4.1.jar:local/opt/groovy/libexec/lib/asm-tree-4.1.jar:local/opt/groovy/libexec/lib/asm-util-4.1.jar:local/opt/groovy/libexec/lib/bsf-2.4.0.jar:local/opt/groovy/libexec/lib/commons-cli-1.2.jar:local/opt/groovy/libexec/lib/commons-logging-1.1.1.jar:local/opt/groovy/libexec/lib/gpars-1.1.0.jar:local/opt/groovy/libexec/lib/groovy-2.2.2.jar:local/opt/groovy/libexec/lib/groovy-ant-2.2.2.jar:local/opt/groovy/libexec/lib/groovy-bsf-2.2.2.jar:local/opt/groovy/libexec/lib/groovy-console-2.2.2.jar:local/opt/groovy/libexec/lib/groovy-docgenerator-2.2.2.jar:local/opt/groovy/libexec/lib/groovy-groovydoc-2.2.2.jar:local/opt/groovy/libexec/lib/groovy-groovysh-2.2.2.jar:local/opt/groovy/libexec/lib/groovy-jmx-2.2.2.jar:local/opt/groovy/libexec/lib/groovy-json-2.2.2.jar:local/opt/groovy/libexec/lib/groovy-jsr223-2.2.2.jar:local/opt/groovy/libexec/lib/groovy-servlet-2.2.2.jar:local/opt/groovy/libexec/lib/groovy-sql-2.2.2.jar:local/opt/groovy/libexec/lib/groovy-swing-2.2.2.jar:local/opt/groovy/libexec/lib/groovy-templates-2.2.2.jar:local/opt/groovy/libexec/lib/groovy-test-2.2.2.jar:local/opt/groovy/libexec/lib/groovy-testng-2.2.2.jar:local/opt/groovy/libexec/lib/groovy-xml-2.2.2.jar:local/opt/groovy/libexec/lib/hamcrest-core-1.3.jar:local/opt/groovy/libexec/lib/ivy-2.3.0.jar:local/opt/groovy/libexec/lib/jansi-1.10.jar:local/opt/groovy/libexec/lib/jcommander-1.27.jar:local/opt/groovy/libexec/lib/jline-2.10.jar:local/opt/groovy/libexec/lib/jsp-api-2.0.jar:local/opt/groovy/libexec/lib/jsr166y-1.7.0.jar:local/opt/groovy/libexec/lib/junit-4.11.jar:local/opt/groovy/libexec/lib/multiverse-core-0.7.0.jar:local/opt/groovy/libexec/lib/qdox-1.12.1.jar:local/opt/groovy/libexec/lib/servlet-api-2.4.jar:local/opt/groovy/libexec/lib/testng-6.8.5.jar:local/opt/groovy/libexec/lib/xmlpull-1.1.3.1.jar:local/opt/groovy/libexec/lib/xstream-1.4.4.jar:/Users/Insanity/Documents/Programming/Programming Languages/Java/Libraries/Java Game Libraries/slick/lib/slick.jar:/Users/Insanity/Documents/Programming/Programming Languages/Java/Libraries/Java Game Libraries/lwjgl-2.9.1/jar/lwjgl.jar:/Applications/IntelliJ IDEA 13.app/lib/idea_rt.jar" com.intellij.rt.execution.application.AppMain com.insanity.asteroids.Init
Exception in thread "main" java.lang.NoClassDefFoundError: groovy/lang/GroovyObject
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
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:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:113)
Caused by: java.lang.ClassNotFoundException: groovy.lang.GroovyObject
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:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 15 more
Process finished with exit code 1
By the looks of it the Groovy libs are not being found or something.
The problem is that I was using a symlink that pointed to /usr/local. The error was fixed by changing the classpath to use the direct path of /usr/local instead of a symlink.
tl;dr: Don't set your classpath in IntelliJ using a symlink.

Java RMI NoClassDefFoundError (development on Netbeans IDE)

I'm a student, and I'm trying to write an RMI application.
I have 3 separate projects:
One is Server Side
One is Common (include Interface and Entities to reflect with Database Structure)
One is Client
and I write it on Netbeans IDE.
When I start server I receive a printstack error like this:
Exception in thread "main" java.lang.NoClassDefFoundError: rmi/cosmetic/Interfaces/ICategories
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
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)
at Server.ServerSide.main(ServerSide.java:22)
Caused by: java.lang.ClassNotFoundException: rmi.cosmetic.Interfaces.ICategories
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)
... 13 more
Java Result: 1
rmi/cosmetic/Interfaces/ICategories
is the path of file Interface Categories, it has been contained in Common Project for both of 2 sides client and server
I have no idea about this issue. I try to set classpath on my windows but it didn't work.
Can someone please help me?
Some images, to make it clear
http://upanh.7nghiep.com/vgo-images/vgo.vn-qIntT.jpg
http://upanh.7nghiep.com/vgo-images/vgo.vn-jaJw0.jpg
upanh.7nghiep.com/vgo-images/vgo.vn-RvxIo.jpg
upanh.7nghiep.com/vgo-images/vgo.vn-DvuMt.jpg
upanh.7nghiep.com/vgo-images/vgo.vn-OI9rL.jpg
Caused by: java.lang.ClassNotFoundException:
rmi.cosmetic.Interfaces.ICategories
There's your problem right there. Your Registry or your client can't find that class. It needs to be on their CLASSPATH.

Categories

Resources