我们使用的当前版本的弹簧是3.2。它与open jdk 7兼容
我们在更换jre和jdk以打开jdk后收到以下错误
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'applicationContext-main' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:504)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1041)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:273)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1008)
at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(Singlet
这是完整的堆栈跟踪
[main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Refreshing
org.springframework.context.support.ClassPathXmlApplicationContext@3f9a23f5: startup date [Mon Dec 12 05:35:37 IST 2016]; root of context hierarchy
[main] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1ec73967: defining beans []; root of factory hierarchy
Application context could not be created. Will now exit
org.springframework.beans.factory.access.BootstrapException: Unable to return specified BeanFactory instance: factory key [applicationContext-main], from group with resource name [classpath*:beanRefContext.xml]; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'applicationContext-main' is defined
at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:409)
下面是先前共享的堆栈跟踪
答案 0 :(得分:1)
Spring 3.2 supports OpenJDK 7。
值得注意的是OpenJDK 7 is the reference implementation of Java 7。如果一个项目不适用于OpenJDK 7,它实际上不兼容Java 7!
另请注意,OpenJDK 7 u111 u121是最新的安全更新。您正在使用的u79包含已知安全漏洞。