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.