Autorun fails upon uploading

121 views
Skip to first unread message

Sara Zullino

unread,
Sep 22, 2020, 6:43:29 AM9/22/20
to xnat_di...@googlegroups.com
Hi,
just completed an XNAT 1.7.6 fresh installation on Ubuntu 20.04 with tomcat7, postegreSQL 11, JDK 8. 
The problem is that every time I upload a new subject via the Compressed Uploader the Autorun fails giving the error enclosed here, but the snapshots are normally generated.
Could you please help me in understanding what is causing this problem?
.
I will appreciate your help!
Thanks!!

Best,
Sara

AutoRun.err
pipeline_2020_09_22_12_17_04.log
AutoRun.log
AutoRun_AutoRun.xml

Mohana Ramaratnam

unread,
Sep 22, 2020, 6:53:15 AM9/22/20
to xnat_discussion
Could you please confirm if you are using JDK 8? The error message in AutoRun.err is:

Exception in thread "main" java.lang.NoClassDefFoundError: javax/activation/MimetypesFileTypeMap
at org.nrg.xnat.client.data.XnatDataClient.<clinit>(XnatDataClient.java:736)
Caused by: java.lang.ClassNotFoundException: javax.activation.MimetypesFileTypeMap
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 1 more

--
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/CAGKzk9Wp_uaD-NzBLOQeoatAyWv8_DrKCqgGyzrC7--GgZjHsg%40mail.gmail.com.

Sara

unread,
Sep 22, 2020, 9:46:48 AM9/22/20
to xnat_discussion
Hi Mohana,
thank you for your reply.
If I type in the terminal:

$ java --version
openjdk 11.0.8 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu120.04)
OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu120.04, mixed mode, sharing)
$ echo  $JAVA_HOME
/usr/lib/jvm/java-8-openjdk-amd64/


I installed JDK 8 without uninstalling JDK 11, but only setting the JAVA_HOME (so naively I guess!...).
How can I fix this? Simply deleting JDK 11?

Best,
Sara

Mohana Ramaratnam

unread,
Sep 22, 2020, 9:57:51 AM9/22/20
to xnat_discussion
Hi Sara,

JDK version > 8 will encounter the issue you are facing. 

You need to make sure that tomcat process owner has  JAVA_HOME set to JDK versions 7 or 8 and that the PATH variable picks up JDK 7/8. 


Regards,
Mohana 

Sara

unread,
Sep 22, 2020, 10:07:44 AM9/22/20
to xnat_discussion
Hi Mohana,
this is how my /etc/default/tomcat7 looks like.
Is that correct?

Thanks,
S

# Run Tomcat as this user ID. Not setting this or leaving it blank will use the
# default of tomcat7.
TOMCAT7_USER=xnat

# Run Tomcat as this group ID. Not setting this or leaving it blank will use
# the default of tomcat7.
TOMCAT7_GROUP=xnat

# The home directory of the Java development kit (JDK). You need at least
# JDK version 6. If JAVA_HOME is not set, some common directories for
# OpenJDK, the Oracle JDK, and various Java SE 6+ versions are tried.
JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/"

# You may pass JVM startup parameters to Java here. If unset, the default
# options will be: -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC
#
# Use "-XX:+UseConcMarkSweepGC" to enable the CMS garbage collector (improved
# response time). If you use that option and you run Tomcat on a machine with
# exactly one CPU chip that contains one or two cores, you should also add
# the "-XX:+CMSIncrementalMode" option.
#JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC"
JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true -Xmx512m -XX:MaxPermSize=256m -XX:+UseConcMarkSweepGC"

# To enable remote debugging uncomment the following line.
# You will then be able to use a java debugger on port 8000.
#JAVA_OPTS="${JAVA_OPTS} -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
JAVA_OPTS="${JAVA_OPTS} -Dxnat.home=/data/xnat/home"
CATALINA_OPTS="${CATALINA_OPTS} -Dxnat.home=/data/xnat/home"

# Java compiler to use for translating JavaServer Pages (JSPs). You can use all
# compilers that are accepted by Ant's build.compiler property.
#JSP_COMPILER=javac

# Use the Java security manager? (yes/no, default: no)
#TOMCAT7_SECURITY=no

# Number of days to keep logfiles in /var/log/tomcat7. Default is 14 days.
#LOGFILE_DAYS=14
# Whether to compress logfiles older than today's
#LOGFILE_COMPRESS=1

# Location of the JVM temporary directory
# WARNING: This directory will be destroyed and recreated at every startup !
#JVM_TMP=/tmp/tomcat7-temp

Herrick, Rick

unread,
Sep 22, 2020, 11:56:36 AM9/22/20
to xnat_di...@googlegroups.com

That looks correct, but that only affects how Tomcat is run. The pipeline engine is invoked by the XNAT application, but it uses whatever version of Java is configured in the XNAT user’s server environment, i.e. the environment for the user on the server system, not what’s specified in the Tomcat configuration. The application that’s failing, XnatDataClient, is invoked through the script in xnat-tools/XnatDataClient, which looks like this:

 

java -classpath … org.nrg.xnat.client.data.XnatDataClient $@

 

JAVA_HOME affects some things like, e.g., locating jar files and native code libraries and so on, but the executable that gets run when you type in something like java on the command line is dependent on the user’s path. So you have a couple of options to fix this:

 

  • Modify the XNAT user’s path to reference the Java 8 bin folder explicitly
  • Uninstall Java 11
  • Use update-java-alternatives to set the default JRE/JDK for the system

 

The latter is probably the best and easiest. Just do this:

 

$ update-java-alternatives --list

java-1.11.0-openjdk-amd64      1111       /usr/lib/jvm/java-1.11.0-openjdk-amd64

java-1.8.0-openjdk-amd64       1081       /usr/lib/jvm/java-1.8.0-openjdk-amd64

$ update-java-alternatives --set java-1.8.0-openjdk-amd64

update-alternatives: error: no alternatives for mozilla-javaplugin.so

update-java-alternatives: plugin alternative does not exist: /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/IcedTeaPlugin.so

$ javac -version

javac 1.8.0_265

 

You may or may not see those warnings/errors about “no alternatives for…”, “plugin alternative does not exist…” If you do, don’t worry about it: it’s just saying there’s no browser plugin for applet support, which hasn’t been supported in any major browser for a few years now anyway.

 

-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

Phone: +1 (314) 273-1645

 

From: xnat_di...@googlegroups.com <xnat_di...@googlegroups.com>
Date: Tuesday, September 22, 2020 at 9:07 AM
To: xnat_discussion <xnat_di...@googlegroups.com>
Subject: Re: [XNAT Discussion] Autorun fails upon uploading

* External Email - Caution *

 


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.

Sara

unread,
Sep 23, 2020, 4:35:36 AM9/23/20
to xnat_discussion
Thank you Rick! The latter option worked.
Best,
S
Reply all
Reply to author
Forward
0 new messages