我有一个奇怪的问题。我在 JBoss 中配置了一个JMS客户端应用程序和一个MDBjboss-5.1.0.GA
。早些时候,我通过“配置构建路径”→“添加外部 JAR”添加了 JAR,一切正常。
现在,我将所有 JAR 移动到我的项目下的 lib 文件夹并使用“配置构建路径”→“添加 JAR”。
现在,我在执行客户端程序时遇到以下异常:(
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
我jndi.properties
在类路径和以下 JAR 中:
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
有人可以帮忙吗?