我有一个使用JPA和Spring配置的标准spring启动应用程序。问题是,当我尝试启动运行应用程序时,它无法初始化" transactionAdvisor"并抛出NullPointerException
。因此,应用程序无法创建任何我的bean并抱怨:
调用init方法失败;嵌套异常是 java.lang.IllegalArgumentException异常。
对于我所有的实体,它说:
不是托管类型。
对此有任何帮助都会受到高度赞赏,因为我现在已经开了一段时间了。
如果需要,可以提供更多详细信息。
例外:
2016-12-28 08:56:43,808 ERROR [main] SpringApplication:错误处理 org.springframework.beans.factory.BeanCreationException失败:错误 使用name' delegatingApplicationListener'创建bean定义于 类路径资源 [组织/ springframework的/安全/配置/注解/网络/配置/ WebSecurityConfiguration.class]: 实例化bean之前的BeanPostProcessor失败;嵌套 异常是org.springframework.beans.factory.BeanCreationException: 使用名称创建bean时出错 ' org.springframework.transaction.config.internalTransactionAdvisor' 在类路径资源中定义 [组织/ springframework的/交易/注解/ ProxyTransactionManagementConfiguration.class]: 通过工厂方法进行Bean实例化失败;嵌套异常是 org.springframework.beans.BeanInstantiationException:失败 实例 [org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor]: 工厂方法' transactionAdvisor'抛出异常;嵌套异常 是java.lang.NullPointerException org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:478) 在 org.springframework.beans.factory.support.AbstractBeanFactory $ 1.getObject(AbstractBeanFactory.java:306) 在 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) 在 org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) 在 org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) 在 org.springframework.context.event.AbstractApplicationEventMulticaster.retrieveApplicationListeners(AbstractApplicationEventMulticaster.java:228) 在 org.springframework.context.event.AbstractApplicationEventMulticaster.getApplicationListeners(AbstractApplicationEventMulticaster.java:185) 在 org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127) 在 org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:121) 在 org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:111) 在 org.springframework.boot.context.event.EventPublishingRunListener.finished(EventPublishingRunListener.java:98) 在 org.springframework.boot.SpringApplicationRunListeners.callFinishedListener(SpringApplicationRunListeners.java:79) 在 org.springframework.boot.SpringApplicationRunListeners.finished(SpringApplicationRunListeners.java:72) 在 org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:833) 在 org.springframework.boot.SpringApplication.run(SpringApplication.java:318) 在 org.springframework.boot.SpringApplication.run(SpringApplication.java:1191) 在 org.springframework.boot.SpringApplication.run(SpringApplication.java:1180) 在com.XXXX.XXXXX.audit.Application.main(Application.java:27)引起 by:org.springframework.beans.factory.BeanCreationException:错误 用名字创建bean ' org.springframework.transaction.config.internalTransactionAdvisor' 在类路径资源中定义 [组织/ springframework的/交易/注解/ ProxyTransactionManagementConfiguration.class]: 通过工厂方法进行Bean实例化失败;嵌套异常是 org.springframework.beans.BeanInstantiationException:失败 实例 [org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor]: 工厂方法' transactionAdvisor'抛出异常;嵌套异常 是java.lang.NullPointerException org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) 在 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123) 在 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018) 在 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) 在 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) 在 org.springframework.beans.factory.support.AbstractBeanFactory $ 1.getObject(AbstractBeanFactory.java:306) 在 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) 在 org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) 在 org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) 在 org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper.findAdvisorBeans(BeanFactoryAdvisorRetrievalHelper.java:92) 在 org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findCandidateAdvisors(AbstractAdvisorAutoProxyCreator.java:101) 在 org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator.findCandidateAdvisors(AnnotationAwareAspectJAutoProxyCreator.java:85) 在 org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator.shouldSkip(AspectJAwareAdvisorAutoProxyCreator.java:103) 在 org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessBeforeInstantiation(AbstractAutoProxyCreator.java:248) 在 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInstantiation(AbstractAutowireCapableBeanFactory.java:988) 在 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveBeforeInstantiation(AbstractAutowireCapableBeanFactory.java:959) 在 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:472) ...省略了17个常见帧引起的: org.springframework.beans.BeanInstantiationException:失败 实例 [org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor]: 工厂方法' transactionAdvisor'抛出异常;嵌套异常 是java.lang.NullPointerException org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) 在 org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ...省略了33个常见帧引起的: java.lang.NullPointerException:null at org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration.transactionAdvisor(ProxyTransactionManagementConfiguration.java:46) 在 org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration $$ EnhancerBySpringCGLIB $$ 54296c56.CGLIB $ transactionAdvisor $ 0() 在 org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration $$ EnhancerBySpringCGLIB $$ 54296c56 $$ FastClassBySpringCGLIB $$ ba4a4fd2.invoke() 在 org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) 在 org.springframework.context.annotation.ConfigurationClassEnhancer $ BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356) 在 org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration $$ EnhancerBySpringCGLIB $$ 54296c56.transactionAdvisor() at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在java.lang.reflect.Method.invoke(Method.java:498)at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ...省略了34个常用帧:bootRun FAILED