org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]

瀏覽次數:21,114 次
跳到第一則未讀訊息

Mikoyan Lee

未讀,
2017年8月28日 晚上11:10:442017/8/28
收件者:xnat_discussion
Hi Community,

I'm new to xnat. I have problem with the installation. I'm trying to install xnat on CentOS 7.

I have java openjdk 1.7 and 1.8 installed. I tried both. 


[root@dev tomcat]# ls -ld /var/lib/tomcat /var/lib/tomcat/* /etc/tomcat /var/log/tomcat /var/cache/tomcat
drwxr-xr-x. 4 root   tomcat 231 Aug 29 11:02 /etc/tomcat
drwxrwx---. 4 root   tomcat  30 Aug 29 11:02 /var/cache/tomcat
drwxr-xr-x. 3 root   tomcat  21 Aug 29 11:02 /var/lib/tomcat
drwxrwxr-x. 8 root   tomcat 111 Aug 29 12:10 /var/lib/tomcat/webapps
drwxrwx---. 2 tomcat root   177 Aug 29 12:46 /var/log/tomcat

permission seems alright (I use root as default tomcat user)

I have CATALINA_OPTS="-Dxnat.home=/data/xnat/home -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000" in my conf file. (as explained by someone in my previous post, CentOS should use this without "${CATALINA_OPTS}" to avoid error)

I get this error now.

Message: 
FAIL - Application at context path / could not be started
FAIL - Encountered exception org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]

SEVERE: 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:153)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1092)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1984)
        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: org.nrg.framework.exceptions.NrgServiceRuntimeException: Error [Unknown]: Error [Unknown]: An error occurred trying to create the temp folder xnat_11778299473940 in the containing folder /data/xnat/home
        at org.nrg.xnat.initialization.XnatWebAppInitializer.getMultipartConfigElement(XnatWebAppInitializer.java:125)
        at org.nrg.xnat.initialization.XnatWebAppInitializer.customizeRegistration(XnatWebAppInitializer.java:104)
        at org.springframework.web.servlet.support.AbstractDispatcherServletInitializer.registerDispatcherServlet(AbstractDispatcherServletInitializer.java:113)
        at org.springframework.web.servlet.support.AbstractDispatcherServletInitializer.onStartup(AbstractDispatcherServletInitializer.java:71)
        at org.nrg.xnat.initialization.XnatWebAppInitializer.onStartup(XnatWebAppInitializer.java:60)
        at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5573)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
        ... 10 more

Aug 29, 2017 12:59:48 PM org.apache.catalina.startup.HostConfig deployWAR
SEVERE: Error deploying web application archive /var/lib/tomcat/webapps/ROOT.war
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:903)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1092)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1984)
        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)

Aug 29, 2017 12:59:48 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /var/lib/tomcat/webapps/ROOT.war has finished in 7,834 ms
Aug 29, 2017 12:59:48 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat/webapps/examples
Aug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined
Aug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/core is already defined
Aug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
Aug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined
Aug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined
Aug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
Aug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined
Aug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined
Aug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined
Aug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined
Aug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined
Aug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined
Aug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined
Aug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined
Aug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined
Aug 29, 2017 12:59:48 PM org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.


please advise.


Cheers

Frank

McKay, Mike

未讀,
2017年8月28日 晚上11:38:502017/8/28
收件者:xnat_discussion

In general, it is a bad idea to run Tomcat as root. You getting "An error occurred trying to create the temp folder xnat_11778299473940 in the containing folder /data/xnat/home" makes me think that there is a permissions issue.


-Mike 


From: xnat_di...@googlegroups.com <xnat_di...@googlegroups.com> on behalf of Mikoyan Lee <imk...@gmail.com>
Sent: Monday, August 28, 2017 10:10:44 PM
To: xnat_discussion
Subject: [XNAT Discussion] org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
 
--
You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xnat_discussi...@googlegroups.com.
To post to this group, send email to xnat_di...@googlegroups.com.
Visit this group at https://groups.google.com/group/xnat_discussion.
For more options, visit https://groups.google.com/d/optout.

 


The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

Herrick, Rick

未讀,
2017年8月29日 上午10:20:442017/8/29
收件者:xnat_di...@googlegroups.com

Yeah, the standard practice is to either use the default tomcat user to run the Tomcat service or a custom account (and you DEFINITELY don’t want to use root: any security exploits of Tomcat would result in an intruder having full root access).

 

Our standard Vagrant configuration creates a user named xnat and assigns ownership of all of the Tomcat folders as well as the folder specified by the xnat.home environment variable to that user. So something like this would set those all correctly. This presumes you’re working as root, but if not you’ll need to prepend each command with “sudo”. Also, if you’ve already created /data/xnat/home, skip the mkdir command and substitute “-M” for “-m” in the useradd command.

 

$ mkdir -p /data/xnat/home                                                                                                                                                                                                                                                                                                                                                                                              $ useradd -d /data/xnat/home -m xnat

$ chown -R xnat.xnat /data/xnat /etc/tomcat /usr/share/java/tomcat /usr/share/tomcat /var/log/tomcat

$ vim /usr/lib/systemd/system/tomcat.service

 

With this last command, you’ll see a couple of lines in the file like this:

 

User=tomcat

Group=tomcat

 

Change this to:

 

User=xnat

Group=xnat

 

There are a few other things you’ll probably want to set as well, specifically the JAVA_OPTS variable, with something like this (you don’t need the MaxPermSize setting if you’re running with Java 8):

 

JAVA_OPTS="-Xms512m –Xmx2g -XX:MaxPermSize=256m -Dsun.net.inetaddr.ttl=30"

 

These options can be found in the /etc/tomcat/tomcat.conf file.

 

After that start up Tomcat:

 

$ systemctl start tomcat.service

 

Note that these steps are a bit different from a lot of what you’ll find documented elsewhere because of differences between CentOS 7 and other OSes, specifically changes to where and how Tomcat is configured. With the move to use systemd instead of SysV init, some of the configuration has changed. Hopefully this will get you up and running.

 

-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

Phone: +1 (314) 273-1645

Goutam Singha

未讀,
2020年1月2日 上午10:22:552020/1/2
收件者:xnat_discussion
Hi, 

I am getting this error while deploying my web apps --

31-Dec-2019 09:36:29.958 SEVERE [main] org.apache.catalina.startup.HostConfig.deployDirectory Error deploying web application directory [/opt/tomcat/apache-tomcat-9.0.30/webapps/iclock]
        java.lang.IllegalStateException: Error starting child
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:720)
                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
                at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1133)
                at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1867)
                at java.base/java.util.concurrent.Executors$RunnableAdapter.call


I stuck on this, please help me to find out the solution. 

NOTICE: This message is intended only for the individual to whom it is addressed and may contain information that is confidential or privileged. If you are not the intended recipient, or the employee or person responsible for delivering it to the intended recipient, you are hereby notified that any dissemination, distribution, copying or use is strictly prohibited. If you have received this communication in error, please notify the sender and destroy or delete this communication immediately.

Herrick, Rick

未讀,
2020年1月2日 上午10:42:452020/1/2
收件者:xnat_di...@googlegroups.com

A couple of issues here:

 

  • We’ve done no testing of XNAT with Tomcat 9, so I don’t know if XNAT itself will even work in that context. XNAT does run under Tomcat 8 but requires changes to the context definition file (details below). That might get it to work under Tomcat 9 but there are no guarantees at all. If not, you should try running under Tomcat 8 or even 7.
  • That error is with another application installed in Tomcat (webapps/iclock). I’d suggest deleting everything under your Tomcat webapps folder except your XNAT war file (e.g. ROOT.war).

 

To get XNAT to run under Tomcat 8 (again, I have no idea if this will make it work with Tomcat 9), run the following commands (this presumes XNAT is ROOT.war, just change the name if you’re using, e.g., xnat.war or whatever):

 

$ mkdir META-INF

$ curl -o META-INF/context.xml https://bitbucket.org/xnatdev/xnat-web/raw/5696414138d8c95288bf45c8eac2150ba041e867/src/main/webapp/META-INF/context.xml

$ vim META-INF/context.xml

 

In context.xml, remove the comment delimiters so you have the <Resources> and <CookieProcessor> elements and remove the <Loader> element:

 

<Context>

    <Resources>

        <PostResources className="org.apache.catalina.webresources.DirResourceSet" base="${xnat.home}/plugins" webAppMount="/WEB-INF/lib" />

    </Resources>

    <CookieProcessor className="org.apache.tomcat.util.http.LegacyCookieProcessor" />

    <JarScanner scanAllDirectories="true" />

    <Parameter name="xnatHome" value="${xnat.home}"/>

    <Manager pathname="" />

</Context>

 

Now update the war file:

 

$ jar uf ROOT.war META-INF/context.xml

$ rm -rf META-INF

 

The war file should now run properly under Tomcat 8 (it will NOT run properly under Tomcat 7 with this change!).

 

-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

Phone: +1 (314) 273-1645

 

--

You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xnat_discussi...@googlegroups.com.

Tashrif

未讀,
2021年9月22日 上午11:25:132021/9/22
收件者:xnat_discussion
> CentOS should use this without "${CATALINA_OPTS}" to avoid error

This instruction was helpful, thank you.

Best,
Tashrif

Jacob Fosso Tande

未讀,
2021年11月11日 下午2:06:472021/11/11
收件者:xnat_discussion
Hi Community,
I will appreciate any help with the error below
Screen Shot 2021-11-11 at 12.34.14 PM.png
This error was reported in 2017 using tomcat9. Again, I am new to xnat.
At the time Mike suggested an edit to the webapp context. A lot has changed 
since then. I have the same error message when trying to start xnat using tomcat9 
manager. I get this error from the was webapp directory.

11-Nov-2021 18:08:54.798 SEVERE [main] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [/var/lib/tomcat9/webapps/xnat-web-1.8.3.war]

        java.lang.IllegalStateException: Error starting child

                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:720)

                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)

                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)

                at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:978)

                at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1849)

                at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)

                at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

                at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)

                at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)

As you can see I uploaded version 1.8.3 of xnat and below are my configurations


On Monday, August 28, 2017 at 11:10:44 PM UTC-4 imk...@gmail.com wrote:
回覆所有人
回覆作者
轉寄
0 則新訊息