Spring 5.1.5.RELEASE时会抛出异常,启动不起来,但是4.3.9.RELEASE就可以启动

来源:4-7 5.6 spring jms演示_1

你不必弯腰因为我会长高i

2019-05-20 15:30

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionFactory': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [org.springframew


ork.jms.connection.SingleConnectionFactory] from ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]

at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:265)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1253)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1168)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:849)

at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)

at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144)

at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85)

at com.marcus.jms.producer.AppProducer.main(AppProducer.java:9)

Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.springframework.jms.connection.SingleConnectionFactory] from ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]

at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:686)

at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:583)

at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:568)

at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:248)

... 14 more

Caused by: java.lang.NoClassDefFoundError: javax/jms/JMSContext

at java.lang.Class.getDeclaredMethods0(Native Method)

at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)

at java.lang.Class.getDeclaredMethods(Class.java:1975)

at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:668)

... 17 more

Caused by: java.lang.ClassNotFoundException: javax.jms.JMSContext

at java.net.URLClassLoader.findClass(URLClassLoader.java:382)

at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

... 21 more


写回答 关注

1回答

  • pardon110
    2019-09-01 23:13:55

    版本变更,旧有的api废弃,请使用合适的版本。

Java消息中间件

使用Java消息中间件处理异步消息

54146 学习 · 144 问题

查看课程

相似问题