I think you haven’t defined xnat.home in your Tomcat configuration. XNAT has a custom context definition that configures that VirtualWebappLoader class:
<Loader className="org.apache.catalina.loader.VirtualWebappLoader" searchVirtualFirst="true" virtualClasspath="${xnat.home}/plugins/*.jar"/>
I think the null is coming because it’s trying to expand that ${xnat.home} reference but it doesn’t have anything to expand it with.
You can check whether Tomcat is getting xnat.home set by looking at the process:
$ ps ax | fgrep tomcat
30064 ? Sl 1:34 /usr/lib/jvm/java-8-openjdk-amd64/bin/java -Djava.util.logging.config.file=/var/lib/tomcat7/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.awt.headless=true -Xms512m -Xmx1g -XX:+UseConcMarkSweepGC -XX:-OmitStackTraceInFastThrow -XX:+CMSIncrementalMode -XX:+CMSClassUnloadingEnabled -Dxnat.home=/data/xnat/home -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000 -agentpath:/opt/yourkit/bin/linux-x86-64/libyjpagent.so -Djava.endorsed.dirs=/usr/share/tomcat7/endorsed -classpath /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar -Dcatalina.base=/var/lib/tomcat7 -Dcatalina.home=/usr/share/tomcat7 -Djava.io.tmpdir=/tmp/tomcat7-tomcat7-tmp org.apache.catalina.startup.Bootstrap start
For Debian/Ubuntu servers, you can set this in /etc/default/tomcat7, while on Fedora/RHEL/CentOS servers you can set it in /etc/sysconfig/tomcat7 (or sometimes it’s just tomcat). On my current development server, I have this in /etc/default/tomcat7:
# Set CATALINA_OPTS for Tomcat-specific operations, mainly service start and run.
CATALINA_OPTS="-Xms512m -Xmx1g -XX:+UseConcMarkSweepGC -XX:-OmitStackTraceInFastThrow"
CATALINA_OPTS="${CATALINA_OPTS} -XX:+CMSIncrementalMode -XX:+CMSClassUnloadingEnabled"
CATALINA_OPTS="${CATALINA_OPTS} -Dxnat.home=/data/xnat/home"
CATALINA_OPTS="${CATALINA_OPTS} -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000"
CATALINA_OPTS="${CATALINA_OPTS} -agentpath:/opt/yourkit/bin/linux-x86-64/libyjpagent.so"
--
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 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.
What version of tomcat do you have installed? I recall people having issues with the version of tomcat7 that CentOS7 wants to give you by default.
Thanks,
Charlie
--
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.
tomcat.noarch 7.0.76-6.el7 @basetomcat-el-2.2-api.noarch 7.0.76-6.el7 @basetomcat-jsp-2.2-api.noarch 7.0.76-6.el7 @basetomcat-lib.noarch 7.0.76-6.el7 @basetomcat-native.x86_64 1.2.17-1.el7 @epeltomcat-servlet-3.0-api.noarch 7.0.76-6.el7 @base
Yep, tomcat 7.0.76 was the version installed where an issue like this happened previously: https://groups.google.com/forum/#!searchin/xnat_discussion/saltstack%7Csort:date/xnat_discussion/nw7g5tjhDTo/m1mBIZ2VAgAJ . For some reason, the last message in this thread was deleted from the google group. I’m not really sure why that is, but I still have a copy of it in my email. I’d like to check with Rick to see why it was deleted though before I post it; that shouldn’t take long.
Thanks,
Charlie
--
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.
In the meantime, here’s another related thread: https://groups.google.com/forum/#!searchin/xnat_discussion/xnat$20systemd%7Csort:date/xnat_discussion/5IysygSbaf0/PQwSwTiDAAAJ .
Thanks,
Charlie
Neil,
Charlie and I were just going over this and came up with an idea that might work around the issue. The problem is that Tomcat gets a list of jar files from the folder specified in the VirtualWebappLoader configuration, but it doesn’t find any and so gets a null back. It then tries to sort the list without checking whether or not it’s null, which leads to the failure. To fix this, try the following:
$ cd /data/xnat/home/plugins
$ echo Hello > hello.txt
$ jar cf hello.jar hello.txt
$ rm hello.txt
Now try starting Tomcat. I think it should work just by virtue of giving it something to sort rather than a null.
--
Rick Herrick
Sr. Programmer/Analyst
Neuroinformatics Research Group
Washington University School of Medicine
Phone: +1 (314) 273-1645