Spring 中 Exception in thread "main" org.springframework.beans.factory.BeanCreationException:问题解决
来源:互联网 发布:北京买房 知乎 编辑:程序博客网 时间:2024/06/03 18:28
开始spring 时遇到这样问题:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloworldbean' defined in file [C:/WL/spring04-08/src/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Couldn't generate CGLIB subclass of class [class com.spring.aop.HelloWorld]: Common causes of this problem include using a final class or a non-visible class; nested exception is net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
Caused by: org.springframework.aop.framework.AopConfigException: Couldn't generate CGLIB subclass of class [class com.spring.aop.HelloWorld]: Common causes of this problem include using a final class or a non-visible class; nested exception is net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
Caused by: net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237)
at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:285)
at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:196)
at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:110)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.createProxy(AbstractAutoProxyCreator.java:429)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:299)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:315)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1181)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:428)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:93)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:77)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:67)
at com.spring.aop.ProxyFactoryBeanTest.main(ProxyFactoryBeanTest.java:6)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219)
... 19 more
Caused by: java.lang.SecurityException: class "com.spring.aop.HelloWorld$$EnhancerByCGLIB$$b4b90129"'s signer information does not match signer information of other classes in the same package
at java.lang.ClassLoader.checkCerts(Unknown Source)
at java.lang.ClassLoader.preDefineClass(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
... 25 more
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean id="beanNameProxyCreator"
class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames">
<list>
<value>*</value>
<!-- 这里经常遇到问题,故面这样解决.... helloworldbean,hellobean,helloworld-->
</list>
</property>
<property name="interceptorNames">
<list>
<value>advice</value>
</list>
</property>
<property name="proxyTargetClass">
<value>true</value>
</property>
</bean>
<bean id="helloworldbean" class="com.spring.aop.HelloWorld"></bean>
<bean id="hellobean" class="com.spring.aop.HelloWorld"></bean>
<bean id="helloworld" class="com.spring.aop.HelloWorld"></bean>
<bean id="advice" class="com.spring.aop.SimpleBeforeAdvice"></bean>
</beans>
- Spring 中 Exception in thread "main" org.springframework.beans.factory.BeanCreationException:问题解决
- Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactor
- Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating b
- Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException
- Exception in thread "main" org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Li
- Exception in thread "main" java.lang.NoSuchMethodError: org.springframework.beans.factory.annotation
- Exception in thread "main" org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Li
- Exception in thread "main" org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qua
- spring org.springframework.beans.factory.BeanCreationException
- org.springframework.beans.factory.BeanCreationException
- org.springframework.beans.factory.BeanCreationException
- org.springframework.beans.factory.BeanCreationException
- org.springframework.beans.factory.BeanCreationException
- org.springframework.beans.factory.BeanCreationException
- org.springframework.beans.factory.BeanCreationException:
- org.springframework.beans.factory.BeanCreationException
- org.springframework.beans.factory.BeanCreationException
- org.springframework.beans.factory.BeanCreationException
- 福建泉州软件企业将与微软“联姻”
- 防止传值方式传递
- 用SQL SERVER 2005新提供的命令实现行列转换
- CString数据类型
- 独辟蹊径 阿里软件掀起中国“SaaS”流行风
- Spring 中 Exception in thread "main" org.springframework.beans.factory.BeanCreationException:问题解决
- 图解MyEclipse配置struts+hibernate+spring+FreeMarker
- 甲骨文西安分公司投入运营 为西部建设发挥作用
- 和 ASP.NET AJAX 应用程序环游地球
- 无敌追女孩
- Hibernate悲观锁定与乐观锁定区别 - esffor - JavaEye技术网站
- linux 开机时自动挂载分区!
- 理解ASP.NET 2.0中的单点登录
- Spring学习笔记:1、概念理解