Problem deploying XNAT 1.7.x in Centos7 using SaltStack

210 views
Skip to first unread message

Marcel Koek

unread,
Sep 20, 2017, 10:02:58 AM9/20/17
to xnat_discussion
I have a problem installing XNAT 1.7.3.1 in Centos7. (I also tried 1.7.2 and 1.7.3)

I am writing a salt state for deploying XNAT in various operating systems. The ones we have
in our infrastructure are Scientific Linux 6.5, Centos 7 and Ubuntu 16.04.
You can try the salt state deployment using vagrant for yourself with:
 https://bitbucket.org/bigr_infra/salt-xnat-vagrant, this is not production code, so
 it is not guaranteed to work at all times

Things go wrong when trying to deploy the war file in tomcat using the tomcat manager.
The salt state works perfectly fine for SL6.5 and Ubuntu 16.04, but not for Centos7 which
puzzles me a bit.

I get the following errors in catalina.out (more details below):
Sep 20, 2017 10:35:36 AM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE
: ContainerBase.addChild: start:
org
.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/xnat##1.7.3.1]]
Caused by: org.apache.catalina.LifecycleException: Failed to start component [WebappLoader[/xnat##1.7.3.1]]
Caused by: java.lang.NullPointerException



At first sight this looks similar to the problem in this issue  but I don't see any permisson problems.
Below I give a description on the state of the Centos 7 machine I am trying to deploy XNAT 1.7.3.1 to.

Any thoughts on what goes wrong?


OS: CentOS/7 from Vagrant Box 'centos/7' (v1708.01)

# uname -a
Linux xnat-17-salt 3.10.0-693.2.1.el7.x86_64 #1 SMP Wed Sep 6 20:06:13 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux



# java -version     # also tried 1.7 same result
openjdk version "1.8.0_144"
OpenJDK Runtime Environment (build 1.8.0_144-b01)
OpenJDK 64-Bit Server VM (build 25.144-b01, mixed mode)



# ls -ld /var/lib/tomcat /var/lib/tomcat/* /etc/tomcat /var/log/tomcat /var/cache/tomcat
drwxr-xr-x. 4 xnat xnat  231 Sep 18 09:08 /etc/tomcat
drwxrwx
---. 4 xnat xnat   30 Sep 18 09:07 /var/cache/tomcat
drwxr
-xr-x. 3 xnat xnat   21 Sep 18 09:07 /var/lib/tomcat
drwxrwxr
-x. 5 xnat xnat   87 Sep 20 09:52 /var/lib/tomcat/webapps
drwxrwx
---. 2 xnat xnat 4096 Sep 20 09:52 /var/log/tomcat



# systemctl status tomcat
tomcat.service - Apache Tomcat Web Application Container
   
Loaded: loaded (/usr/lib/systemd/system/tomcat.service; enabled; vendor preset: disabled)
 
Drop-In: /etc/systemd/system/tomcat.service.d
           
└─user.conf
   
Active: active (running) since Wed 2017-09-20 09:52:33 UTC; 5min ago
 
Main PID: 32494 (java)
   
CGroup: /system.slice/tomcat.service
           
└─32494 /usr/bin/java -Dxnat.home=/data/xnat/home -Xms512m -Xmx1024m -XX:MaxPermSize=256m -classpath /usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar -Dcatalina.base...



# cat /etc/systemd/system/tomcat.service.d/user.conf
[Service]
User=xnat
Group=xnat



# ps aux | grep tomcat
xnat     32494  3.1 13.7 3099536 259072 ?      Ssl  09:52   0:09 /usr/bin/java -Dxnat.home=/data/xnat/home -Xms512m -Xmx1024m -XX:MaxPermSize=256m -classpath /usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar -Dcatalina.base=/usr/share/tomcat -Dcatalina.home=/usr/share/tomcat -Djava.endorsed.dirs= -Djava.io.tmpdir=/var/cache/tomcat/temp -Djava.util.logging.config.file=/usr/share/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager org.apache.catalina.startup.Bootstrap start




# tree -pufi /data/xnat/
/data/xnat
[drwxr-x--- xnat    ]  /data/xnat/archive
[drwxr-x--- xnat    ]  /data/xnat/build
[drwxr-x--- xnat    ]  /data/xnat/cache
[drwxr-x--- xnat    ]  /data/xnat/ftp
[drwxr-x--- xnat    ]  /data/xnat/home
[drwxr-x--- xnat    ]  /data/xnat/home/config
[-rw------- xnat    ]  /data/xnat/home/config/xnat-conf.properties
[drwxr-x--- xnat    ]  /data/xnat/home/logs
[drwxr-x--- xnat    ]  /data/xnat/home/plugins
[drwxr-x--- xnat    ]  /data/xnat/home/work
[drwxr-x--- xnat    ]  /data/xnat/pipeline
[drwxr-x--- xnat    ]  /data/xnat/prearchive



# cat /data/xnat/home/config/xnat-conf.properties
datasource.driver=org.postgresql.Driver
datasource
.url=jdbc:postgresql://localhost/xnat
datasource
.username=xnat
datasource
.password=password

hibernate
.dialect=org.hibernate.dialect.PostgreSQL9Dialect
hibernate
.hbm2ddl.auto=update
hibernate
.show_sql=false
hibernate
.cache.use_second_level_cache=true
hibernate
.cache.use_query_cache=true



# su postgres -c "psql -c '\l xnat'"
                             List of databases
   
Name    |  Owner   | Encoding  | Collate | Ctype |   Access privileges
-----------+----------+-----------+---------+-------+-----------------------
 xnat      
| xnat     | SQL_ASCII | C       | C     |
(1 row)



# cat localhost_access_log.2017-09-20.txt
0:0:0:0:0:0:0:1 - - [20/Sep/2017:09:52:42 +0000] "GET /manager/text/deploy?path=%2Fxnat&version=1.7.3.1&war=file%3A%2Ftmp%2Fsalt.xnat-1.7.3.1.war&update=true HTTP/1.1" 401 2473
0:0:0:0:0:0:0:1 - xnat_tomcat_manager [20/Sep/2017:09:52:47 +0000] "GET /manager/text/deploy?path=%2Fxnat&version=1.7.3.1&war=file%3A%2Ftmp%2Fsalt.xnat-1.7.3.1.war&update=true HTTP/1.1" 200 98



# cat manager.2017-09-20.log
Sep 20, 2017 9:52:42 AM org.apache.catalina.core.ApplicationContext log
INFO
: Manager: init: Associated with Deployer 'Catalina:type=Deployer,host=localhost'
Sep 20, 2017 9:52:42 AM org.apache.catalina.core.ApplicationContext log
INFO
: Manager: init: Global resources are available
Sep 20, 2017 9:52:42 AM org.apache.catalina.core.ApplicationContext log
INFO
: Manager: install: Installing web application '/xnat##1.7.3.1' from 'file:/tmp/salt.xnat-1.7.3.1.war'



# cat catalina.2017-09-20.log
Sep 20, 2017 9:52:26 AM org.apache.coyote.AbstractProtocol pause
INFO
: Pausing ProtocolHandler ["http-bio-8080"]
Sep 20, 2017 9:52:26 AM org.apache.catalina.core.StandardService stopInternal
INFO
: Stopping service Catalina
Sep 20, 2017 9:52:26 AM org.apache.coyote.AbstractProtocol stop
INFO
: Stopping ProtocolHandler ["http-bio-8080"]
Sep 20, 2017 9:52:26 AM org.apache.coyote.AbstractProtocol destroy
INFO
: Destroying ProtocolHandler ["http-bio-8080"]
Sep 20, 2017 9:52:34 AM org.apache.coyote.AbstractProtocol init
INFO
: Initializing ProtocolHandler ["http-bio-8080"]
Sep 20, 2017 9:52:34 AM org.apache.catalina.startup.Catalina load
INFO
: Initialization processed in 1246 ms
Sep 20, 2017 9:52:34 AM org.apache.catalina.core.StandardService startInternal
INFO
: Starting service Catalina
Sep 20, 2017 9:52:34 AM org.apache.catalina.core.StandardEngine startInternal
INFO
: Starting Servlet Engine: Apache Tomcat/7.0.76
Sep 20, 2017 9:52:34 AM org.apache.catalina.startup.HostConfig deployWAR
INFO
: Deploying web application archive /var/lib/tomcat/webapps/xnat##1.7.3.1.war
Sep 20, 2017 9:52:35 AM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE
: ContainerBase.addChild: start:
org
.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/xnat##1.7.3.1]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
    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.apache.catalina.LifecycleException: Failed to start component [WebappLoader[/xnat##1.7.3.1]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5499)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    ... 10 more
Caused by: java.lang.NullPointerException
    at java.util.Arrays.sort(Arrays.java:1246)
    at org.apache.catalina.loader.VirtualWebappLoader.startInternal(VirtualWebappLoader.java:146)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    ... 12 more

Sep 20, 2017 9:52:35 AM org.apache.catalina.startup.HostConfig deployWAR
SEVERE: Error deploying web application archive /
var/lib/tomcat/webapps/xnat##1.7.3.1.war
java
.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/xnat##1.7.3.1]]
    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)

Sep 20, 2017 9:52:35 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /
var/lib/tomcat/webapps/xnat##1.7.3.1.war has finished in 347 ms
Sep 20, 2017 9:52:35 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO
: Deploying web application directory /var/lib/tomcat/webapps/host-manager
Sep 20, 2017 9:52:36 AM 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.
Sep 20, 2017 9:52:36 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO
: Deployment of web application directory /var/lib/tomcat/webapps/host-manager has finished in 1,157 ms
Sep 20, 2017 9:52:36 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO
: Deploying web application directory /var/lib/tomcat/webapps/manager
Sep 20, 2017 9:52:37 AM 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.
Sep 20, 2017 9:52:37 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO
: Deployment of web application directory /var/lib/tomcat/webapps/manager has finished in 658 ms
Sep 20, 2017 9:52:37 AM org.apache.coyote.AbstractProtocol start
INFO
: Starting ProtocolHandler ["http-bio-8080"]
Sep 20, 2017 9:52:37 AM org.apache.catalina.startup.Catalina start
INFO
: Server startup in 2384 ms
Sep 20, 2017 9:52:42 AM org.apache.catalina.startup.HostConfig undeploy
INFO
: Undeploying context [/xnat##1.7.3.1]
Sep 20, 2017 9:52:43 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /
var/lib/tomcat/webapps/xnat##1.7.3.1.war
Sep 20, 2017 9:52:47 AM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE
: ContainerBase.addChild: start:
org
.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/xnat##1.7.3.1]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
    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.deployApps(HostConfig.java:560)
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1779)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
    at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1506)
    at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:902)
    at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:361)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:615)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [WebappLoader[/xnat##1.7.3.1]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5499)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    ... 41 more
Caused by: java.lang.NullPointerException
    at java.util.Arrays.sort(Arrays.java:1246)
    at org.apache.catalina.loader.VirtualWebappLoader.startInternal(VirtualWebappLoader.java:146)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    ... 43 more

Sep 20, 2017 9:52:47 AM org.apache.catalina.startup.HostConfig deployWAR
SEVERE: Error deploying web application archive /
var/lib/tomcat/webapps/xnat##1.7.3.1.war
java
.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/xnat##1.7.3.1]]
    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.deployApps(HostConfig.java:560)
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1779)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
    at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1506)
    at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:902)
    at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:361)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:615)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)

Sep 20, 2017 9:52:47 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /
var/lib/tomcat/webapps/xnat##1.7.3.1.war has finished in 4,017 ms



Herrick, Rick

unread,
Sep 20, 2017, 1:46:21 PM9/20/17
to xnat_di...@googlegroups.com

Hey Marcel,

 

I created a VM from your project and got exactly the same result. I didn’t think it was an issue with CentOS 7.4 and confirmed that by getting XNAT started from the same war file in Tomcat on top of a vanilla CentOS 7.4 box. The issue is happening very early on, when Tomcat is trying to load the war file and parse the virtual classpath specified in the XNAT context.xml file. Looking into the Tomcat code, the error’s occurring here:

 

File directory = new File(token);

String filenames[] = directory.list();
Arrays.sort(filenames);

 

token ends up being “/data/xnat/home/plugins” (it starts as "${xnat.home}/plugins/*.jar", being set with the virtualClasspath attribute)). In your configuration there’s nothing in that folder, but that’s fine: listing that should just get an empty array, not a null. I hooked the debugger up and stepped through the Tomcat code to see why this was happening and… it worked! Maybe something to do with timing that I disrupted by debugging? So I wrote a small test app to try to run just that code in isolation, but then it turns out I couldn’t: there’s no JDK installed so no javac so no way to compile my test app. And there’s the problem.

 

I ran “yum install java-1.8.0-openjdk-devel” and restarted the Tomcat service and voila, XNAT is up and running. I think you want to change states/pillar/pkg/init.sls so that instead of this:

 

{% if grains['os_family'] == 'RedHat' %}

java7: java-1.7.0-openjdk-headless

java8: java-1.8.0-openjdk-headless

java9: java-1.9.0-openjdk-headless

 

You’re doing this:

 

{% if grains['os_family'] == 'RedHat' %}

java7: java-1.7.0-openjdk-devel

java8: java-1.8.0-openjdk-devel

java9: java-1.9.0-openjdk-devel

 

The Debian packages differ from the RedHat ones in that, when they’re labeled with JDK, they actually include the JDK. On RedHat, *everything* is labeled with openjdk, even when it’s just the JRE. The corresponding JRE packages on Debian are openjdk-[789]-jre, while the JDK packages are openjdk-[789]-jdk. I don’t see anything that looks like a headless version of the JDK through yum search…

 

-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

 

Voice: (314) 273-1645

Web: http://www.xnat.org

Twitter: @NrgXnat

--
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.

Marcel Koek

unread,
Sep 21, 2017, 7:55:34 AM9/21/17
to xnat_discussion
Thanks for helping out so quickly!

I changed the packages to the devel versions ran the whole thing again but the problem remains.
Also when trying to do this manually in the way you described:
# yum install java-1.8.0-openjdk-devel
# systemctl restart tomcat

Did you also try to run/deploy it without the debugger attached? Maybe that is still influencing the timing?






Rodrigo Cilla

unread,
Apr 4, 2018, 10:05:13 AM4/4/18
to xnat_discussion
Hi folks,

We are trying a similar install on a fresh CentOS 7.4, but without a VM, and we are experiencing the same problem as originally described. We have tried with java-1.7.0 and the result is the same.

Any idea how to fix the problem? I can provide more details uppon request, but our traces are exactly the same.

Rodrigo Cilla Ugarte
Message has been deleted

Marcel Koek

unread,
Aug 6, 2018, 3:24:09 AM8/6/18
to xnat_discussion

At the moment the tomcat version shipped in the official CentOS repos is: 7.0.76

TL;DR: XNAT 1.7 will not work on a CentOS 7.4 supplied tomcat7 unless tomcat is updated to version >= 7.0.80 or patched. (Where the first option is highly unlikely in the CentOS case)

At some point I was a bit desperate and went looking into tomcat code. I noticed that later versions (more specifically: after version 7.0.80) looked different then version 7.0.76.
The difference came from the following commit: https://github.com/apache/tomcat70/commit/3b8b4868b0f48ee3d44af71a10ceba9479744328
Titled: "FindBugs: Fix possible NullPointerException"

Line where it went wrong in our case (7.0.76): https://github.com/apache/tomcat70/blob/TOMCAT_7_0_76/java/org/apache/catalina/loader/VirtualWebappLoader.java#L146
For reference the 7.0.80 version: https://github.com/apache/tomcat70/blob/TOMCAT_7_0_80/java/org/apache/catalina/loader/VirtualWebappLoader.java#L146

The only way we can get a NullPointerException from Arrays.sort(filenames) is if filenames is null.
filenames can only be null when directory is not pointing to a directory or if some I/O error occurs. (https://docs.oracle.com/javase/7/docs/api/java/io/File.html#list() )
I was not able to find out what went down in my case, because I ran out of time and getting XNAT running on CentOS 7 was not a priority anymore. (I am always struggling with tomcat, so if anyone can tell me how to turn on the debugging and where to read them, I can test this out very quickly).
This seems to me that this would never work. Reverting to installing tomcat manually is highly discouraged by tomcat, so this results in a bit of a problem.

This makes me wonder if there is anyone who got XNAT 1.7 working in CentOS 7.x using the tomcat from the repos?

//Marcel
Reply all
Reply to author
Forward
0 new messages