2

I'm installing DXA 1.4 Java version with SDL Web 8. I import publication to Content Manager, and added a new publication which is child of "400 Example Site".

The new publication's URL is "/jp"

Then I deployed DXA War file and modified its context root name to "jp".

When requesting DXA by URL like "http://server/jp/index.html", following error occurs.

org.apache.jasper.JasperException: javax.el.ELException: com.sdl.webapp.common.controller.exception.NotFoundException: Localization for /assets/css/main.css not found.
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:555)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
    org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262)
    org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    com.tridion.ambientdata.web.AbstractAmbientDataServletFilter.doFilter(AbstractAmbientDataServletFilter.java:286)
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

Also follow error is output to dxa.log.

04:20:34.201 [http-nio-8080-exec-1] ERROR c.s.w.c.controller.PageController - Exception while processing request for: /jp/
java.lang.NullPointerException: null
        at com.tridion.dynamiccontent.publication.PublicationMapping.<init>(PublicationMapping.java:38) ~[content-compatible-8.1.1-1008.jar:8.1.1-1008]
        at com.tridion.dynamiccontent.DynamicMappingsRetriever.getPublicationMapping(DynamicMappingsRetriever.java:28) ~[content-compatible-8.1.1-1008.jar:8.1.1-1008]
        at com.sdl.webapp.tridion.TridionLocalizationResolver.getPublicationMappingData(TridionLocalizationResolver.java:23) ~[dxa-web8-provider-1.4.0.jar:1.4.0]
        at com.sdl.webapp.tridion.AbstractTridionLocalizationResolver.getLocalization(AbstractTridionLocalizationResolver.java:61) ~[dxa-tridion-provider-1.4.0.jar:1.4.0]
        at com.sdl.webapp.common.impl.interceptor.LocalizationResolverInterceptor.preHandle(LocalizationResolverInterceptor.java:78) ~[dxa-common-impl-1.4.0.jar:1.4.0]
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:914) ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) [servlet-api.jar:na]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) [servlet-api.jar:na]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) [catalina.jar:8.0.35]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.35]
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-websocket.jar:8.0.35]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.35]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.35]
        at com.tridion.ambientdata.web.AbstractAmbientDataServletFilter.doFilter(AbstractAmbientDataServletFilter.java:286) [web-ambient-client-8.1.1-1005.jar:8.1.1-1005]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.35]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.35]
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) [spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) [spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.35]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.35]
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) [catalina.jar:8.0.35]
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [catalina.jar:8.0.35]
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) [catalina.jar:8.0.35]
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) [catalina.jar:8.0.35]
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [catalina.jar:8.0.35]
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) [catalina.jar:8.0.35]
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [catalina.jar:8.0.35]
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528) [catalina.jar:8.0.35]
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099) [tomcat-coyote.jar:8.0.35]
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672) [tomcat-coyote.jar:8.0.35]
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520) [tomcat-coyote.jar:8.0.35]
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476) [tomcat-coyote.jar:8.0.35]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_91]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_91]
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:8.0.35]
        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91]

It seems DXA cannot resolve URL to publication.

How DXA resolve URL to publication?

How can I configure DXA to make this work?

UPDATE

I moved DXA directory "dxa-example-webapp" to docBase of Tomcat. The Tomcat's server.xml is following.

<Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true">
        <Context path="/" docBase="/var/www/dxa-example-webapp" reloadable="true" />
</Host>

I removed DXA and newly installed again, so publication and Topology Manager settings are default values(publication URL is "/").

I accessed URL "http://54.238.137.132:55280/index.html".

DXA seems to find index.html and header.html, but NullPointerException occurs after that.

What kind of configuration is wrong?

DXA.log is following.

Found index.html.

08:29:26.535 [http-nio-8080-exec-9] DEBUG c.s.w.t.m.AbstractDefaultProvider - Try to find page: [45] /index.html
08:29:26.535 [http-nio-8080-exec-9] DEBUG c.s.w.t.mapping.ModelBuilderPipeline - Invoking class com.sdl.webapp.tridion.mapping.PageBuilderImpl on index
08:29:26.536 [http-nio-8080-exec-9] DEBUG c.s.w.t.mapping.PageBuilderImpl - No Region metadata defined for Page Template 'tcm:45-2189-128'.
08:29:26.536 [http-nio-8080-exec-9] DEBUG c.s.w.t.mapping.EntityBuilderImpl - Creating entity for component: tcm:45-2266
08:29:26.536 [http-nio-8080-exec-9] DEBUG c.s.w.t.mapping.EntityBuilderImpl - Creating entity for component: tcm:45-2266
08:29:26.536 [http-nio-8080-exec-9] DEBUG c.s.w.t.SemanticFieldDataProviderImpl - No DD4T field found for: SemanticField{name='headline', path='/ItemList/headline', multiValue=false, embeddedFields={}}
08:29:26.557 [http-nio-8080-exec-9] DEBUG c.s.w.t.SemanticFieldDataProviderImpl - No DD4T field found for: SemanticField{name='alternateText', path='/ItemList/itemListElement/link/alternateText', multiValue=false, embeddedFields={}}
08:29:26.591 [http-nio-8080-exec-9] DEBUG c.s.w.t.mapping.EntityBuilderImpl - Creating entity for component: tcm:45-2264
08:29:26.591 [http-nio-8080-exec-9] DEBUG c.s.w.t.SemanticFieldDataProviderImpl - No metadata found for SemanticFieldDataProviderImpl.ComponentEntity(component=org.dd4t.contentmodel.impl.ComponentImpl@5a7d61d4, fieldDataProvider=com.sdl.webapp.tridion.SemanticFieldDataProviderImpl@32c6832b) - no DD4T field found for: SemanticField{name='altText', path='/Metadata/altText', multiValue=false, embeddedFields={}}
08:29:26.599 [http-nio-8080-exec-9] DEBUG c.s.w.t.SemanticFieldDataProviderImpl - No DD4T field found for: SemanticField{name='alternateText', path='/ItemList/itemListElement/link/alternateText', multiValue=false, embeddedFields={}}
08:29:26.608 [http-nio-8080-exec-9] DEBUG c.s.w.t.mapping.EntityBuilderImpl - Creating entity for component: tcm:45-2246
08:29:26.608 [http-nio-8080-exec-9] DEBUG c.s.w.t.SemanticFieldDataProviderImpl - No metadata found for SemanticFieldDataProviderImpl.ComponentEntity(component=org.dd4t.contentmodel.impl.ComponentImpl@70802466, fieldDataProvider=com.sdl.webapp.tridion.SemanticFieldDataProviderImpl@3e0a757a) - no DD4T field found for: SemanticField{name='altText', path='/Metadata/altText', multiValue=false, embeddedFields={}}
08:29:26.617 [http-nio-8080-exec-9] DEBUG c.s.w.t.SemanticFieldDataProviderImpl - No DD4T field found for: SemanticField{name='alternateText', path='/ItemList/itemListElement/link/alternateText', multiValue=false, embeddedFields={}}
08:29:26.623 [http-nio-8080-exec-9] DEBUG c.s.w.t.mapping.EntityBuilderImpl - Creating entity for component: tcm:45-2249
08:29:26.623 [http-nio-8080-exec-9] DEBUG c.s.w.t.SemanticFieldDataProviderImpl - No metadata found for SemanticFieldDataProviderImpl.ComponentEntity(component=org.dd4t.contentmodel.impl.ComponentImpl@17d81fd1, fieldDataProvider=com.sdl.webapp.tridion.SemanticFieldDataProviderImpl@33ba5268) - no DD4T field found for: SemanticField{name='altText', path='/Metadata/altText', multiValue=false, embeddedFields={}}

Found header.html.

08:29:26.658 [http-nio-8080-exec-9] DEBUG c.s.w.t.m.AbstractDefaultProvider - Try to find page: [45] /system/include/header.html
08:29:26.658 [http-nio-8080-exec-9] DEBUG c.s.w.t.mapping.ModelBuilderPipeline - Invoking class com.sdl.webapp.tridion.mapping.PageBuilderImpl on header
08:29:26.658 [http-nio-8080-exec-9] DEBUG c.s.w.t.mapping.PageBuilderImpl - No Region metadata defined for Page Template 'tcm:45-2092-128'.
08:29:26.659 [http-nio-8080-exec-9] DEBUG c.s.w.t.mapping.EntityBuilderImpl - Creating entity for component: tcm:45-2283
08:29:26.659 [http-nio-8080-exec-9] DEBUG c.s.w.t.mapping.EntityBuilderImpl - Creating entity for component: tcm:45-2283
08:29:26.680 [http-nio-8080-exec-9] DEBUG c.s.w.t.SemanticFieldDataProviderImpl - No DD4T field found for: SemanticField{name='linkText', path='/Teaser/link/linkText', multiValue=false, embeddedFields={}}
08:29:26.680 [http-nio-8080-exec-9] DEBUG c.s.w.t.SemanticFieldDataProviderImpl - No DD4T field found for: SemanticField{name='headline', path='/Teaser/headline', multiValue=false, embeddedFields={}}
08:29:26.718 [http-nio-8080-exec-9] DEBUG c.s.w.t.mapping.EntityBuilderImpl - Creating entity for component: tcm:45-2261
08:29:26.718 [http-nio-8080-exec-9] DEBUG c.s.w.t.SemanticFieldDataProviderImpl - No metadata found for SemanticFieldDataProviderImpl.ComponentEntity(component=org.dd4t.contentmodel.impl.ComponentImpl@53eef6ab, fieldDataProvider=com.sdl.webapp.tridion.SemanticFieldDataProviderImpl@43817b8a) - no DD4T field found for: SemanticField{name='altText', path='/Metadata/altText', multiValue=false, embeddedFields={}}
08:29:26.718 [http-nio-8080-exec-9] DEBUG c.s.w.t.SemanticFieldDataProviderImpl - No DD4T field found for: SemanticField{name='content', path='/Teaser/content', multiValue=false, embeddedFields={}}

index.html error.

08:29:26.985 [http-nio-8080-exec-9] DEBUG c.s.w.t.DefaultConditionalEntityEvaluator - Entering DefaultConditionalEntityEvaluator.IncludeEntity - returning true by default until real implementation
08:29:26.985 [http-nio-8080-exec-9] DEBUG c.s.w.t.mapping.ModelBuilderPipeline - Invoking class com.sdl.dxa.modules.smarttarget.mapping.SmartTargetPageBuilder on footer
08:29:26.986 [http-nio-8080-exec-9] DEBUG c.s.w.t.mapping.ModelBuilderPipeline - Invoking class com.sdl.dxa.modules.smarttarget.mapping.SmartTargetPageBuilder on index
08:29:27.001 [http-nio-8080-exec-9] ERROR c.s.w.c.controller.PageController - Exception while processing request for: /index.html
java.lang.NullPointerException: null
        at java.io.Reader.<init>(Reader.java:78) ~[na:1.8.0_91]
        at java.io.InputStreamReader.<init>(InputStreamReader.java:113) ~[na:1.8.0_91]
        at com.sdl.odata.client.caller.BasicEndpointCaller.getResponse(BasicEndpointCaller.java:210) ~[odata_client-2.0.5-1002.jar:2.0.5-1002]
        at com.sdl.odata.client.caller.BasicEndpointCaller.callEndpoint(BasicEndpointCaller.java:86) ~[odata_client-2.0.5-1002.jar:2.0.5-1002]
        at com.sdl.odata.client.DefaultODataClient.getODataResponse(DefaultODataClient.java:141) ~[odata_client-2.0.5-1002.jar:2.0.5-1002]
        at com.sdl.odata.client.DefaultODataClient.getEntity(DefaultODataClient.java:69) ~[odata_client-2.0.5-1002.jar:2.0.5-1002]
        at com.sdl.context.odata.client.ODataContextEngineProxy.resolve(ODataContextEngineProxy.java:104) ~[cwd_odata_client-8.1.1-1012.jar:8.1.1-1012]
        at com.sdl.context.odata.client.api.ODataContextEngine.resolve(ODataContextEngine.java:44) ~[cwd_odata_client-8.1.1-1012.jar:8.1.1-1012]
        at com.sdl.webapp.tridion.contextengine.ContextServiceClaimsProvider.getContextClaims(ContextServiceClaimsProvider.java:87) ~[dxa-web8-provider-1.4.0.jar:1.4.0]
        at com.sdl.webapp.common.impl.contextengine.ContextEngineImpl.getClaims(ContextEngineImpl.java:41) ~[dxa-common-impl-1.4.0.jar:1.4.0]
        at com.sdl.webapp.common.impl.WebRequestContextImpl.getDisplayWidth(WebRequestContextImpl.java:128) ~[dxa-common-impl-1.4.0.jar:1.4.0]
        at com.sdl.webapp.common.impl.WebRequestContextImpl$$FastClassByCGLIB$$2bfec188.invoke(<generated>) ~[cglib-2.2.2.jar:1.4.0]

main.css error.

08:29:27.142 [http-nio-8080-exec-6] ERROR c.s.w.c.controller.PageController - Exception while processing request for: /system/v1.4/assets/css/main.css
java.lang.NullPointerException: null
        at com.tridion.dynamiccontent.publication.PublicationMapping.<init>(PublicationMapping.java:38) ~[content-compatible-8.1.1-1008.jar:8.1.1-1008]
        at com.tridion.dynamiccontent.DynamicMappingsRetriever.getPublicationMapping(DynamicMappingsRetriever.java:28) ~[content-compatible-8.1.1-1008.jar:8.1.1-1008]
        at com.sdl.webapp.tridion.TridionLocalizationResolver.getPublicationMappingData(TridionLocalizationResolver.java:23) ~[dxa-web8-provider-1.4.0.jar:1.4.0]
        at com.sdl.webapp.tridion.AbstractTridionLocalizationResolver.getLocalization(AbstractTridionLocalizationResolver.java:61) ~[dxa-tridion-provider-1.4.0.jar:1.4.0]
        at com.sdl.webapp.common.impl.interceptor.LocalizationResolverInterceptor.preHandle(LocalizationResolverInterceptor.java:78) ~[dxa-common-impl-1.4.0.jar:1.4.0]

Regards,

1
  • why deploy a new war, you can serve both from the same war which reduces the amount of total memory used and only one app to maintain? Jul 1, 2016 at 12:52

2 Answers 2

2

There are Known Issues with running the DXA Web Application as a non-root Web Application.

But, as Bart mentioned, it seems you can just as well run the DXA Web App as root Web App and let it handle jp and possibly other URLs for other Publications; DXA can handle multiple Publications with one Web App.

The trick is to use appropriate mappings in Topology Manager: the mapping you use for your /jp site should have RelativeUrl="/jp".

2
  • I removed DXA and installed it again, beacuse my environment was too messy. Also, I moved DXA directory "dxa-example-webapp" to docBase of Tomcat.According to debug log, DXA seems to find a page by URL, but NullPointerException occurs. I edited my question. Jul 5, 2016 at 12:35
  • This is an entirely different problem. It would be better to mark the original Question as solved and create a new Question. Jul 5, 2016 at 17:07
1

Regarding the second (updated) Question/problem: this is a symptom of a problem with the Context Service. There is a Known Issue with the CIL that errors occurring in the Context Service are not handled properly and result in a NullPointerException (I believe a CIL hotfix is available for the bad error handling).

Did you install the Context Service and register it as a Capability in the Discovery Service? Did you also create the device repository? Do you see errors in the Context Service logs?

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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