5

We have DXA 1.5 installed on SDL Web 8.1. CM on Windows, CD on RedHat. Microservices installed and DXA example Publication deployed to the Broker DB. The Java web app is deployed in Tomcat 8.5 on port 8080.

Testing the website on http://localhost:8080/ throws the error below in catalina.out.

We have this baseurl registered in Topology manager for the website.

Two questions:

  1. Why would CD throw an error suggesting that we update cd_dynamic.conf.xml with a Publication mapping? This is not meant to be required for Web 8.

  2. We have a port proxy between CM and CD with all services going through a single port and available on a diffferent contexts; this all seems fine and we can see the service endpoints from the CM server. What impact might this have on the URLs that we configure in the Discovery Service storage conf file? And might this be messing up the mapping process and breaking the site?

[http-nio-8080-exec-9] INFO com.tridion.ambientdata.web.AbstractAmbientDataServletFilter - Requested by IP: /0:0:0:0:0:0:0:1 [http-nio-8080-exec-9] ERROR com.sdl.webapp.common.controller.PageController - Failed to retrieve localization for request url = http://localhost:8080/, uri = / com.sdl.webapp.common.api.localization.LocalizationNotFoundException: Localization not found at com.sdl.webapp.common.impl.WebRequestContextImpl.localization(WebRequestContextImpl.java:350) at com.sdl.webapp.common.impl.WebRequestContextImpl.getLocalization(WebRequestContextImpl.java:166) at com.sdl.webapp.common.impl.WebRequestContextImpl$$FastClassByCGLIB$$2bfec188.invoke() at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622) at com.sdl.webapp.common.impl.WebRequestContextImpl$$EnhancerByCGLIB$$96c02acd.getLocalization() at com.sdl.webapp.common.impl.interceptor.StaticContentInterceptor.preHandle(StaticContentInterceptor.java:98) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:914) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at com.tridion.ambientdata.web.AbstractAmbientDataServletFilter.doFilter(AbstractAmbientDataServletFilter.java:286) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1110) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:785) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1425) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: com.sdl.webapp.tridion.PublicationMappingNotFoundException: Publication mapping not found. Check if your cd_dynamic_conf.xml configuration file contains a publication mapping that matches this URL: http://localhost:8080/ at com.sdl.webapp.tridion.TridionLocalizationResolver.getPublicationMappingData(TridionLocalizationResolver.java:26) at com.sdl.webapp.tridion.AbstractTridionLocalizationResolver.getLocalization(AbstractTridionLocalizationResolver.java:61) at com.sdl.webapp.common.impl.WebRequestContextImpl.localization(WebRequestContextImpl.java:334)

3

The reason for this is your Discovery / Topology setup (assuming you are using the new Topology Manager)

When DXA tries to resolve the URL, it does not find any matches in the Topology Database, and therefore thinks it should not handle the request.

If you run Get-TtmWebsite and look at the BaseUrls of your website, I would expect that you will not see an entry for http://localhost:8080

To add / update the BaseUrls, to add http://localhost:8080 you can run

Set-TtmWebsite -Id WebsiteId -BaseUrls "http://url1:port", "http://url2:port", "http://url3:port"
  • Hi, thanks. As mentioned in the question, we do have that URL for the website in Topology Manager. Good to know that this must be the problem area though. Does the URL need to be resolvable from the Topology Manager server? If so then I would need to add a different one using the proxy address. – M Roweth Jul 27 '16 at 6:13
  • Publication URL Mapping resolving is done through the Content Service (which gets its information from Discovery Service, which gets it from Topology Manager in turn). So: there is no direct communication from Web App to Topology Manager. – Rick Pannekoek Jul 27 '16 at 8:20
2

Regarding your first question: this is just a bug in the DXA error handling; indeed you shouldn't be messing with cd_dynamic_conf.xml in SDL Web 8.

Regarding proxies: the DXA Web Application only communicates with CIS microservices (Discovery, Content and Context), not with CM or TTM directly.

In SDL Web 8, you should indeed ensure that you have a Topology Manager Mapping which corresponds to the first part of your URL. If all is well, this is automatically propagated to the Discovery Service (and to the Content Service in turn). However, I have seen cases where the Discovery Service was out-of-sync with Topology Manager for some reason. You can force sync the Discovery Service using the Sync-TtmCdEnvironment cmdlet.

  • Thanks Rick. We've tried using Sync-TtmCdEnvironment and nothing changed. In the session service content log we are seeing something unusual: 2016-07-27 13:11:14,643 INFO GetPublicationMappingsFunction - Started processing function call for url : http:/hostname:8084/ 2016-07-27 13:11:14,655 DEBUG DynamicContentProvider - Can't resolve publication from given URL: http:/hostname:8084/ – M Roweth Jul 27 '16 at 11:25
  • There ought to be two slashes in this mapping but there is only one. We have registered the correct BaseUrl in topology manager and run Sync-TtmCdEnvironment. All the other log files refer to the correct mapping. I dont see this error on my working server. Any idea where we might be losing this forward slash? – M Roweth Jul 27 '16 at 11:25
  • That's very suspicious indeed, I would be inclined to blame the proxy for losing the slash. – Rick Pannekoek Jul 27 '16 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.