Java.lang.ClassNotFoundException: org.jboss.logging.Logger

I have a strange problem.

I have a JMS and MDB client application configured in jboss jboss-5.1.0.GA. Previously, I added the bank "Configure Build Path" โ†’ "Add external banks", and everything was fine.

Now I moved all the banks to the lib folder in my project and used "Configure Build Path" โ†’ "Add Banks".

Now I get the following exception when running the client program. :(

`Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/logging/Logger at org.jnp.interfaces.NamingContext.<clinit>(NamingContext.java:160) at org.jnp.interfaces.NamingContextFactory.getInitialContext(NamingContextFactory.java:56) at javax.naming.spi.NamingManager.getInitialContext(Unknown Source) at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source) at javax.naming.InitialContext.init(Unknown Source) at javax.naming.InitialContext.<init>(Unknown Source) at com.dcat2.messaging.sendreceive.MessageReceiver_test.sendMessage(MessageReceiver_test.java:68) at com.dcat2.messaging.sendreceive.MessageReceiver_test.main(MessageReceiver_test.java:57) `Caused by: java.lang.ClassNotFoundException: org.jboss.logging.Logger 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) ... 8 more` 

I have jndi.properties in the classpath and the following banks.

 jbossall-client.jar commons-logging.jar concurrent.jar javax.ejb.jar jms.jar jnp-client-4.2.2.GA.jar log4j-1.2.16.jar sqljdbc4.jar 

Can anyone please ....?

+6
source share
4 answers

you need jboss-logging-3.1.0.GA, which comes with hibernate distribution or can be downloaded separately.

+2
source

It looks like they may have lost the lib / folder in the classpath. Have you updated the classpath to point to the lib folder? If you have a manifest file, make sure it references the lib folder for cans. Print your class path at the start of your program, then you will see if it points to these banks. Setting up eclipse is only good at eclipse, so if you go beyond that, you need to look at the class path.

0
source

The real problem was jbossall-client.jar containing links to other banks. Therefore, we need to add it from JBOSS_HOME. That is why it did not work when I copied to my lib directory.

thanks

0
source

Its problem with JBOSS log compatibility with JDK updating to 1.7 on the sides JDK1.7 does not allow you to adjust the levels. Please use a library compatible with jdk1.7 (Hit and Try), maybe lib doc can help with this.

Otherwise, change the problem yourself (not recommended)

0
source

Source: https://habr.com/ru/post/917629/


All Articles