New XNAT install - unsupported prerequisites...

152 views
Skip to first unread message

Jérome R.

unread,
Mar 8, 2018, 5:09:25 AM3/8/18
to xnat_discussion
Hi all,
I'am about to set-up a new server running XNAT (1.7) but I am a a bit confused concerning the perequisites that look very old ones...

can I install XNAT on a Debian 9 release, the current stable version?

It looks like I need Java 7? current stable version is... Java 9

there is no package of Tomcat 7 for debian 9....

Do I really need to use old, unsupported versions of these OS/softwares to set up our XNAT, which is supposed to be a long term solution for us?
thank you
JR

Herrick, Rick

unread,
Mar 8, 2018, 1:19:33 PM3/8/18
to xnat_di...@googlegroups.com

As far as Debian 9, I haven’t tried it but I doubt that the OS itself would be a limiting factor. The dependencies could be an issue however.

 

Java 9 is probably a blocker. There’s a big change in how Java 9 packages and runs code that can cause existing code to fail on start-up. We haven’t had a chance to look into this at all, since Java 9 support is not widespread yet. That said, I just stood up a Debian 9 VM and the only JDK I see on there through the apt repos is Java 8. Just do “sudo apt install openjdk-8-jdk” and you should be good.

 

As far as Tomcat, we’ve only tested on Tomcat 7, but I have gotten XNAT working on Tomcat 8. There’s a change you need to make to the war file, which is changing the context definition file to handle changes in Tomcat itself. To do this, download or copy the XNAT war to a folder somewhere. In that folder, make a new directory named META-INF. Create a new file in the META-INF folder named context.xml with the following contents:

 

<?xml version="1.0" encoding="utf-8"?>

<Context>

    <Resources>

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

    </Resources>

    <JarScanner scanAllDirectories="true" />

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

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

    <Manager pathname="" />

</Context>

 

Then, in the same folder as the war file, run the following command (this presumes you’ve installed the JDK):

 

$ jar uf xnat-web-xxx.war META-INF/context.xml

 

Now you can copy that war file into the webapps folder and start Tomcat up. Presuming other prerequisites are met (required folders created, config file set up correctly, etc.), you should get a working XNAT.

 

The big caveat here is that we haven’t done anything more than casual validation that this works, so you’d want to test it a good bit before using it with real research data.

 

It’s also worth noting that neither Tomcat 7 nor Java 8 are “old, unsupported versions”. There is no official EOS/EOL date for Tomcat 7, although guesstimates on the Tomcat developers list put it sometime in 2020. The EOS/EOL for Java 8 is very confusing, since the Oracle page on this seems to indicate that Java 8 will actually be supported longer than Java 9, 1/2019 or 12/2020 for Java 8 vs 3/2018 (!) for Java 9 (this is because Java 9 is the last of the “Java X” releases, after which they’re transitioning to a year-update version model, starting with 18.3. In fact, Debian 9 basically EOL’s around the same time as Java 8 and Tomcat 7 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.

Herrick, Rick

unread,
Mar 8, 2018, 1:44:05 PM3/8/18
to xnat_di...@googlegroups.com

One note on this: the Tomcat 8 install on Debian 9 is kind of a disaster. You’ll get a bunch of errors just on start-up of the default configuration. Two things you can do to fix these:

 

Run “sudo apt install libservlet3.1-java”. Tomcat tries access libraries that aren’t installed by default and pitches a fit if it can’t find them. Those libraries are in libservlet3.1-java and that’ll shut it up.

 

Run a script like this (do this as root):

 

mkdir -p /usr/share/tomcat8/common/classes

mkdir -p /usr/share/tomcat8/server/classes

mkdir -p /usr/share/tomcat8/shared/classes

ln -s /usr/share/tomcat8/common /var/lib/tomcat8/common

ln -s /usr/share/tomcat8/server /var/lib/tomcat8/server

ln -s /usr/share/tomcat8/shared /var/lib/tomcat8/shared

chown -R xnat.xnat /usr/share/tomcat8 /var/lib/tomcat8

chown -RH xnat.xnat /usr/share/tomcat8 /var/lib/tomcat8

 

That’ll get rid of a bunch of other annoying error messages as well.

 

-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

Phone: +1 (314) 273-1645

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.

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

Jérome R.

unread,
Mar 9, 2018, 10:52:53 AM3/9/18
to xnat_discussion
Thank you Rick for all this tips!

I've got the following issue when running the jar command

jar uf xnat-web-1.7.4.1.war META-INF/context.xml
java
.util.zip.ZipException: duplicate entry: WEB-INF/lib/axis-ant-1.4.jar
    at java
.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:232)
    at java
.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:109)
    at sun
.tools.jar.Main.update(Main.java:635)
    at sun
.tools.jar.Main.run(Main.java:271)
    at sun
.tools.jar.Main.main(Main.java:1288)

is it a problem, or can I continue the installation??

To unsubscribe from this group and stop receiving emails from it, send an email to xnat_discussion+unsubscribe@googlegroups.com.
To post to this group, send email to
xnat_discussion@googlegroups.com.
Visit this group at
https://groups.google.com/group/xnat_discussion.
For more options, visit
https://groups.google.com/d/optout.

Herrick, Rick

unread,
Mar 12, 2018, 1:00:40 PM3/12/18
to xnat_di...@googlegroups.com

Ah, that’s caused by some issue that occurred in the build where somehow that jar file got included in the war file twice. I have no idea how that happened, but it might have been a gradle bug because I saw it happen with a few other builds, but it hasn’t occurred (at least that I’ve noticed) recently. The fix is pretty easy:

 

  1. Move the war file into a folder somewhere by itself.

 

  1. Extract axis-ant-1.4.jar and the context.xml file:

 

$ jar xf xnat-web-1.7.4.1.war WEB-INF/lib/axis-ant-1.4.jar META-INF/context.xml

 

  1. Delete axis-ant-1.4.jar and the existing context.xml file from the war file using zip:

 

$ zip -d xnat-web-1.7.4.1.war WEB-INF/lib/axis-ant-1.4.jar META-INF/context.xml

deleting: WEB-INF/lib/axis-ant-1.4.jar

deleting: META-INF/context.xml

 

A weird thing is that, if you have WEB-INF/lib/axis-ant-1.4.jar in your current folder when you run this command, zip will only delete a single entry for WEB-INF/lib/axis-ant-1.4.jar, leaving one of the duplicate entries in there. If you DON’T have that in there, it will delete both. It doesn’t seem to matter, as the jar update a couple steps later replaces that remaining entry so you don’t have the double-entry error. But it’s weird.

 

  1. Edit META-INF/context.xml in place (i.e. keep it in that META-INF folder) or just replace it with the modified version.

 

  1. Update the war file with (a single entry for) WEB-INF/lib/axis-ant-1.4.jar and META-INF/context.xml:

 

$ jar uf xnat-web-1.7.4.1.war META-INF WEB-INF

 

  1. And that’s it. You should have a war without a double entry for axis-ant-1.4.jar and with the updated context.xml file. You can verify this with the following command:

 

$ jar tf xnat-web-1.7.4.1.war | grep -e "\(axis-ant\|context\)"

WEB-INF/lib/spring-context-support-4.3.10.RELEASE.jar

WEB-INF/lib/spring-context-4.3.10.RELEASE.jar

WEB-INF/lib/axis-ant-1.4.jar

WEB-INF/conf/mq-context.xml

META-INF/context.xml

 

Note the single entry for axis-ant-1.4.jar, so that’s good. You can verify the change to context.xml by changing “tf” to “tvf”, which will give you an “ls -l” like display of the archive contents so you can compare file size.

 

Deploy that war and you should be good to run under Tomcat 8 (with the previously mentioned caveats!).

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.

--

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.

Jérome R.

unread,
Mar 14, 2018, 9:49:39 AM3/14/18
to xnat_discussion
Thank you! this worked fine, and now I have my fully running XNAT install!
let's test!

Herrick, Rick

unread,
Mar 14, 2018, 10:27:46 AM3/14/18
to xnat_di...@googlegroups.com

Very cool! Please let us know if you run into any issues with Tomcat 8, since we will need to support that going forward but haven’t had the time to devote to fully testing running there yet.

 

-- 

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


To post to this group, send email to

Daniel Beasley

unread,
Aug 15, 2018, 6:20:45 AM8/15/18
to xnat_discussion
Hi Rick,

You mention openjdk8 - does xnat work with this?  Oracle are going to start charging next year, I heard.

Many thanks,

Dan

To unsubscribe from this group and stop receiving emails from it, send an email to xnat_discussion+unsubscribe@googlegroups.com.
To post to this group, send email to
xnat_discussion@googlegroups.com.
Visit this group at
https://groups.google.com/group/xnat_discussion.
For more options, visit
https://groups.google.com/d/optout.

Herrick, Rick

unread,
Aug 15, 2018, 11:26:50 AM8/15/18
to xnat_di...@googlegroups.com

Yes, the XNAT Vagrant VM configuration runs on openjdk-8-jdk, as does my dev server. I haven’t seen any issues at all.

 

-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

Phone: +1 (314) 273-1645

 

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.

 


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.

--

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.

Daniel Beasley

unread,
Aug 16, 2018, 5:50:17 AM8/16/18
to xnat_discussion
Many thanks!

To unsubscribe from this group and stop receiving emails from it, send an email to xnat_discussion+unsubscribe@googlegroups.com.
To post to this group, send email to xnat_discussion@googlegroups.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.

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

Reply all
Reply to author
Forward
0 new messages