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 deployWARSEVERE: Error deploying web application archive /var/lib/tomcat/webapps/ROOT.warjava.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 deployWARINFO: Deployment of web application archive /var/lib/tomcat/webapps/ROOT.war has finished in 7,834 msAug 29, 2017 12:59:48 PM org.apache.catalina.startup.HostConfig deployDirectoryINFO: Deploying web application directory /var/lib/tomcat/webapps/examplesAug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already definedAug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jstl/core is already definedAug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already definedAug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already definedAug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jstl/fmt is already definedAug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already definedAug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already definedAug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already definedAug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already definedAug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already definedAug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jstl/sql is already definedAug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already definedAug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already definedAug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jstl/xml is already definedAug 29, 2017 12:59:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already definedAug 29, 2017 12:59:48 PM org.apache.catalina.startup.TldConfig executeINFO: 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.
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
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.
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
A couple of issues here:
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/xnat_discussion/eb7a6640-bc41-4fd3-ac36-0a8faeeb10ad%40googlegroups.com.
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)