Type Status Report
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Apache Tomcat/9.0.52[Unit]
Description=Apache Tomcat Web Application Container
After=network.target
[Service]
Type=forking
#Environment=JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
Environment=JAVA_HOME=/usr/lib/jvm/java-8-oracle
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
#Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
#Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'
#Environment='JAVA_OPTS=-Djava.awt.headless=true -Xms1024m -Xmx6028m -XX:MaxPermSize=512m -XX:+UseConcMarkSweepGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true'
Environment='CATALINA_OPTS=-Xms512m -Xmx1g -XX:+UseConcMarkSweepGC -XX:-OmitStackTraceInFastThrow'
CATALINA_OPTS='${CATALINA_OPTS} -Dxnat.home=/data/xnat/home -Dxnat.config.home=/data/xnat/home/config -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8080'
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh
User=tomcat7
Group=tomcat7
UMask=0007
RestartSec=10
Restart=always
[Install]
WantedBy=multi-user.target
--------
All I can tell you based on this information is that something’s not working properly. You need to at least provide the Tomcat logs and any XNAT logs that may have messages in them. It’s possible that even with that info that we can’t tell you what’s going on, because it can be really difficult to say what’s going on with a custom system configuration like what you’re describing, but without it we definitely can’t tell.
--
Rick Herrick
XNAT Architect/Developer
Computational Imaging Laboratory
Washington University School of Medicine
From:
xnat_di...@googlegroups.com <xnat_di...@googlegroups.com> on behalf of pilla...@gmail.com <pilla...@gmail.com>
Date: Thursday, September 2, 2021 at 3:12 AM
To: xnat_discussion <xnat_di...@googlegroups.com>
Subject: [XNAT Discussion] xnat-1.8.2 not started in tomcat 9
|
* External Email - Caution * |
--
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/9fa8aaa2-877e-4c5c-8604-748f0573841en%40googlegroups.com.
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.
Here’s the issue:
The directory specified by base and internal path [${xnat.home}/plugins]/[] does not exist.
The context for XNAT specifies that ${xnat.home}/plugins should be added to the application’s classpath:
<Resources>
<PreResources className="org.apache.catalina.webresources.DirResourceSet" base="${xnat.home}/plugins" webAppMount="/WEB-INF/lib" />
</Resources>
That folder doesn’t exist, so it can’t be added. Just create that folder and you should be good.
To view this discussion on the web visit https://groups.google.com/d/msgid/xnat_discussion/b9e7acc2-afeb-4ad1-8605-73a5b486bd7en%40googlegroups.com.
You don’t need the -Dxnat.config.home specified, since ${xnat.home}/config is the default used for the config folder, so you can leave that off.
I’m 99% certain this is the issue:
Environment='CATALINA_OPTS=-Xms512m -Xmx1g -XX:+UseConcMarkSweepGC -XX:-OmitStackTraceInFastThrow'
CATALINA_OPTS='${CATALINA_OPTS} -Dxnat.home=/data/xnat/home -Dxnat.config.home=/data/xnat/home/config \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8080'
This works with the standard Tomcat server packaging when you install through apt or yum and are modifying a configuration file like /etc/default/tomcat9, which is the primary configuration file for Tomcat on Ubuntu. Basically that is just a shell script that gets sourced before the service is instantiated. That looks like this in the service unit file:
EnvironmentFile=-/etc/default/tomcat9
Your CATALINA_OPTS='${CATALINA_OPTS}…' line is being ignored (I’m actually surprised the service starts: I made a typo in one once and it got very upset and wouldn’t start), so the xnat.home setting has no effect.
But I’m wondering why you’re managing the Tomcat 9 installation manually in this way when Tomcat 9 is available through the standard Ubuntu apt repos for 18.04. I’d suggest removing the manual configuration you have, installing Tomcat 9 through apt, then modifying /etc/default/tomcat9 to configure stuff. That file on my dev VM right now looks like this:
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
JAVA_OPTS="-Djava.awt.headless=true"
CATALINA_OPTS="-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n"
CATALINA_OPTS="${CATALINA_OPTS} -Xms2g -Xmx6g -XX:+UseConcMarkSweepGC -XX:-OmitStackTraceInFastThrow -XX:+CMSClassUnloadingEnabled"
CATALINA_OPTS="${CATALINA_OPTS} -Dxnat.home=/data/xnat/home"
These sorts of configuration issues are the precise reason we encourage people to use standard software packages when available, as it makes it easier to understand the environment in which errors occur and (generally) eliminates variables in the platform that cause problems.
If you can’t use the standard Ubuntu package for Tomcat 9, then you’ll need to modify your tomcat9.service file like so:
Environment='CATALINA_OPTS=-Xms512m -Xmx1g -XX:+UseConcMarkSweepGC -XX:-OmitStackTraceInFastThrow \
-Dxnat.home=/data/xnat/home -Dxnat.config.home=/data/xnat/home/config \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8080'
Note that the \ and spaces are just for readability: this should all be on one line.
Alternatively you could use the EnvironmentFile directive I mentioned above:
EnvironmentFile=-/etc/default/tomcat9
With that you can remove the extra CATALINA_OPTS line altogether (I think you still want to have CATALINA_OPTS defined in the service unit file or it won’t be recognized even if it’s in the environment file, but I might be wrong about that).
Note that the ‘-‘ right after the equal sign in that line indicates that, even if the return code from the script indicates a failure (e.g. there’s a malformed statement in the script), the service should continue start-up. You can remove that so that errors in the service configuration cause start-up to fail so you can fix it.
To view this discussion on the web visit https://groups.google.com/d/msgid/xnat_discussion/39fec941-5bb2-4e6b-a5b2-af28f1f1bcfcn%40googlegroups.com.