關(guān)于Tomcat啟動(dòng)失敗報(bào)循環(huán)依賴的問題解決(AncestorAxisIterator)
Tomcat啟動(dòng)失敗報(bào)循環(huán)依賴(AncestorAxisIterator-AncestorOrSelfAxisIterator)
嚴(yán)重: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753)at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729)at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:587)at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1798)at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)at java.util.concurrent.FutureTask.run(FutureTask.java:266)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)at java.lang.Thread.run(Thread.java:745)Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [] due to a StackOverflowError. Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies. The class hierarchy being processed was [org.jaxen.util.AncestorAxisIterator->org.jaxen.util.AncestorOrSelfAxisIterator->org.jaxen.util.AncestorAxisIterator]at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2108)at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2054)at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1999)at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1969)at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1923)at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1166)at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:783)at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:307)at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5213)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)... 10 moretomcat在日常啟動(dòng)時(shí)候突然爆出了這個(gè)錯(cuò)誤,爆出org.jaxen.util.AncestorAxisIterator類和org.jaxen.util.AncestorOrSelfAxisIterator循環(huán)依賴的問題,但是我合的代碼只有一行賦值代碼啊,所以斷定這個(gè)肯定不是我的代碼原因,但是測試環(huán)境因?yàn)檫@個(gè)啟不來,出于大佬的心態(tài),我覺得著手解決這個(gè)問題。
第一步:解決沖突看見這個(gè)問題,第一時(shí)間當(dāng)然是認(rèn)為包沖突拉,那我們第一時(shí)間拉出maven helper 來看看這個(gè)類所屬的包是不是有沖突了。如下圖所示:
這里邊這個(gè)包只是被一個(gè)同事引得其他包使用了,并沒有多個(gè)版本混雜的情況,這就尷尬了。那么這個(gè)問題從何而來呢?
第二步:尋找思路是tomcat的配置問題,正巧我司項(xiàng)目最近升級(jí)了tomcat的版本,沒準(zhǔn)真是這個(gè)問題呢,于是乎我更改了tomcat的配置。
你別說,改完還真啟起來了,于是乎解決了這個(gè)疑難雜癥的我美滋滋的睡覺去了。 但是第二天tomcat在重啟的時(shí)候又掛了,一模一樣的原因,于是乎我意識(shí)到,問題沒有這么簡單,一定是某個(gè)隱藏的包沖突了沒有顯示出來。于是我又看到了上述文章的最后一行提示。
百度了一下更改jar可以使用,我已經(jīng)把我的更新為Jaxen-1.2.0和dom4j-1.6.1兩個(gè)jar包 問題還是會(huì)出現(xiàn) 解決方案是更新jar包,更新Jaxen-1.1.6和dom4j-1.6.1兩個(gè)jar包 ------還有待測試
我一看,要不我測試測試試試?于是我查了下我這兩個(gè)包的版本。Jaxen-1.1.6剛開始排查過了不用看了,看看第二個(gè)包吧,果不其然:
于是把下邊1.1的這個(gè)包排掉,重啟,果然項(xiàng)目又雙叒正常啟動(dòng)了。
總結(jié)Jaxen包和dom4j包在使用時(shí)候有些依賴關(guān)系,如果必須同時(shí)引入兩個(gè)包的話,要注意兩者相互的版本關(guān)系,如果版本不對(duì)應(yīng)可能會(huì)導(dǎo)致文章開始的循環(huán)依賴問題。
目前本人親測,Jaxen-1.1.6和dom4j-1.6.1這兩個(gè)版本搭配不會(huì)有循環(huán)依賴的問題出現(xiàn)。
到此這篇關(guān)于關(guān)于Tomcat啟動(dòng)失敗報(bào)循環(huán)依賴的問題解決(AncestorAxisIterator)的文章就介紹到這了,更多相關(guān)Tomcat啟動(dòng)失敗問題內(nèi)容請(qǐng)搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!
相關(guān)文章:
