1. 程式人生 > >springboot 啟動異常tried to access method org.springframework.core.convert.support.DefaultConversionServ

springboot 啟動異常tried to access method org.springframework.core.convert.support.DefaultConversionServ

第一次寫文章見諒

異常緣由:由於公司專案需要將專案從普通springmvc專案轉為spring boot;轉換後做了適當配置後在idea上可以執行springboot配置的web專案,但是部署的時候就丟擲了版本衝突相關的異常;困擾了好幾天,幾個同事一起查詢問題都沒解決;最後老大刪除了部分依賴和程式碼才解決了問題;後面我根據錯誤提示找到可能衝突的對應的jar包,通過goole發現是專案中的active-all這個包的問題導致;換成active-core包就行;

異常資訊:

嚴重: ContainerBase.addChild: start: 
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/esb]]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1095)
	at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1930)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalAccessError: tried to access method org.springframework.core.convert.support.DefaultConversionService.addCollectionConverters(Lorg/springframework/core/convert/converter/ConverterRegistry;)V from class org.springframework.boot.bind.RelaxedConversionService
	at org.springframework.boot.bind.RelaxedConversionService.<init>(RelaxedConversionService.java:52)
	at org.springframework.boot.bind.RelaxedDataBinder.modifyProperties(RelaxedDataBinder.java:148)
	at org.springframework.boot.bind.RelaxedDataBinder.doBind(RelaxedDataBinder.java:128)
	at org.springframework.validation.DataBinder.bind(DataBinder.java:631)
	at org.springframework.boot.bind.PropertiesConfigurationFactory.doBindPropertiesToTarget(PropertiesConfigurationFactory.java:274)
	at org.springframework.boot.bind.PropertiesConfigurationFactory.bindPropertiesToTarget(PropertiesConfigurationFactory.java:245)
	at org.springframework.boot.context.config.ConfigFileApplicationListener.bindToSpringApplication(ConfigFileApplicationListener.java:232)
	at org.springframework.boot.context.config.ConfigFileApplicationListener.postProcessEnvironment(ConfigFileApplicationListener.java:183)
	at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:168)
	at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:154)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)
	at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:68)
	at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
	at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:335)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
	at org.springframework.boot.web.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:150)
	at org.springframework.boot.web.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:130)
	at org.springframework.boot.web.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:86)
	at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5517)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	... 10 more

十月 24, 2016 3:41:52 下午 org.apache.catalina.startup.HostConfig deployWAR
嚴重: Error deploying web application archive D:\Javatool\apache-tomcat-7.0.62\webapps\esb.war
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/esb]]
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1095)
	at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1930)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

十月 24, 2016 3:41:52 下午 org.apache.catalina.startup.HostConfig deployWAR
</pre><p></p><pre style="font-family:'Courier New'; font-size:9pt; background-color:rgb(255,255,255)"><span style="background-color:#efefef">
</span>
Pom.xml修改主要如下:
<dependency>
    <groupId>org.apache.activemq</groupId>
    <artifactId>activemq-all</
artifactId> <version>5.13.2</version> </dependency>
改為
<dependency>
    <groupId>org.apache.activemq</groupId>
    <artifactId>activemq-core</artifactId>
    <version>5.7.0</version>
</dependency>

因為active-all裡面的spring好像和spring boot依賴的spring版本衝突了導致。修改問題解決
記錄下謹記下自己。遇到問題不要怕,就是幹,刪除程式碼,刪除包依賴都不要怕;
這是避免忘記錯誤,不喜勿噴哈