3

I'm using following versions.

  • SDL Web 8
  • DXA 1.4

I set up following services. PageContentFilter and BinaryContentFilter are disabled in web.xml, so Preview service is not used.

  • Discovery
  • Content
  • Context
  • Deployer

Error occurs when requesting DXA page (/index.html), probably Context Service causes the error.

I download Context Engine's repository (I contacted SDL support to add my server's IP to white list), and put it into Context and Content Services.

Context Service's URL is http://10.0.1.98:8087/context.svc. When requesting the URL by wget command, Context Service output debug log, so it's running surely.

But requesting DXA page (/index.html) URL, Context Service does not output any debug log, so I guess Context Service is not called.

There is no error log in Context Service itself, Discovery and Content Service.

My questions are following.

  • There is a step "Installing the Context Service client", in SDL Web 8's manual. Is the step required on DXA 1.4?
  • My Discovery service's Role setting of Context Service correct?
  • Is there any possible configuration failure?
  • Is it possible to disable using Context Service on DXA?

Error log on dxa.log

06:17:45.958 [http-nio-8080-exec-1] DEBUG c.s.w.t.mapping.ModelBuilderPipeline - Invoking class com.sdl.dxa.modules.smarttarget.mapping.SmartTargetPageBuilder on footer
06:17:45.958 [http-nio-8080-exec-1] DEBUG c.s.w.t.mapping.ModelBuilderPipeline - Invoking class com.sdl.dxa.modules.smarttarget.mapping.SmartTargetPageBuilder on index
06:17:46.066 [http-nio-8080-exec-1] 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-1014.jar:8.1.1-1014]
        at com.sdl.context.odata.client.api.ODataContextEngine.resolve(ODataContextEngine.java:44) ~[cwd_odata_client-8.1.1-1014.jar:8.1.1-1014]
        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]
        at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[cglib-2.2.2.jar:na]
        at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689) ~[spring-aop-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) ~[spring-aop-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) ~[spring-aop-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) ~[spring-aop-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[spring-aop-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622) ~[spring-aop-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at com.sdl.webapp.common.impl.WebRequestContextImpl$$EnhancerByCGLIB$$726d2d34.getDisplayWidth(<generated>) ~[cglib-2.2.2.jar:1.4.0]
        at com.sdl.webapp.common.impl.DefaultMediaHelper.getScreenWidth(DefaultMediaHelper.java:158) ~[dxa-common-impl-1.4.0.jar:1.4.0]
        at com.sdl.webapp.common.controller.PageController.handleGetPage(PageController.java:149) ~[dxa-common-api-1.4.0.jar:1.4.0]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_91]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_91]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_91]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_91]
        at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219) ~[spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) ~[spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:100) ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:604) ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:565) ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923) ~[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]

DXA outputs following log. DXA seems to succeed to find page.

06:17:45.507 [http-nio-8080-exec-1] DEBUG c.s.w.t.m.AbstractDefaultProvider - Try to find page: [51] /index.html
06:17:45.507 [http-nio-8080-exec-1] DEBUG c.s.w.t.mapping.ModelBuilderPipeline - Invoking class com.sdl.webapp.tridion.mapping.PageBuilderImpl on index
06:17:45.507 [http-nio-8080-exec-1] DEBUG c.s.w.t.mapping.PageBuilderImpl - No Region metadata defined for Page Template 'tcm:51-2476-128'.
06:17:45.507 [http-nio-8080-exec-1] DEBUG c.s.w.t.mapping.EntityBuilderImpl - Creating entity for component: tcm:51-2554
06:17:45.507 [http-nio-8080-exec-1] DEBUG c.s.w.t.mapping.EntityBuilderImpl - Creating entity for component: tcm:51-2554

Discovery Service's cd_storage_conf.xml, ConfigRepository.

    <ConfigRepository ServiceUri="http://10.0.1.98:8082/discovery.svc"
                      ConnectionTimeout="10000"
                      CacheEnabled="true"
                      CacheExpirationDuration="600"
                      ServiceMonitorPollDuration="10"
                      ClientId="user"
                      ClientSecret="password"
                      TokenServiceUrl="http://10.0.1.98:8082/token.svc">
        <Roles>
            <Role Name="ContextServiceCapability" Url="http://10.0.1.98:8087/context.svc">
            </Role>
            <Role Name="TokenServiceCapability" Url="http://10.0.1.98:8082/token.svc">
            </Role>
            <Role Name="DeployerCapability" Url="http://10.0.1.98:8084/httpupload">
                <Property Name="undo.enabled" Value="false"/>
                <Property Name="encoding" Value="UTF-8"/>
            </Role>
           <Role Name="ContentServiceCapability" Url="http://10.0.1.98:8081/content.svc">
           </Role>
        </Roles>
</ConfigRepository>

Context Service's debug log, after doing wget command.

wget http://10.0.1.98:8087/context.svc


2016-07-11 06:20:24,342 DEBUG AmbientDataContext - Setting current ambient data context: com.tridion.ambientdata.web.WebContext
2016-07-11 06:20:24,353 DEBUG AbstractAmbientDataServletFilter - doFilter: contextPath=, sessionId=E06DE719BBA6AB06535CEE210C929DB7
2016-07-11 06:20:24,353 DEBUG AbstractAmbientDataServletFilter - Creating new ClaimStore for session: E06DE719BBA6AB06535CEE210C929DB7
2016-07-11 06:20:24,355 DEBUG DefaultClaimStore - put: uri=taf:response:cookie:generation, value=true
2016-07-11 06:20:24,355 DEBUG WebContext - setCurrentClaimStore: com.tridion.ambientdata.claimstore.JavaClaimStore@2f993212, thread: http-nio-8087-exec-4
2016-07-11 06:20:24,356 DEBUG DefaultClaimStore - put: uri=taf:request:uri, value=/context.svc
2016-07-11 06:20:24,356 DEBUG DefaultClaimStore - put: uri=taf:request:full_url, value=http://10.0.1.98:8087/context.svc
2016-07-11 06:20:24,356 DEBUG DefaultClaimStore - put: uri=taf:request:headers, value={host=[Ljava.lang.String;@777bf66e, connection=[Ljava.lang.String;@11144331, user-agent=[Ljava.lang.String;@19f35e91, accept=[Ljava.lang.String;@27a5ca68}
2016-07-11 06:20:24,357 DEBUG DefaultClaimStore - put: uri=taf:request:parameters, value={CONTENT_LENGTH=[Ljava.lang.String;@f458074, QUERY_STRING=[Ljava.lang.String;@3c7b4766, CONTENT_TYPE=[Ljava.lang.String;@3f7f91ae, PATH_INFO=[Ljava.lang.String;@3680eaa3}
2016-07-11 06:20:24,360 DEBUG DefaultClaimStore - put: uri=taf:server:variables, value={SERVER_PORT=8087, REMOTE_HOST=10.0.1.98, SERVER_PROTOCOL=HTTP/1.1, DOCUMENT_ROOT=/tmp/tomcat-docbase.4224221675179414380.8087/, REQUEST_METHOD=GET, SCRIPT_NAME=/context.svc, REMOTE_ADDR=10.0.1.98, SECURE=false, PATH_TRANSLATED=null, SERVER_NAME=10.0.1.98, AUTH_TYPE=null, REMOTE_USER=null}
2016-07-11 06:20:24,360 DEBUG DefaultClaimStore - put: uri=taf:request:cookies, value={}
2016-07-11 06:20:24,360 INFO  AbstractAmbientDataServletFilter - Requested by IP: /10.0.1.98
2016-07-11 06:20:24,368 DEBUG DefaultClaimStore - put: uri=taf:session:id, value=tridion_525bb4db-4c19-4e01-858d-1a54010a930f
2016-07-11 06:20:24,368 DEBUG DefaultClaimStore - put: uri=taf:tracking:id, value=tridion_a0740565-ce63-496e-8e54-421dd30fa519
2016-07-11 06:20:24,368 DEBUG DefaultClaimStore - put: uri=taf:session:attributes, value={}
2016-07-11 06:20:24,368 DEBUG AbstractAmbientDataServletFilter - Validating request.
2016-07-11 06:20:24,368 DEBUG AbstractAmbientDataServletFilter - Unauthorized request. No access token found.
2016-07-11 06:20:24,371 DEBUG WebContext - setCurrentClaimStore: null, thread: http-nio-8087-exec-4
2016-07-11 06:20:28,032 DEBUG AmbientDataContext - Setting current ambient data context: com.tridion.ambientdata.web.WebContext
2016-07-11 06:20:28,033 DEBUG AbstractAmbientDataServletFilter - doFilter: contextPath=, sessionId=8EBA713D2D1906FE4B9F0D42E052539D
2016-07-11 06:20:28,033 DEBUG AbstractAmbientDataServletFilter - Creating new ClaimStore for session: 8EBA713D2D1906FE4B9F0D42E052539D
2016-07-11 06:20:28,033 DEBUG DefaultClaimStore - put: uri=taf:response:cookie:generation, value=true
2016-07-11 06:20:28,033 DEBUG WebContext - setCurrentClaimStore: com.tridion.ambientdata.claimstore.JavaClaimStore@1e0fbb7, thread: http-nio-8087-exec-6
2016-07-11 06:20:28,033 DEBUG DefaultClaimStore - put: uri=taf:request:uri, value=/context.svc
2016-07-11 06:20:28,033 DEBUG DefaultClaimStore - put: uri=taf:request:full_url, value=http://10.0.1.98:8087/context.svc
2016-07-11 06:20:28,034 DEBUG DefaultClaimStore - put: uri=taf:request:headers, value={host=[Ljava.lang.String;@f2705fb, connection=[Ljava.lang.String;@b1890c7, user-agent=[Ljava.lang.String;@4e1a0fc0, accept=[Ljava.lang.String;@482168f7}
2016-07-11 06:20:28,034 DEBUG DefaultClaimStore - put: uri=taf:request:parameters, value={CONTENT_LENGTH=[Ljava.lang.String;@7f9ea4d5, QUERY_STRING=[Ljava.lang.String;@304f9d49, CONTENT_TYPE=[Ljava.lang.String;@2e35f08f, PATH_INFO=[Ljava.lang.String;@6d90436e}
2016-07-11 06:20:28,034 DEBUG DefaultClaimStore - put: uri=taf:server:variables, value={SERVER_PORT=8087, REMOTE_HOST=10.0.1.98, SERVER_PROTOCOL=HTTP/1.1, DOCUMENT_ROOT=/tmp/tomcat-docbase.4224221675179414380.8087/, REQUEST_METHOD=GET, SCRIPT_NAME=/context.svc, REMOTE_ADDR=10.0.1.98, SECURE=false, PATH_TRANSLATED=null, SERVER_NAME=10.0.1.98, AUTH_TYPE=null, REMOTE_USER=null}
2016-07-11 06:20:28,034 DEBUG DefaultClaimStore - put: uri=taf:request:cookies, value={}
2016-07-11 06:20:28,034 INFO  AbstractAmbientDataServletFilter - Requested by IP: /10.0.1.98
2016-07-11 06:20:28,034 DEBUG DefaultClaimStore - put: uri=taf:session:id, value=tridion_1ce66127-5b09-4496-bc16-25a32e393221
2016-07-11 06:20:28,034 DEBUG DefaultClaimStore - put: uri=taf:tracking:id, value=tridion_608407ae-4826-4dc8-8a8c-430fe8ccebb5
2016-07-11 06:20:28,034 DEBUG DefaultClaimStore - put: uri=taf:session:attributes, value={}
2016-07-11 06:20:28,035 DEBUG AbstractAmbientDataServletFilter - Validating request.
2016-07-11 06:20:28,035 DEBUG AbstractAmbientDataServletFilter - Unauthorized request. No access token found.
2016-07-11 06:20:28,035 DEBUG WebContext - setCurrentClaimStore: null, thread: http-nio-8087-exec-6
  • I noticed a more recent question from you about changing XPM CM URL. Does that mean that you managed to solve this problem? If so, can you let us know how you solved it? – Rick Pannekoek Jul 12 '16 at 20:23
  • No, I haven't solved the problem yet. I just installed DXA 1.2 instead. – Hirokazu Shikata Jul 13 '16 at 8:41
  • DXA 1.4 finally worked by changing JVM_OPTIONS in start.sh of SDL Web 8's microservices. Detail is in this post. tridion.stackexchange.com/questions/15244/… – Hirokazu Shikata Aug 4 '16 at 8:41
4

There is a step "Installing the Context Service client", in SDL Web 8's manual. Is the step required on DXA 1.4?

No, the context client is part of the DXA framework and doesn't have to be installed separately.

My Discovery service's Role setting of Context Service correct?

Looks OK to me.

Is there any possible configuration failure?

Always. :-) What springs to my mind: Discovery Service URL and OAuth credentials have to be configured in cwd_client_conf.xml (as well as in cd_client_conf.xml).

Is it possible to disable using Context Service on DXA?

Yes, you can use the ADF Context Claims Provider, which expects the Context Claims to be in the ADF (this requires the use of the Context Engine cartridge in your Content Service. This is known to perform worse than direct access to Context Service, but it's worth a try if you're encountering problems with Context Service access). See http://docs.sdl.com/LiveContent/content/en-US/SDL%20DXA-v4/GUID-9127A28E-5DF8-45C9-B64D-2EC2C5280195

BTW: DXA 1.5 has recently been released. This uses CIL 8.2, which incorporates earlier CIL 8.1.1 hotfixes. Makes sense to try if that gives you better error handling.

2

DXA 1.4 worked by changing JVM_OPTIONS in start.sh of SDL Web 8's microservices.

JVM_OPTIONS="-Xrs -Xms256m -Xmx512m -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true -Dorg.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH=true"

I got this from following post.

Web 8 DXA 1.5 Java web site failing with "Unable to get response from OData service"

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.