gpt4 book ai didi

java - BeanCreationException;嵌套异常是 java.lang.IllegalArgument :Class must not be null

转载 作者:行者123 更新时间:2023-11-30 08:50:10 24 4
gpt4 key购买 nike

这是我的异常(exception):

2015-06-29 09:27:58 [INFO]-[main]-[org.hibernate.impl.SessionFactoryImpl.close(887)]- closing
2015-06-29 09:27:58 [ERROR]-[main]-[org.springframework.web.context.ContextLoader.initWebApplicationContext(308)]- Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'subjectCcyDao' defined in file [D:\apache-tomcat-6.0.37\wtpwebapps\iEBP4JLSI-SETTLE\WEB-INF\classes\config\applicationContext-sys.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Class must not be null
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.IllegalArgumentException: Class must not be null
at org.springframework.util.Assert.notNull(Assert.java:112)
at org.springframework.util.ReflectionUtils.findMethod(ReflectionUtils.java:150)
at org.springframework.core.BridgeMethodResolver.searchForMatch(BridgeMethodResolver.java:211)
at org.springframework.core.BridgeMethodResolver.findGenericDeclaration(BridgeMethodResolver.java:149)
at org.springframework.core.BridgeMethodResolver.isBridgeMethodFor(BridgeMethodResolver.java:136)
at org.springframework.core.BridgeMethodResolver.searchCandidates(BridgeMethodResolver.java:104)
at org.springframework.core.BridgeMethodResolver.findBridgedMethod(BridgeMethodResolver.java:78)
at org.springframework.core.annotation.AnnotationUtils.getAnnotation(AnnotationUtils.java:100)
at org.springframework.core.annotation.AnnotationUtils.findAnnotation(AnnotationUtils.java:122)
at org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor.isAuthzAnnotationPresent(AuthorizationAttributeSourceAdvisor.java:107)
at org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor.matches(AuthorizationAttributeSourceAdvisor.java:84)
at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:226)
at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:263)
at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:295)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:117)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:87)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:68)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:359)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1461)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
... 26 more

但是,这个问题似乎只发生在我的电脑上,项目在我同事的电脑上进行得很顺利。这是我的 xml 文件:

<bean id="subjectCcyDao" class="com.infohold.bdrp.sys.dao.impl.SubjectCcyDaoImpl" >
<constructor-arg value="com.infohold.bdrp.sys.model.SubjectCcy" />
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="subjectCcyManager" class="com.infohold.bdrp.sys.service.impl.SubjectCcyManagerImpl">
<constructor-arg ref="subjectCcyDao" />
<property name="subjectCcyDao" ref="subjectCcyDao" />
</bean>
<bean id="subjecCcyAction" class="com.infohold.bdrp.sys.action.SubjecCcyAction" parent="baseAction" scope="prototype">
<property name="subjectCcyManager" ref="subjectCcyManager" />
<property name="subjectDictManager" ref="subjectDictManager" />
</bean>

当我注释掉这个 xml 时,错误错过了。但我仍然找不到错误。 这个问题我google了一整天都找不到答案,谁能告诉我原因吗?谢谢。

最佳答案

编辑(2016/02/22):我确认在我的案例中这个问题已经通过迁移到 Spring 3.1.4 得到解决


我没有干净的解决方案,但有一些线索。

当我从 Java 1.7.0_75 切换到 Java 1.8.0_74 时,这个错误开始发生。我怀疑这与 Java 8 中反射实现的变化有关。

我们使用 Spring 3.1.3,我相信这个问题可能会根据这个在 3.1.4 中得到修复 - https://jira.spring.io/browse/SPR-9330

当我探索堆栈跟踪时,我注意到当 Spring Security 试图在您的代码中查找 @Secured 注释时会发生此错误。这可以通过将 secured-annotations 设置为 disabled 来禁用(如果你真的不需要它),例如:

<security:global-method-security secured-annotations="disabled" />

关于java - BeanCreationException;嵌套异常是 java.lang.IllegalArgument :Class must not be null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31106882/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com