0

I am working on an API project, using Java and Tomcat. Friday everything was OK, but today I am not able to deploy the war on the server. Here is the stack error in Tomcat:

17-Feb-2020 11:47:43.444 INFOS [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
17-Feb-2020 11:47:43.701 INFOS [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
17-Feb-2020 11:47:43.715 INFOS [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
17-Feb-2020 11:47:43.717 INFOS [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
17-Feb-2020 11:47:43.719 INFOS [main] org.apache.catalina.startup.Catalina.load Initialization processed in 784 ms
17-Feb-2020 11:47:45.114 INFOS [main] org.apache.catalina.core.StandardService.startInternal D├®marrage du service [Catalina]
17-Feb-2020 11:47:45.114 INFOS [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.38
17-Feb-2020 11:47:45.145 INFOS [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR D├®ploiement de l'archive [C:\Dev\Serveurs\anee\apache-tomcat-8.5.38\webapps\anee.war] de l'application web
17-Feb-2020 11:47:57.205 GRAVE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
 org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/anee]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:985)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
        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:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [/anee] 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.bouncycastle.asn1.ASN1Boolean->org.bouncycastle.asn1.DERBoolean->org.bouncycastle.asn1.ASN1Boolean]
        at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2116)
        at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2054)
        at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:2000)
        at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1970)
        at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1923)
        at org.apache.catalina.startup.ContextConfig.processClasses(ContextConfig.java:1230)
        at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1134)
        at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:769)
        at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5181)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        ... 10 more
> 
> 
> Blockquote 17-Feb-2020 11:47:57.206 GRAVE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Erreur lors du d├®ploiement de l'archive [C:\Dev\Serveurs\anee\apache-tomcat-8.5.38\webapps\anee.war] de l'application web
 java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/anee]]
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:758)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:985)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
        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:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

And here are the errors from the logs:

17-Feb-2020 11:43:37.813 GRAVE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) [org.springframework.web.context.ContextLoaderListener]
 org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'casBypassFilter' defined in class path resource [META-INF/spring/fwk-security-cas-filters.xml]: Could not resolve placeholder 'fwk.uri.protected' in string value "${fwk.uri.protected}"
    at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:209)
    at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:220)
    at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:84)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:694)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:669)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4817)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5283)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:985)
    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
    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:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

I do not explain myself why the changes, because I did not change the code. The file where is placed the string ${fwk.uri.protected} is read-only, I am not able to change it.

In my pom.xml, for my properties, I have tomcat7 (the solution indicated for the similar problem here Unable to deploy to server running Tomcat). I changed to tomcat8, and I had some other errors, about missing dependencies.

I am using JDK 1.8 and apache-tomcat-8.5.38

Could you please take a look, and tell me what you think about it ? This would help me a lot ! Thank you very much

Michał Krzywański
  • 15,659
  • 4
  • 36
  • 63
Léa
  • 51
  • 5
  • One of the errors says `StackOverFlow`, you could try to increase the memory for Tomcat using https://crunchify.com/how-to-change-jvm-heap-setting-xms-xmx-of-tomcat/ – Rahul Agrawal Feb 17 '20 at 12:23
  • I tried the solution that you suggest, michalk, the error persists. – Léa Feb 17 '20 at 13:43
  • I found the problem, I had to use another GIT branch, because the version I used was an advanced one, and I needed some external libraries (which I didn't have). – Léa Feb 18 '20 at 13:22

1 Answers1

0

I found the problem, I had to use another GIT branch, because the version I used was an advanced one, and I needed some external libraries (which I didn't have yesterday). All is OK now.

Léa
  • 51
  • 5