2

我编写了一个在 Weblogic 10.3 上运行的 Spring 应用程序。在这个应用程序中,我有一些 JMS 队列消费者。

有时我在应用程序关闭或打开时遇到错误(我在两种情况下都看到了这个错误)说:

    java.lang.NoClassDefFoundError: org/springframework/jms/connection/SmartConnectionFactory
        at org.springframework.jms.connection.ConnectionFactoryUtils.releaseConnection(ConnectionFactoryUtils.java:72)
        at org.springframework.jms.listener.AbstractJmsListeningContainer.refreshSharedConnection(AbstractJmsListeningContainer.java:385)at org.springframework.jms.listener.DefaultMessageListenerContainer.refreshConnectionUntilSuccessful(DefaultMessageListenerContainer.java:779)
        at org.springframework.jms.listener.DefaultMessageListenerContainer.recoverAfterListenerSetupFailure(DefaultMessageListenerContainer.java:761)
        at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:892)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: org.springframework.jms.connection.SmartConnectionFactory
        at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
        at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
        at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:176)
        at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:35)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
        ... 6 more

为什么我会收到此错误,我应该怎么做才能解决它?spring.jar 的版本是 2.5.5

4

2 回答 2

2

该异常意味着该类未加载到 JVM 中。确保 spring.jar 位于 Weblogic 服务器的类路径或库文件夹中。

于 2010-01-06T16:39:41.443 回答
0

It's all very well that you have this class in your war, but in Weblogic, the war has its own classloader. Since your stack trace shows a JMS listener, I'd ask: where is the listener? If it's in the war, then you have a mystery. But it sure looks as though it's somewhere else, and it's that somewhere else that would be missing this Spring class.

于 2010-02-04T00:37:25.277 回答