7

I have a strange problem. I have a JMS client application & an MDB configured in JBoss jboss-5.1.0.GA. Earlier, I added the JAR by "Configure Build Path" → "Add External JARs" and everything was working fine.

Now, I moved all the JARs to a lib folder under my project and used "Configure Build Path" → "Add JARs".

Now, I get the following exception while executing 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 JARs:

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 help please?

4
  • How are you executing the client program? Commented Jun 8, 2012 at 12:38
  • can you show the imports? It seems you are trying to use the jboss logger but you have log4j on the class path. May be you should import org.apache.log4j Commented Jun 8, 2012 at 12:47
  • @peshkira.... I have used import org.apache.log4j Commented Jun 11, 2012 at 7:08
  • @Raze2dust... I am executing from eclipse --> Run as Java Application Commented Jun 11, 2012 at 7:09

4 Answers 4

3

You need jboss-logging-3.1.0.GA, which comes with the Hibernate distribution or can be downloaded separately.

Sign up to request clarification or add additional context in comments.

Comments

0

It looks like they may be missing the lib/ folder in the classpath. Did you update the classpath to point to the lib folder? If you have a manifest file, make sure it references the lib folder for the jars. Print out your classpath when your program runs, then you can see if it points to those jars. The eclipse setting is only good in eclipse, so if you go outside of that, you have to watch the classpath.

4 Comments

Hi All, When I added the jbossall-client.jar from tje jboss installtion path(../jboss-5.1.0.GA\client) and not from the lib folder, it worked.So, can't I add this jar to lib folder & include in my buildpath? Any idea?
Also, i tried adding the following in manifest file and tried. But got the same problem Class-Path: ../lib/jbossall-client.jar
That only works if the jbossall-client.jar file is in your jar. Does your jar have a lib folder in it?
Yes... The real problem was jbossall-client.jar contains references to other jars. Hence we need to add it from the JBOSS_HOME. Thats is why it didnt work when i copied to my lib directory. Thanks
0

The real problem was that the jbossall-client.jar contains references to other JARs. Hence, we need to add it from the JBOSS_HOME. That's why it didn't work when I copied to my lib directory.

Comments

0

It's the issue with the JBoss logger's compatibility with JDK upgrade from 1.7 on-wards. JDK 1.7 does not allow custom levels. Please use a library compatible with JDK 1.7 (Hit and Try). Maybe, lib doc can help in it.

Otherwise, change the problem JAR by yourself (not recommended).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.