Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/jms/JMSContext
参考链接:https://www.cnblogs.com/helloworld6379/p/10153550.html
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.privateGetPublicMethods(Class.java:
2902
)
at java.lang.Class.getMethods(Class.java:
1615
)
at org.springframework.beans.ExtendedBeanInfoFactory.supports(ExtendedBeanInfoFactory.java:
56
)
at org.springframework.beans.ExtendedBeanInfoFactory.getBeanInfo(ExtendedBeanInfoFactory.java:
48
)
at org.springframework.beans.CachedIntrospectionResults.getBeanInfo(CachedIntrospectionResults.java:
242
)
at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:
273
)
at org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:
177
)
at org.springframework.beans.BeanWrapperImpl.getCachedIntrospectionResults(BeanWrapperImpl.java:
174
)
at org.springframework.beans.BeanWrapperImpl.getLocalPropertyHandler(BeanWrapperImpl.java:
230
)
at org.springframework.beans.BeanWrapperImpl.getLocalPropertyHandler(BeanWrapperImpl.java:
63
)
at org.springframework.beans.AbstractNestablePropertyAccessor.getPropertyHandler(AbstractNestablePropertyAccessor.java:
725
)
at org.springframework.beans.AbstractNestablePropertyAccessor.isWritableProperty(AbstractNestablePropertyAccessor.java:
562
)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:
1613
)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:
1363
)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:
580
)
...
34
more
原因是少包,需要在pom文件增加依赖
<dependency>
<groupId>javax.jms</groupId>
<artifactId>javax.jms-api</artifactId>
<version>2.0.1</version>
</dependency>
xsshu