site not reachable: XNAT installation on Ubuntu VM

168 views
Skip to first unread message

Jianliang Gao

unread,
Nov 1, 2018, 8:37:47 AM11/1/18
to xnat_discussion
Dear Rick and colleagues,

I tried to install XNAT on a Ubuntu VM following the tutorial https://wiki.xnat.org/display/XNAT17/XNAT+Installation+Guide

I set the URL as my domain, when I accessed from my browser, with 8080 shows the tomcat7 working page. But without 8080, the site is not reachable.

My VM runs on Ubuntu 16.04.5 LTS
I have java 1.8.0_121, tomcat7, postgresql 9.5 installed.

The xnat-conf.properties file was copied from the sample file without change.

Anything could go wrong?

Thank you in advance.

Best wishes,
Jianliang

Ralph Brecheisen

unread,
Nov 1, 2018, 8:45:33 AM11/1/18
to xnat_di...@googlegroups.com
Did you unpack the xnat.war file as well? 

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/xnat_discussion/a236cf9d-dcb1-467d-b411-9de12533eec6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Sent from my iPhone

Jianliang Gao

unread,
Nov 1, 2018, 8:56:44 AM11/1/18
to xnat_discussion
Hi Ralph,

Thank you. Do you mean xnat-web-1.7.4.1.war? I only copied the file into /var/lib/tomcat7/webapps and renamed as ROOT.war. Shall I extract all the files from ROOT.war into ROOT dir?

Best wishes,
Jianliang

Ralph Brecheisen

unread,
Nov 1, 2018, 8:59:08 AM11/1/18
to xnat_di...@googlegroups.com
Yes, that's the file. I'm using a Dockerized version of XNAT and that one requires you to download the XNAT WAR file and rename it xnat.war
I'm not sure the ROOT name is going to work. Unpacking should not be necessary.

Ralph

Jianliang Gao

unread,
Nov 1, 2018, 9:05:39 AM11/1/18
to xnat_discussion
I tried and now even the <my domain>:8080 stops working.... :-(

Moore, Charlie

unread,
Nov 1, 2018, 9:10:48 AM11/1/18
to xnat_di...@googlegroups.com

Jianliang,

 

If you see a “tomcat7  working page”, that sounds like a default tomcat7 webapp just to let you verify things are working. If you put the XNAT war in place as ROOT.war, but the default tomcat application is already sitting unpacked in a ROOT directory (all within the webapps folder), tomcat is just going to ignore the war file and continue chugging away with the ROOT directory. So, try clearing out the contents of the webapp directory, and drop the XNAT war in as ROOT.war.

 

Thanks,

Charlie


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.

Jianliang Gao

unread,
Nov 1, 2018, 9:15:24 AM11/1/18
to xnat_discussion
Hi Charlie,

Many thanks.

I did and seems tomcat7 has no working webapp now. <my domain> or <my domain>:8080 stops working. Any advise please?

Best wishes,
Jianliang

Moore, Charlie

unread,
Nov 1, 2018, 9:18:23 AM11/1/18
to xnat_di...@googlegroups.com

Is there anything in the XNAT logs, or in /var/log/tomcat7 ?


For more options, visit https://groups.google.com/d/optout.

Jianliang Gao

unread,
Nov 1, 2018, 9:24:07 AM11/1/18
to xnat_discussion
Hi Charlie,

The /var/log/tomcat7/catalina.out gives

tail -f /var/log/tomcat7/catalina.out 
Nov 01, 2018 1:11:03 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [] startup failed due to previous errors
Nov 01, 2018 1:11:03 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc
SEVERE: The web application [] registered the JDBC driver [org.postgresql.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Nov 01, 2018 1:11:03 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /var/lib/tomcat7/webapps/ROOT.war has finished in 23,121 ms
Nov 01, 2018 1:11:03 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Nov 01, 2018 1:11:03 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 23204 ms

The status of tomcat7 shows running ....

By the way, should CATALINA_OPTS="${CATALINA_OPTS} -Dxnat.home=/data/xnat/home" go into /etc/default/tomcat7 in a separate line or append -Dxnat.home=/data/xnat/home to JAVA_OPTS ?

Thank you very much.



Best wishes,
Jianliang

Herrick, Rick

unread,
Nov 1, 2018, 10:18:09 AM11/1/18
to xnat_di...@googlegroups.com

A couple things…

 

Regarding Ralph’s earlier comment about extracting the war file and the naming of that file, Tomcat installs applications at a context corresponding to the name of the war file minus its extension, so if you put the file in there as foo.war, then your XNAT application will be accessible at http://server:8080/foo and xnat.war would be http://server:8080/xnat, etc. This holds with one exception, which is naming the war file ROOT.war, in which case XNAT is available at the root context, i.e. http://server:8080 with no other path. On start-up, if you have only the war file in the webapps folder, Tomcat extracts the contents of that war file into a folder with the same name, so ROOT.war is extracted into ROOT, xnat.war is extracted into xnat, and so on (there’s a setting unpackWARs that dictates how Tomcat unpacks the war file, but Tomcat still extracts the contents of the war file even if this set to false: it just extracts the contents into a work folder instead of directly into the webapps folder).

 

Regarding Charlie’s comment about Tomcat using the contents of the ROOT folder over the contents of the war file, this is mostly true. Once you’ve deployed a war file and Tomcat has extracted the contents, you can then go into that folder and modify files in there, e.g. change a VM or JS or JSP file, or even replace class or jar files, and those changes will be reflected in the application (resources like VMs and the like will change as soon as you reload a page, but changes to class and jar files that have already been loaded require a restart of Tomcat). However, if you deploy a new war file, Tomcat will extract the contents of that war file and overwrite the corresponding files in the application folder.*

 

Here's what I think is going on:

 

When you were initially able to reach http://server:8080, you had XNAT up and running fine. However, http://server goes to port 80 (https://server goes to 443) and wouldn’t reach Tomcat unless you had something like nginx or Apache httpd to handle directing traffic from port 80 or 443 to port 8080. When you then renamed ROOT.war to xnat.war, http://server:8080 no longer worked because XNAT was then running at http://server:8080/xnat.

 

I’d suggest the following steps:

 

  1. Shut down Tomcat: systemctl stop tomcat7.service
  2. Delete the contents of the webapps folder: rm -rf /var/lib/tomcat7/webapps/*
  3. Copy the XNAT war into the webapps folder as ROOT.war: cp xnat-web-whatever.war /var/lib/tomcat7/webapps/ROOT.war
  4. Start Tomcat back up: systemctl start tomcat7.service
  5. Install nginx: apt install nginx
  6. Create a new file named server in /etc/nginx/sites-available with the following contents (substitute your server name, e.g. we use xnatdev.xnat.org for our dev VM, wherever you see server, including the name of the file you’re creating):

 

server {

    listen 80;

    listen [::]:80 default_server;

    server_name server;

 

    location / {

        proxy_pass                          http://localhost:8080;

        proxy_redirect                      http://localhost:8080 $scheme://server;

        proxy_set_header Host               $host;

        proxy_set_header X-Real-IP          $remote_addr;

        proxy_set_header X-Forwarded-Host   $host;

        proxy_set_header X-Forwarded-Server $host;

        proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;

        proxy_connect_timeout               1200;

        proxy_send_timeout                  1200;

        proxy_read_timeout                  1200;

        send_timeout                        1200;

        proxy_buffers                       4 32k;

        client_max_body_size                0;

        client_body_buffer_size             128k;

    }

}

  1. Delete any existing links or files in /etc/nginx/sites-enabled (I think the only one that’s in there to start is named default)
  2. Create a symlink in /etc/nginx/sites-enabled to that new file: ln -s /etc/nginx/sites-available/server  /etc/nginx/sites-enabled/server
  3. Test your configuration by running: nginx -t
  4. Assuming the test shows no errors, start nginx: systemctl start nginx.service

 

Once nginx has started, you should now be able to reach XNAT through the URL http://server.

 

* Tomcat *may* do a timestamp comparison in this case, so if you’ve updated a VM template in the ROOT folder and not updated it in the new war file, Tomcat *may* not overwrite the version in the folder with the version from the war file. I haven’t tested this, but you do get some weird behavior in this kind of scenario. I know that it will definitely *not* delete files in the ROOT folder that are no longer in the war file, which can also lead to weird behavior. That’s why, whenever I’m deploying a new war file, I always delete the corresponding folder, something along the lines of:

 

$ systemctl stop tomcat7.service

$ rm -rf /var/lib/tomcat7/webapps/ROOT*

$ cp xnat-web-1.7.5-SNAPSHOT.war /var/lib/tomcat7/webapps/ROOT.war

$ systemctl start tomcat7.service

 

-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

Phone: +1 (314) 273-1645


For more options, visit https://groups.google.com/d/optout.

Jianliang Gao

unread,
Nov 1, 2018, 10:37:00 AM11/1/18
to xnat_discussion
Hi Rick,

Thank you very much for the detail. I will follow and try. Shall I keep the xnat-conf.properties unchanged like?

Sample XNAT configuration
datasource.driver=org.postgresql.Driver
datasource.url=jdbc:postgresql://localhost/xnat
datasource.username=xnat
datasource.password=xnat
  
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

Also, after I make those changes, should I just run ./gradlew again to install the pipeline?

Thank you very much.

Best wishes,
Jianliang

Herrick, Rick

unread,
Nov 1, 2018, 10:38:23 AM11/1/18
to xnat_di...@googlegroups.com

Presuming you have PostgreSQL running on the same server as XNAT, with a database user named xnat and a database named xnat, then yes that should be fine.

 

And no, you shouldn’t need to reinstall the pipeline.


For more options, visit https://groups.google.com/d/optout.

Jianliang Gao

unread,
Nov 1, 2018, 10:44:31 AM11/1/18
to xnat_discussion
Hi Rick,

Yes, I am trying to install everything on one VM. I will try and let you know the update. Thank you very much.


Best wishes,
Jianliang

Jianliang Gao

unread,
Nov 1, 2018, 5:35:27 PM11/1/18
to xnat_discussion
Hi Rick,

For some reasons, my VM crashed. I didn't bother to recover it. I tried with a new VM and this time I used xnat.war to deploy http://<my domain>/xnat  I think the xnat.war was deployed successfully. But I have another issue as 

Nov 01, 2018 9:26:41 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
Nov 01, 2018 9:26:42 PM org.apache.catalina.core.StandardContext setPath
WARNING: A context path must either be an empty string or start with a '/' and do not end with a '/'. The path [/] does not meet these criteria and has been changed to []
Nov 01, 2018 9:27:33 PM 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.
Nov 01, 2018 9:27:34 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /var/lib/tomcat7/webapps/ROOT has finished in 52,609 ms
Nov 01, 2018 9:27:35 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Nov 01, 2018 9:27:37 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 407602 ms
Exception in thread "http-bio-8080-exec-1" java.lang.OutOfMemoryError: Java heap space
at sun.nio.cs.ext.EUC_CN.<clinit>(EUC_CN.java:1266)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at sun.nio.cs.AbstractCharsetProvider.lookup(AbstractCharsetProvider.java:142)
at sun.nio.cs.AbstractCharsetProvider.access$000(AbstractCharsetProvider.java:45)
at sun.nio.cs.AbstractCharsetProvider$1.next(AbstractCharsetProvider.java:183)
at sun.nio.cs.AbstractCharsetProvider$1.next(AbstractCharsetProvider.java:173)
at java.nio.charset.Charset.put(Charset.java:539)
at java.nio.charset.Charset.access$200(Charset.java:271)
at java.nio.charset.Charset$3.run(Charset.java:581)
at java.nio.charset.Charset$3.run(Charset.java:573)
at java.security.AccessController.doPrivileged(Native Method)
at java.nio.charset.Charset.availableCharsets(Charset.java:572)
at org.apache.tomcat.util.buf.B2CConverter.<clinit>(B2CConverter.java:51)
at org.apache.tomcat.util.buf.ByteChunk.<clinit>(ByteChunk.java:102)
at org.apache.tomcat.util.buf.MessageBytes.<init>(MessageBytes.java:59)
at org.apache.tomcat.util.buf.MessageBytes.<init>(MessageBytes.java:37)
at org.apache.tomcat.util.buf.MessageBytes$MessageBytesFactory.newInstance(MessageBytes.java:687)
at org.apache.tomcat.util.buf.MessageBytes.newInstance(MessageBytes.java:79)
at org.apache.coyote.Request.<init>(Request.java:83)
at org.apache.coyote.AbstractProcessor.<init>(AbstractProcessor.java:61)
at org.apache.coyote.http11.AbstractHttp11Processor.<init>(AbstractHttp11Processor.java:273)

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "http-bio-8080-exec-1"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ActiveMQ Broker[activeMQBroker] Scheduler"
Exception in thread "http-bio-8080-exec-2" java.lang.OutOfMemoryError: Java heap space

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "http-bio-8080-Acceptor-0"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "http-bio-8080-exec-4"
Exception in thread "http-bio-8080-exec-6" java.lang.OutOfMemoryError: Java heap space
Exception in thread "org.springframework.jms.listener.DefaultMessageListenerContainer#4-1" java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space

My VM has 2GB RAM.
How to figure this out? Thank you very much.

Best wishes,
Jianliang

Herrick, Rick

unread,
Nov 1, 2018, 5:44:43 PM11/1/18
to xnat_di...@googlegroups.com

The amount of RAM the VM has doesn’t matter if you don’t have Tomcat’s JVM configured to use it. Have a look here:

 

https://wiki.xnat.org/display/XNAT17/Configuring+Tomcat+To+Avoid+Errors

 

The XNAT Vagrant VM setup can be a good place to look for examples of how these things are configured. For example, the file templates/tomcat7.tmpl is the template used to replace the default Tomcat configuration. That includes this:

 

CATALINA_OPTS="-Xms512m -Xmx1g -XX:+UseConcMarkSweepGC -XX:-OmitStackTraceInFastThrow"

CATALINA_OPTS="${CATALINA_OPTS} -XX:+CMSIncrementalMode -XX:+CMSClassUnloadingEnabled"

CATALINA_OPTS="${CATALINA_OPTS} -Dxnat.home=@XNAT_HOME@"

CATALINA_OPTS="${CATALINA_OPTS} -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000"

 

I’d suggest allocating at least 4GB of RAM to your VM and 2GB to the Tomcat JVM if you have the 4GB to spare on the host machine.


For more options, visit https://groups.google.com/d/optout.

Jianliang Gao

unread,
Nov 1, 2018, 5:49:37 PM11/1/18
to xnat_discussion
Hi Rick,

Thank you very much for your quick reply.

I changed java memory use from 128m to 512m in the /etc/default/tomcat7 

After restarted tomcat7, I tried to connect by http://<my domain>:8080/xnat

I have now the following error in the browser:

XNAT has encountered an error with your request:

If this error continues to occur, please contact your system administrator with information about how to recreate the problem.


Is that still the RAM issue because it has been set?


Best wishes,

Jianliang

Herrick, Rick

unread,
Nov 1, 2018, 5:51:09 PM11/1/18
to xnat_di...@googlegroups.com

I have no idea. 512MB is pretty low, but should probably work. You need to check the Tomcat and XNAT logs to see if there are any error messages there.


For more options, visit https://groups.google.com/d/optout.

Jianliang Gao

unread,
Nov 1, 2018, 6:15:51 PM11/1/18
to xnat_discussion
Hi Rick,

Tomcat7 didn't have errors.

XNAT logs contain some errors like:

/data/src/xnat-pipeline-engine# tail -f /data/xnat/home/logs/xdat.log 
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.nrg.xdat.security.user.exceptions.UserNotFoundException: Invalid Login and/or Password
at org.nrg.xdat.security.XDATUser.<init>(XDATUser.java:101)
at org.nrg.xdat.security.XDATUserMgmtServiceImpl.getUser(XDATUserMgmtServiceImpl.java:66)
at org.nrg.xdat.security.XDATUserMgmtServiceImpl.getGuestUser(XDATUserMgmtServiceImpl.java:87)
at org.nrg.xdat.security.helpers.Users.getGuest(Users.java:224)
at org.nrg.xdat.security.helpers.Users.getGuest(Users.java:205)
at org.nrg.xdat.XDAT.getUserDetails(XDAT.java:168)
... 34 more
^C
/data/src/xnat-pipeline-engine# tail -f /data/xnat/home/logs/axis.log 
21036 [localhost-startStop-1] ERROR org.apache.axis.configuration.EngineConfigurationFactoryServlet  - Unable to find config file.  Creating new servlet engine config file: /WEB-INF/server-config.wsdd
21425 [localhost-startStop-1] ERROR org.apache.axis.configuration.EngineConfigurationFactoryServlet  - Unable to find config file.  Creating new servlet engine config file: /WEB-INF/server-config.wsdd
5468 [localhost-startStop-1] ERROR org.apache.axis.configuration.EngineConfigurationFactoryServlet  - Unable to find config file.  Creating new servlet engine config file: /WEB-INF/server-config.wsdd
5672 [localhost-startStop-1] ERROR org.apache.axis.configuration.EngineConfigurationFactoryServlet  - Unable to find config file.  Creating new servlet engine config file: /WEB-INF/server-config.wsdd
6024 [localhost-startStop-1] ERROR org.apache.axis.configuration.EngineConfigurationFactoryServlet  - Unable to find config file.  Creating new servlet engine config file: /WEB-INF/server-config.wsdd
6317 [localhost-startStop-1] ERROR org.apache.axis.configuration.EngineConfigurationFactoryServlet  - Unable to find config file.  Creating new servlet engine config file: /WEB-INF/server-config.wsdd
^C
/data/src/xnat-pipeline-engine# tail -f /data/xnat/home/logs/jms.log 
at org.apache.activemq.broker.TransportConnection.processRemoveConsumer(TransportConnection.java:593)
at org.apache.activemq.command.RemoveInfo.visit(RemoveInfo.java:76)
at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:294)
at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:152)
at org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:116)
at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50)
at org.apache.activemq.transport.vm.VMTransport.iterate(VMTransport.java:241)
at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:129)
at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:47)
... 3 more
^C
/data/src/xnat-pipeline-engine# tail -f /data/xnat/home/logs/security.log 
at org.nrg.xnat.security.RefreshGuestUser.run(RefreshGuestUser.java:42)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
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)
2018-11-01 22:09:22,210 [taskScheduler-1] ERROR org.nrg.xnat.security.RefreshGuestUser - An error occurred trying to refresh guest user.
org.nrg.xdat.security.user.exceptions.UserNotFoundException: Invalid Login and/or Password
at org.nrg.xdat.security.XDATUser.<init>(XDATUser.java:101)
at org.nrg.xdat.security.XDATUserMgmtServiceImpl.getUser(XDATUserMgmtServiceImpl.java:66)
at org.nrg.xdat.security.XDATUserMgmtServiceImpl.getGuestUser(XDATUserMgmtServiceImpl.java:87)
at org.nrg.xdat.security.helpers.Users.getGuest(Users.java:224)
at org.nrg.xnat.security.RefreshGuestUser.run(RefreshGuestUser.java:42)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
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)

What do the above messages suggest?

Many thanks,
Best wishes,
J

        proxy_set_header Host  &

Herrick, Rick

unread,
Nov 1, 2018, 6:59:27 PM11/1/18
to xnat_di...@googlegroups.com

Try shutting down Tomcat, clearing out your XNAT logs (e.g. rm -f /data/xnat/home/logs/*), then restarting Tomcat. That way any log entries that were created during earlier issues with getting XNAT up won’t be in there to confuse matters.

 

Once you’ve done that and can’t get any farther accessing your XNAT, grab any logs that have contents (other than access.log and axis.log, which aren’t helpful at all). If you can post those to a gist on github or something similar, that’d be helpful.

 

-- 

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> on behalf of Jianliang Gao <pilla...@gmail.com>
Reply-To: "xnat_di...@googlegroups.com" <xnat_di...@googlegroups.com>
Date: Thursday, November 1, 2018 at 5:15 PM
To: "xnat_di...@googlegroups.com" <xnat_di...@googlegroups.com>
Subject: Re: [XNAT Discussion] site not reachable: XNAT installation on Ubuntu VM

 

Hi Rick,

 

Tomcat7 didn't have errors.

--

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.

Jianliang Gao

unread,
Nov 2, 2018, 4:18:23 AM11/2/18
to xnat_discussion
Hi Rick,

Many thanks for the suggestions.
I followed your instruction and got these:

# tail -f /data/xnat/home/logs/axis.log 
4978 [localhost-startStop-1] ERROR org.apache.axis.configuration.EngineConfigurationFactoryServlet  - Unable to find config file.  Creating new servlet engine config file: /WEB-INF/server-config.wsdd
5196 [localhost-startStop-1] ERROR org.apache.axis.configuration.EngineConfigurationFactoryServlet  - Unable to find config file.  Creating new servlet engine config file: /WEB-INF/server-config.wsdd

# tail -f /data/xnat/home/logs/tasks.log 
2018-11-02 08:13:02,203 [taskScheduler-1] INFO  org.nrg.xnat.initialization.tasks.CreateOrUpdateDatabaseViews - This service is the primary XNAT node, checking whether database updates are required.
2018-11-02 08:13:02,212 [taskScheduler-1] INFO  org.nrg.xnat.initialization.tasks.CreateOrUpdateDatabaseViews - Initializing database views...
2018-11-02 08:13:09,536 [taskScheduler-1] INFO  org.nrg.xnat.initialization.tasks.CreateOrUpdateDatabaseViews - View initialization complete.

# tail -f /data/xnat/home/logs/xdat.log 
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.nrg.xdat.security.user.exceptions.UserNotFoundException: Invalid Login and/or Password
at org.nrg.xdat.security.XDATUser.<init>(XDATUser.java:101)
at org.nrg.xdat.security.XDATUserMgmtServiceImpl.getUser(XDATUserMgmtServiceImpl.java:66)
at org.nrg.xdat.security.XDATUserMgmtServiceImpl.getGuestUser(XDATUserMgmtServiceImpl.java:87)
at org.nrg.xdat.security.helpers.Users.getGuest(Users.java:224)
at org.nrg.xdat.security.helpers.Users.getGuest(Users.java:205)
at org.nrg.xdat.XDAT.getUserDetails(XDAT.java:168)
... 34 more

Best wishes,
Jianliang

Herrick, Rick

unread,
Nov 2, 2018, 10:41:39 AM11/2/18
to xnat_di...@googlegroups.com

Something very weird is going on there. That’s trying to initialize the guest user, but the guest user isn’t in the database, which has to mean the database isn’t getting initialized properly since the guest user is inserted in the default initialization script. Try dropping your database and recreating it. The values you use depend on what you have configured in your xnat-conf.properties. If you have the default values like this:

 

datasource.url=jdbc:postgresql://localhost/xnat
datasource.username=xnat
datasource.password=xnat

 

Then the commands would

 

$ dropdb xnat

$ createdb -U xnat xnat

 

Make sure there are no tables in that database to ensure that XNAT will actually initialize and populate the database. During start-up, you should see this in the Tomcat Catalina.out log:

 

===========================
New Database -- BEGINNING Initialization
===========================

===========================

Database initialization complete.

===========================

 

Verify that the guest and admin users were added:

 

$ psql -c "select login from xdat_user"

login

-------

admin

guest

(2 rows)


For more options, visit https://groups.google.com/d/optout.

Jianliang Gao

unread,
Nov 3, 2018, 5:37:04 AM11/3/18
to xnat_discussion
Hi Rick,

Thank you very much for your help. For my case, I finally got the solution by 
(1) set ownership of /etc/default/tomcat7  to user tomcat7
(2) added "-Xms1024m -Xmx6028m" to JAVA_OPTS

There are other minor issues about in-browser viewing and file counts.
(1) I injected data by REST API using root user. The ownership of  injected symbolic links and actual data were root user. If I didn't change files ownership to tomcat7, the file counts and in-browser viewer didn't work. Even I added tomcat7 into root group, they didn't work either. 
(2) To enable in-browser viewing and file downloading, the file counts must show the data file size. To do that, I had to manually click file count for every subject. Any better way to do that?

Best wishes,
Jianliang
Reply all
Reply to author
Forward
0 new messages