1

we are getting 500 Internal Server Error for all pages in website if we set Useragent to null. while rendering the page, DefaultMediaHelper.getScreenWidth() is throwing this error in DXA logs

14:19:57.481 [ajp-nio-9024-exec-500] ERROR c.s.w.c.i.c.ContextEngineImpl - Exception getting claims from provider com.sdl.webapp.tridion.contextengine.ContextServiceClaimsProvider@7c16fcd6
com.sdl.webapp.common.exceptions.DxaException: An error occurred while resolving evidence using the Context Service.
    at com.sdl.webapp.tridion.contextengine.ContextServiceClaimsProvider.getContextClaims(ContextServiceClaimsProvider.java:105)
    at com.sdl.webapp.common.impl.contextengine.ContextEngineImpl.claims(ContextEngineImpl.java:52)
    at com.sdl.webapp.common.impl.contextengine.ContextEngineImpl.getClaims(ContextEngineImpl.java:32)
    at com.sdl.webapp.common.impl.contextengine.ContextEngineImpl.getClaims(ContextEngineImpl.java:42)
    at com.sdl.webapp.common.impl.WebRequestContextImpl.displayWidth(WebRequestContextImpl.java:234)
    at com.sdl.webapp.common.impl.WebRequestContextImpl.getDisplayWidth(WebRequestContextImpl.java:70)
    at com.sdl.webapp.common.impl.WebRequestContextImpl$$FastClassBySpringCGLIB$$2bfec188.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
    at com.sdl.webapp.common.impl.WebRequestContextImpl$$EnhancerBySpringCGLIB$$3bac1b78.getDisplayWidth(<generated>)
    at com.sdl.webapp.common.impl.DefaultMediaHelper.getScreenWidth(DefaultMediaHelper.java:155)
    at com.sdl.webapp.common.controller.PageController.handleGetPage(PageController.java:139)
    at com.sdl.dxa.modules.generic.controller.GenericPageController.handleGetPage(GenericPageController.java:116)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at com.tridion.ambientdata.web.AbstractAmbientDataServletFilter.doFilter(AbstractAmbientDataServletFilter.java:291)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660)
    at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:679)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:322)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
    at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:476)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)
Caused by: com.sdl.context.api.exception.ResolverException: Unable serialize evidence argument
    at com.sdl.context.odata.client.ODataContextEngineProxy.resolve(ODataContextEngineProxy.java:92)
    at com.sdl.context.odata.client.api.ODataContextEngine.resolve(ODataContextEngine.java:46)
    at com.sdl.webapp.tridion.contextengine.ContextServiceClaimsProvider.getContextClaims(ContextServiceClaimsProvider.java:101)
    ... 65 common frames omitted
Caused by: com.sdl.odata.client.api.exception.ODataClientException: Caught exception NullPointerException:null when serialising evidence into json format
    at com.sdl.context.odata.client.ODataContextEngineProxy.getSerializedEvidence(ODataContextEngineProxy.java:215)
    at com.sdl.context.odata.client.ODataContextEngineProxy.resolve(ODataContextEngineProxy.java:90)
    ... 67 common frames omitted
Caused by: java.lang.NullPointerException: null
    at com.sdl.context.odata.serialization.EvidenceSerializer.serialize(EvidenceSerializer.java:23)
    at com.sdl.context.odata.client.ODataContextEngineProxy.getSerializedEvidence(ODataContextEngineProxy.java:213)
    ... 68 common frames omitted

we using DXA 2.0 with tridion 8.5 for our client website.

2
  • Any particular reason for setting it to null in the first place?
    – Atila Sos
    Commented Oct 30, 2019 at 23:03
  • @AtilaSos I believe the requests coming to the website doesn't have the user-agent (bots most likely)
    – ザヘド
    Commented Oct 31, 2019 at 7:19

0

Your Answer

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

Browse other questions tagged or ask your own question.