java.lang.ClassNotFoundException: org.springframework.boot.SpringApplication

版权声明:http://blog.csdn.net/anxpp https://blog.csdn.net/anxpp/article/details/52444239

    额,一个使用Spring boot的,好好的项目,最近突然报错了:java.lang.ClassNotFoundException: org.springframework.boot.SpringApplication

    

    

    

    虽然明显知道是jar包问题,不管怎么clean怎么的还是没能解决。

    鼓捣了很久没结果,stackoverflow什么的也翻遍了,依然没找到结果,但是偶然发现另外一个Spring boot项目是可以启动的,对比了一下他们的区别,发现父项目配置的版本不一致,可以启动的是1.3.5版本的,不能启动的是1.4.0版本,果断进入C:\Users\anxpp\.m2\repository\org\springframework\boot\spring-boot删除了1.4.0版本的整个目录,maven clean了一下重新下载的依赖,启动就正常了。

    因为网上的资料都没能解决这个问题,所以记录一下。


    By the way,其实很多时候一些错误(常为ClassNotFound),都可以使用这种方法。

org.springframework.boot.SpringApplication - Error handling failed

04-20

2018-04-20 13:17:04.603 [main] DEBUG org.springframework.beans.factory.support.DrnefaultListableBeanFactory - Creating shared instance of singleton bean 'org.sprirnngframework.transaction.annotation.ProxyTransactionManagementConfiguration'rn2018-04-20 13:17:04.603 [main] DEBUG org.springframework.beans.factory.support.DrnefaultListableBeanFactory - Creating instance of bean 'org.springframework.transrnaction.annotation.ProxyTransactionManagementConfiguration'rn2018-04-20 13:17:04.603 [main] DEBUG org.springframework.beans.factory.support.DrnefaultListableBeanFactory - Eagerly caching bean 'org.springframework.transactiornn.annotation.ProxyTransactionManagementConfiguration' to allow for resolving potrnential circular referencesrn2018-04-20 13:17:04.603 [main] DEBUG org.springframework.beans.factory.annotatiornn.InjectionMetadata - Processing injected element of bean 'org.springframework.trnransaction.annotation.ProxyTransactionManagementConfiguration': AutowiredMethodErnlement for void org.springframework.transaction.annotation.AbstractTransactionMarnnagementConfiguration.setConfigurers(java.util.Collection)rn2018-04-20 13:17:04.618 [main] ERROR org.springframework.boot.SpringApplicationrn- Error handling failedrnorg.springframework.beans.factory.BeanCreationException: Error creating bean witrnh name 'sqlSessionFactory-yxd' defined in class path resource [config/spring-mybrnatis.xml]: Cannot resolve reference to bean 'datasource-yxd' while setting beanrnproperty 'dataSource'; nested exception is org.springframework.beans.factory.BearnnCreationException: Error creating bean with name 'datasource-yxd' defined in clrnass path resource [config/spring-mybatis.xml]: Initialization of bean failed; nernsted exception is org.springframework.beans.factory.BeanCreationException: Errorrn creating bean with name 'org.springframework.transaction.annotation.ProxyTransarnctionManagementConfiguration': Initialization of bean failed; nested exception irns org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean namedrn 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRrnegistry' is definedrn at org.springframework.beans.factory.support.BeanDefinitionValueResolverrn.resolveReference(BeanDefinitionValueResolver.java:359)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolverrn.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanrnFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1481)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanrnFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1226)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanrnFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanrnFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) 论坛

没有更多推荐了,返回首页