Error during installation

38 views
Skip to first unread message

patrik

unread,
Nov 8, 2017, 12:07:55 PM11/8/17
to xnat_discussion
Dear all,

I hope someone has the time to help a beginner trying to install XNAT 1.7.4 on Ubuntu 16.04 with openjdk-8-jdk, tomcat7 and postgreSQL-9.5.
This is a test installation and as a start I simply want to connect via localhost.  
I am following the installation instructions but run into problem when actually installing the WAR file (renamed to ROOT.war).
(Before this I made sure that I could get to the "It works!"-page via http://localhost:8080.) 
I just get a "refused to connect" message, and I'm afraid my knowledge is too low to even know how to look for the problem.
I tried looking in the catalina.log (is this the place to check?) and find e.g.:

SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-bio-8080"]
java.net.BindException: Address already in use (Bind failed) <null>:8080
at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:413)
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:650)
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:434)
at org.apache.coyote.http11.AbstractHttp11JsseProtocol.init

Does this give any clue?

In the xnat-conf.properties file, should I write 

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

or 

datasource.url=jdbc:postgresql://localhost:8080/xnat

Sorry for the beginner questions!

Cheers,
Patrik

Herrick, Rick

unread,
Nov 8, 2017, 12:47:14 PM11/8/17
to xnat_di...@googlegroups.com

That just means that something’s already using port 8080 and Tomcat therefore can’t use it. 99.9% of the time (and that figure is backed up by exhaustive studies with a high p-value and minimal margin of error) this means that Tomcat either wasn’t shut down at all prior to starting it up or didn’t shut down properly. You can find out if Tomcat is active or the state of it like this:

 

$ systemctl is-active tomcat7.service

active

 

If there’s something weird happening, you can check the logs in /var/log/tomcat7 or try this:

 

$ journalctl --unit=tomcat7

 

Try to shut Tomcat down the standard way:

 

$ systemctl stop tomcat7.service

 

If you can’t get control of the service through these means, you can get medieval on it. If there’s a run file for Tomcat (/var/run/tomcat7.pid), you can kill the process with the ID contained in there, then delete the run file. Otherwise you can find the PID through ps and kill it that way. Here’s a script that actually does all that:

 

#!/bin/bash

if [[ -f /var/run/tomcat7.pid ]]; then

    echo Found Tomcat run file, getting PID from that.

    TOMCAT_PID=$(cat /var/run/tomcat7.pid)

else

    echo Trying to get PID from ps.

    TOMCAT_PID=$(ps ax | fgrep tomcat7 | fgrep -v grep | awk '{$1=$1};1' | cut -f 1 -d " ")

fi

[[ -n ${TOMCAT_PID} ]] && { echo Killing Tomcat via PID: ${TOMCAT_PID}; kill -9 ${TOMCAT_PID}; } || { echo No PID found thru either Tomcat run file or ps, sorry.; }

[[ -f /var/run/tomcat7.pid ]] && { rm -f /var/run/tomcat7.pid; }

 

You’d need to run that as root.

 

Regarding the PostgreSQL URL, the first form is correct. If you did want or need to add a port, the port you’d use is actually the PostgreSQL server port, which is configured in /etc/postgresql/9.x/main/postgresql.conf. By default, this is configured to 5432, so really what postgresql://localhost means is postgresql://localhost:5432. The path after that is actually the database name.

 

So if you were to change the default value for the PostgreSQL listening port, you’d need to specify the port on your database URL, so if you had:

 

port = 5555

 

You’d change the line in your configuration to:

 

datasource.url=jdbc:postgresql://localhost:5555/xnat

 

Likewise, if you changed the database name from “xnat” to “foo”, this line would be:

 

datasource.url=jdbc:postgresql://localhost:5555/foo

 

HTH…

 

-- 

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.

patrik

unread,
Nov 9, 2017, 7:27:23 AM11/9/17
to xnat_discussion
Thank you so much for your reply!
I guess something was hanging on, blocking the port... I had closed the service using 
$ sudo service tomcat7 stop 
I suppose that should work as well(?)

I realized I also had some warnings of the type:

WARNING: Problem with directory [/usr/share/tomcat7/common/classes], exists: [false], isDirectory: [false], canRead: [false] Dec 06, 2014 11:50:23 PM org.apache.catalina.startup.ClassLoaderFactory validateFile 

but I created links to the /var/lib/tomcat7 folders. I hope this is ok. At least the warnings disappeared :|

Thanks again!!

Cheers,
Patrik
Reply all
Reply to author
Forward
0 new messages