[SOLVED]ttorrent - java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory [duplicate] - java

I'm trying to run my project outside of my IDE and I'm getting this java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
It works fine inside the IDE but when trying to run it from a batch file it's loading the application panel and throwing this error.
I have included all of the libraries in the batch file, all of them are present and they are the same libraries that are used inside of the IDE.
java -cp bin;deps/InetAddressLocator.jar;deps/lombok.jar;deps/commons-collections4-4.0.jar;deps/mina-core-1.1.7.jar;deps/mysql.jar;deps/slf4j-api-1.6.1;deps/slf4j-simple-1.6.1.jar; game.engine.GameEngine true 0 0
pause
How can I fix this?
[02/06/2014 12:42:52 AM]: Exception in thread "main"
[02/06/2014 12:42:52 AM]: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
[02/06/2014 12:42:52 AM]: at org.apache.mina.util.NamePreservingRunnable.<init>(NamePreservingRunnable.java:32)
[02/06/2014 12:42:52 AM]: at org.apache.mina.transport.socket.nio.SocketAcceptor.startupWorker(SocketAcceptor.java:165)
[02/06/2014 12:42:52 AM]: at org.apache.mina.transport.socket.nio.SocketAcceptor.bind(SocketAcceptor.java:141)
[02/06/2014 12:42:52 AM]: at game.engine.GameEngine.main(GameEngine.java:125)
[02/06/2014 12:42:52 AM]: Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
[02/06/2014 12:42:52 AM]: at java.net.URLClassLoader$1.run(Unknown Source)
[02/06/2014 12:42:52 AM]: at java.net.URLClassLoader$1.run(Unknown Source)
[02/06/2014 12:42:52 AM]: at java.security.AccessController.doPrivileged(Native Method)
[02/06/2014 12:42:52 AM]: at java.net.URLClassLoader.findClass(Unknown Source)
[02/06/2014 12:42:52 AM]: at java.lang.ClassLoader.loadClass(Unknown Source)
[02/06/2014 12:42:52 AM]: at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
[02/06/2014 12:42:52 AM]: at java.lang.ClassLoader.loadClass(Unknown Source)
[02/06/2014 12:42:52 AM]: ... 4 more

In java -cp bin;deps/InetAddressLocator.jar;deps/lombok.jar;deps/commons-collections4-4.0.jar;deps/mina-core-1.1.7.jar;deps/mysql.jar;deps/slf4j-api-1.6.1;deps/slf4j-simple-1.6.1.jar; game.engine.GameEngine true 0 0
slf4j-api-1.6.1 is mising the ".jar" at the end. It should read as "slf4j-api-1.6.1.jar"

I think, better to work with Manifest Files.

Related

getting this error while executing jar file SessionFactory creation failedjava.lang.NoClassDefFoundError: org/hibernate/cfg/ Configuration

i am getting below error while executing my jar file from command promt..but in eclipse when i am running my program it is working fine..not getting what is the exact cause of this error i have tried so many ways which i got from google...
SessionFactory creation failedjava.lang.NoClassDefFoundError: org/hibernate/cfg/
Configuration
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.valto.RetentionMain.HibernateUtil.<clinit>(HibernateUtil.java:26)
at com.valto.RetentionDao.RetentionDao.getNotificationDays(RetentionDao.
java:48)
at com.valto.RetentionMain.RetentionMainClass.cronTask(RetentionMainClas
s.java:19)
at com.valto.RetentionMain.RetentionMainClass.main(RetentionMainClass.ja
va:97)
Caused by: java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
at com.valto.RetentionMain.HibernateUtil.<clinit>(HibernateUtil.java:18)
... 3 more
Caused by: java.lang.ClassNotFoundException: org.hibernate.cfg.Configuration
at java.net.URLClassLoader$1.run(Unknown Source)
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)

Exception in thread “main” dropbox application

I'm trying to make a simple application with Java, using Eclipse that could upload a file from my computer to Dropbox but whenever I compile, I get this error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/conn/params/ConnPerRoute
at javaaplication1.JavaApplication11.main(JavaApplication11.java:32)
Caused by: java.lang.ClassNotFoundException: org.apache.http.conn.params.ConnPerRoute
at java.net.URLClassLoader$1.run(Unknown Source)
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)
... 1 more
Can you help me figure this out?
Thank you in advance.
You miss the httpclient.jar in your classpath. Download it and add it to your classpath.

How can I resolve java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory?

I'm trying to run my project outside of my IDE and I'm getting this java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
It works fine inside the IDE but when trying to run it from a batch file it's loading the application panel and throwing this error.
I have included all of the libraries in the batch file, all of them are present and they are the same libraries that are used inside of the IDE.
java -cp bin;deps/InetAddressLocator.jar;deps/lombok.jar;deps/commons-collections4-4.0.jar;deps/mina-core-1.1.7.jar;deps/mysql.jar;deps/slf4j-api-1.6.1;deps/slf4j-simple-1.6.1.jar; game.engine.GameEngine true 0 0
pause
How can I fix this?
[02/06/2014 12:42:52 AM]: Exception in thread "main"
[02/06/2014 12:42:52 AM]: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
[02/06/2014 12:42:52 AM]: at org.apache.mina.util.NamePreservingRunnable.<init>(NamePreservingRunnable.java:32)
[02/06/2014 12:42:52 AM]: at org.apache.mina.transport.socket.nio.SocketAcceptor.startupWorker(SocketAcceptor.java:165)
[02/06/2014 12:42:52 AM]: at org.apache.mina.transport.socket.nio.SocketAcceptor.bind(SocketAcceptor.java:141)
[02/06/2014 12:42:52 AM]: at game.engine.GameEngine.main(GameEngine.java:125)
[02/06/2014 12:42:52 AM]: Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
[02/06/2014 12:42:52 AM]: at java.net.URLClassLoader$1.run(Unknown Source)
[02/06/2014 12:42:52 AM]: at java.net.URLClassLoader$1.run(Unknown Source)
[02/06/2014 12:42:52 AM]: at java.security.AccessController.doPrivileged(Native Method)
[02/06/2014 12:42:52 AM]: at java.net.URLClassLoader.findClass(Unknown Source)
[02/06/2014 12:42:52 AM]: at java.lang.ClassLoader.loadClass(Unknown Source)
[02/06/2014 12:42:52 AM]: at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
[02/06/2014 12:42:52 AM]: at java.lang.ClassLoader.loadClass(Unknown Source)
[02/06/2014 12:42:52 AM]: ... 4 more
In java -cp bin;deps/InetAddressLocator.jar;deps/lombok.jar;deps/commons-collections4-4.0.jar;deps/mina-core-1.1.7.jar;deps/mysql.jar;deps/slf4j-api-1.6.1;deps/slf4j-simple-1.6.1.jar; game.engine.GameEngine true 0 0
slf4j-api-1.6.1 is mising the ".jar" at the end. It should read as "slf4j-api-1.6.1.jar"
I think, better to work with Manifest Files.

Exception in thread “main” java.lang.NoClassDefFoundError: org/tmatesoft/sqljet/core/SqlJetException

I was trying to get the SVN project to my local directory. But I am getting Exception.
Exception in thread "main" java.lang.NoClassDefFoundError: org/tmatesoft/sqljet/core/SqlJetException
at org.tmatesoft.svn.core.internal.wc17.SVNWCContext.<init>(SVNWCContext.java:278)
at org.tmatesoft.svn.core.internal.wc17.SVNWCContext.<init>(SVNWCContext.java:274)
at org.tmatesoft.svn.core.wc2.SvnOperationFactory.obtainWcContext(SvnOperationFactory.java:1269)
at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1232)
at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:291)
at down.main(down.java:20)
Caused by: java.lang.ClassNotFoundException: org.tmatesoft.sqljet.core.SqlJetException
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)
... 6 more
Thank you
Required jar(sqljet.jar) is not their in your classpath
you can download jar from this link and then set your classpath.

Java Swing and Event errors?

I have been running a game server and I get this error. I'm not really familiar with java yet so please help me out.
I have a couple event managers to handle player events, like woodcutting or mining, and maybe events are not stopped correctly, i'm not sure.
Can you explain what awt event queue is?
This happens when we have the game server running for more than a day. Probably happens every 12 hours or so.
[2/8/12 11:00 AM]: Exception in thread "AWT-EventQueue-0" [2/8/12 11:00 AM]: jav
a.lang.ArrayIndexOutOfBoundsException: 14 >= 14
[2/8/12 11:00 AM]: at java.util.Vector.elementAt(Unknown Source)
[2/8/12 11:00 AM]: at javax.swing.DefaultListModel.getElementAt(Unknown Sou
rce)
[2/8/12 11:00 AM]: at javax.swing.plaf.basic.BasicListUI.paintCell(Unknown
Source)
[2/8/12 11:00 AM]: at javax.swing.plaf.basic.BasicListUI.paintImpl(Unknown
Source)
[2/8/12 11:00 AM]: at javax.swing.plaf.basic.BasicListUI.paint(Unknown Sour
ce)
[2/8/12 11:00 AM]: at javax
.swing.plaf.ComponentUI.update(Unknown Source)
[2/8/12 11:00 AM]: at javax.swing.JComponent.paintComponent(Unknown Source)
[2/8/12 11:00 AM]: at javax.swing.JComponent.paint(Unknown Source)
[2/8/12 11:00 AM]: at javax.swing.JComponent.paintChildren(Unknown Source)
[2/8/12 11:00 AM]: at javax.swing.JComponent.paint(Unknown Source)
[2/8/12 11:00 AM]: at javax.swing.JViewport.paint(Unknown Source)
[2/8/12 11:00 AM]: at javax.swing.JComponent.paintChildren(Unknown Source)
[2/8/12 11:00 AM]: at javax.swing.JComponent.paint(Unknown Source)
[2/8/12 11:00 AM]: at javax.swing.JComponent.paintToOffscreen(Unknown Sourc
e)
[2/8/12 11:00 AM]: at javax.swing.BufferStrategyPaintManager.paint(Unknown
Source)
[2/8/12 11:00 AM]: at javax.swing.RepaintManager.paint(Unknown Source)
[2/8/12 11:00 AM]: at javax.swing.JComponent._paintImmediately(Unknown Sour
ce)
[2/8/12 11:00 AM]: at javax.swing.JComponent.paintImmediately(Unknown Sourc
e)
[2/8/12 11:00 AM]: at javax.swing.RepaintManager.paintDirtyRegions(Unknown
Source)
[2/8/12 11:00 AM]: at javax.swing.RepaintManager.paintDirtyRegions(Unknown
Source)
[2/8/12 11:00 AM]: at javax
.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
[2/8/12 11:00 AM]: at javax.swing.RepaintManager.access$700(Unknown Source)
[2/8/12 11:00 AM]: at javax.swing.RepaintManager$ProcessingRunnable.run(Unk
nown Source)
[2/8/12 11:00 AM]: at java.awt.event.InvocationEvent.dispatch(Unknown Sourc
e)[2/8/12 11:00 AM]: Npc deleted
[2/8/12 11:00 AM]: at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
[2/8/12 11:00 AM]: Npc deleted
[2/8/12 11:00 AM]: at java.awt.EventQueue.access$000(Unknown Source)[2/8/12
11:00 AM]: Npc deleted
[2/8/12 11:00 AM]: at java.awt.EventQueue$3.run(Unknown Source)[2/8/12 11:0
0 AM]: Npc deleted
[2/8/12 11:00 AM]: at java.awt.EventQueue$3.run(Unknown Source)
[2/8/12 11:00 AM]: Npc deleted[2/8/12 11:00 AM]: at java.security.AccessC
ontroller.doPrivileged(Native Method)
[2/8/12 11:00 AM]: at java.security.ProtectionDomain$1.doIntersectionPrivil
ege(Unknown Source)
[2/8/12 11:00 AM]:
at java.awt.EventQueue.dispatchEvent(Unknown Source)
[2/8/12 11:00 AM]: at java.awt.EventDispatchThread.pumpOneEventForFilters(U
nknown Source)
[2/8/12 11:00 AM]: at java.awt.EventDispatchThread.pumpEventsForFilter(Unkn
own Source)
[2/8/12 11:00 AM]: at java.awt.EventDispatchThread.pumpEventsForHierarchy(U
nknown Source)
[2/8/12 11:00 AM]: at java.awt.EventDispatchThread.pumpEvents(Unknown Sourc
e)
[2/8/12 11:00 AM]: at java.awt.EventDispatchThread.pumpEvents(Unknown Sourc
e)
[2/8/12 11:00 AM]: at java.awt.EventDispatchThread.run(Unknown Source)
I'm guessing you are updating the state of a component outside of the Event Dispatch Thread which can randomly cause problems.
Maybe Concurrency in Swing will help.
Regarding the event queue: when you have an application that uses a graphical user interface (GUI), there is also a thread associated with this GUI. The thread runs a loop waiting for events like mouse clicks and so on. That thread is also the only one that is supposed to update the controls on the GUI if something needs to change (e.g. a list is updated with more data).
The GUI thread operates the changes from a so-called event queue. Other threads that need to update the GUI need to forward their updates to the GUI thread, a process by which they get added to the event queue, because only the GUI thread can actually apply them.
Read some more about it here: http://www.kauss.org/Stephan/swing/index.html

Resources