http://localhost not working after docker-compose set up

103 views
Skip to first unread message

Ian Hardingham

unread,
Jul 26, 2021, 10:02:55 AM7/26/21
to xnat_discussion
Hi all,

I've followed the docker-compose setup instructions here:


It installs correctly, this is the end of the setup messages:

TCP socket on 172.18.0.1:80 of 'xnat-traefik' is ready
Probing TCP socket on 172.18.0.1:8080 of 'xnat-traefik'
TCP socket on 172.18.0.1:8080 of 'xnat-traefik' is ready
Probing TCP socket on 172.18.0.1:8000 of 'xnat-web'
TCP socket on 172.18.0.1:8000 of 'xnat-web' is ready
+--------------+----------------+-----------------+
| Name         | Container Port | Mapping         |
+--------------+----------------+-----------------+
| xnat-traefik | 80             | 172.18.0.1:80   |
| xnat-traefik | 8080           | 172.18.0.1:8080 |
+--------------+----------------+-----------------+
| xnat-web     | 8000           | 172.18.0.1:8000 |
| xnat-web     | 8104           | 172.18.0.1:8104 |
| xnat-web     | 8144           | 172.18.0.1:8144 |
+--------------+----------------+-----------------+

BUILD SUCCESSFUL in 22s
4 actionable tasks: 2 executed, 2 up-to-date

It says to go to http://localhost, but when I do I get:

curl http://localhost
<!doctype html><html lang="en"><head><title>HTTP Status 404 – Not Found</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 404 – Not Found</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Description</b> The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.</p><hr class="line" /><h3>Apache Tomcat/9.0.50</h3></body></html>

What should I try next?
Message has been deleted

Herrick, Rick

unread,
Jul 26, 2021, 10:21:43 AM7/26/21
to xnat_di...@googlegroups.com

Have a look at the various log files. The Tomcat logs are in xnat-data/tomcat, while the XNAT logs are in xnat-data/logs.

 

-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

Phone: +1 (314) 273-1645

 

From: 'Ian Hardingham' via xnat_discussion <xnat_di...@googlegroups.com>
Date: Monday, July 26, 2021 at 9:03 AM
To: xnat_discussion <xnat_di...@googlegroups.com>
Subject: [XNAT Discussion] http://localhost not working after docker-compose set up

* External Email - Caution *

--
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/d4dea869-10c9-4ba3-9e6b-c8a8d76d971bn%40googlegroups.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.

Ian Hardingham

unread,
Jul 27, 2021, 7:47:17 AM7/27/21
to xnat_discussion

The only non-empty log in xnat-data/logs is spring.log:

~/xnat-docker-compose/xnat-data/logs$ sudo cat spring.log
2021-07-26 10:14:09,771 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/conf/mq-context.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/conf/mq-context.xml]
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:344)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromImportedResources(ConfigurationClassBeanDefinitionReader.java:354)
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:143)
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:320)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:228)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:272)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:92)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:687)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:524)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4766)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5230)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:728)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1024)
    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1911)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
    at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:825)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1618)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
    at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
    at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:948)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1388)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:921)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:437)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:934)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/conf/mq-context.xml]
    at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:141)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:330)

Can you advise?

Herrick, Rick

unread,
Jul 27, 2021, 5:24:07 PM7/27/21
to xnat_di...@googlegroups.com

What do you see in xnat-data/webapps/ROOT/WEB-INF/conf? That’s where mq-context.xml should be.

 

This isn’t a wildly complex operation: mq-context.xml is part of the war file and loads on XNAT start-up every time, so if that’s broken then your app is broken.

 

You might try deleting the contents of xnat-data/webapps, copying or downloading a new copy of the war file to xnat-data/webapps/ROOT.war, and restarting.

 

-- 

Rick Herrick

XNAT Architect/Developer

Computational Imaging Laboratory

Washington University School of Medicine

Ian Hardingham

unread,
Jul 29, 2021, 4:32:59 AM7/29/21
to xnat_discussion
Thank you Rick. 

xnat-data/webapps/ROOT/WEB-INF does not have a conf in it (just "classes"), so I presume that's an issue.

I've downloaded the xnat-web-1.8.2.2.war file, extracted WEB-INF from it, and placed it on the server.

Can you explain how to "restart" now?  I apologise for the basic questions, I don't have experience with Apache.

Ian
Reply all
Reply to author
Forward
0 new messages