I'm running into a similar error this in 5.3.2. Given the line number, it 
would appear that Document is null.

51: final Document document = 
saml10ObjectBuilder.constructDocumentFromXml(requestBody); 
52: final Element root = document.getRootElement();

When looking in the constructDocumentFromXml, I find the cause:  Way to go 
with the catch(Exception e) { return null; }.

/**
* Construct document from xml string.
*
* @param xmlString the xml string
* @return the document
*/
public static Document constructDocumentFromXml(final String xmlString) {
try {
final SAXBuilder builder = new SAXBuilder();
builder.setFeature("http://xml.org/sax/features/external-general-entities";, 
false);
builder.setFeature("http://apache.org/xml/features/disallow-doctype-decl";, 
true);
return builder.build(new ByteArrayInputStream(xmlString.getBytes(Charset.
defaultCharset())));
} catch (final Exception e) {
return null;
}
}
2018-08-06 18:00:25,637 ERROR 
[org.apereo.cas.security.ResponseHeadersEnforcementFilter] - 
<RegisteredServiceResponseHeadersEnforcementFilter is blocking this 
request. Examine the cause in this stack trace to understand why.>
javax.servlet.ServletException: 
RegisteredServiceResponseHeadersEnforcementFilter is blocking this request. 
Examine the cause in this stack trace to understand why.
at 
org.apereo.cas.security.ResponseHeadersEnforcementFilter.doFilter(ResponseHeadersEnforcementFilter.java:233)
 
~[cas-server-security-filter-2.0.10.2.jar!/:2.0.10.2]
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.apereo.cas.security.AddResponseHeadersFilter.doFilter(AddResponseHeadersFilter.java:94)
 
~[cas-server-security-filter-2.0.10.2.jar!/:2.0.10.2]
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:111)
 
~[spring-boot-actuator-1.5.14.RELEASE.jar!/:1.5.14.RELEASE]
at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
 
~[spring-web-4.3.18.RELEASE.jar!/:4.3.18.RELEASE]
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
 
~[spring-web-4.3.18.RELEASE.jar!/:4.3.18.RELEASE]
at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
 
~[spring-web-4.3.18.RELEASE.jar!/:4.3.18.RELEASE]
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109)
 
~[spring-web-4.3.18.RELEASE.jar!/:4.3.18.RELEASE]
at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
 
~[spring-web-4.3.18.RELEASE.jar!/:4.3.18.RELEASE]
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
 
~[spring-web-4.3.18.RELEASE.jar!/:4.3.18.RELEASE]
at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
 
~[spring-web-4.3.18.RELEASE.jar!/:4.3.18.RELEASE]
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.apereo.cas.logging.web.ThreadContextMDCServletFilter.doFilter(ThreadContextMDCServletFilter.java:91)
 
~[cas-server-core-logging-5.3.2.jar!/:5.3.2]
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:106)
 
~[spring-boot-actuator-1.5.14.RELEASE.jar!/:1.5.14.RELEASE]
at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
 
~[spring-web-4.3.18.RELEASE.jar!/:4.3.18.RELEASE]
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
 
~[spring-web-4.3.18.RELEASE.jar!/:4.3.18.RELEASE]
at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
 
~[spring-web-4.3.18.RELEASE.jar!/:4.3.18.RELEASE]
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.apereo.inspektr.common.web.ClientInfoThreadLocalFilter.doFilter(ClientInfoThreadLocalFilter.java:66)
 
~[inspektr-common-1.8.3.GA.jar!/:1.8.3.GA]
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:685) 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) 
~[tomcat-catalina-8.5.32.jar!/:8.5.32]
at 
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800) 
~[tomcat-embed-core-8.5.32.jar!/:8.5.32]
at 
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
 
~[tomcat-embed-core-8.5.32.jar!/:8.5.32]
at 
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:800)
 
~[tomcat-embed-core-8.5.32.jar!/:8.5.32]
at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1471)
 
~[tomcat-embed-core-8.5.32.jar!/:8.5.32]
at 
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) 
~[tomcat-embed-core-8.5.32.jar!/:8.5.32]
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
~[?:1.8.0_181]
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
~[?:1.8.0_181]
at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 
~[tomcat-util-8.5.32.jar!/:8.5.32]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
Caused by: java.lang.NullPointerException
at 
org.apereo.cas.support.saml.authentication.principal.SamlServiceFactory.createService(SamlServiceFactory.java:52)
 
~[cas-server-support-saml-5.3.2.jar!/:5.3.2]
at 
org.apereo.cas.support.saml.authentication.principal.SamlServiceFactory.createService(SamlServiceFactory.java:27)
 
~[cas-server-support-saml-5.3.2.jar!/:5.3.2]
at 
org.apereo.cas.web.support.DefaultArgumentExtractor.lambda$extractServiceInternal$0(DefaultArgumentExtractor.java:46)
 
~[cas-server-core-web-api-5.3.2.jar!/:5.3.2]
at 
java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) 
~[?:1.8.0_181]
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1359) 
~[?:1.8.0_181]
at 
java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
 
~[?:1.8.0_181]
at 
java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498) 
~[?:1.8.0_181]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485) 
~[?:1.8.0_181]
at 
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) 
~[?:1.8.0_181]
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152) 
~[?:1.8.0_181]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) 
~[?:1.8.0_181]
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464) 
~[?:1.8.0_181]
at 
org.apereo.cas.web.support.DefaultArgumentExtractor.extractServiceInternal(DefaultArgumentExtractor.java:52)
 
~[cas-server-core-web-api-5.3.2.jar!/:5.3.2]
at 
org.apereo.cas.web.support.AbstractArgumentExtractor.extractService(AbstractArgumentExtractor.java:34)
 
~[cas-server-core-web-api-5.3.2.jar!/:5.3.2]
at 
org.apereo.cas.services.web.support.RegisteredServiceResponseHeadersEnforcementFilter.getRegisteredServiceFromRequest(RegisteredServiceResponseHeadersEnforcementFilter.java:118)
 
~[cas-server-core-web-api-5.3.2.jar!/:5.3.2]
at 
org.apereo.cas.services.web.support.RegisteredServiceResponseHeadersEnforcementFilter.shouldHttpHeaderBeInjectedIntoResponse(RegisteredServiceResponseHeadersEnforcementFilter.java:94)
 
~[cas-server-core-web-api-5.3.2.jar!/:5.3.2]
at 
org.apereo.cas.services.web.support.RegisteredServiceResponseHeadersEnforcementFilter.decideInsertCacheControlHeader(RegisteredServiceResponseHeadersEnforcementFilter.java:74)
 
~[cas-server-core-web-api-5.3.2.jar!/:5.3.2]
at 
org.apereo.cas.security.ResponseHeadersEnforcementFilter.doFilter(ResponseHeadersEnforcementFilter.java:225)
 
~[cas-server-security-filter-2.0.10.2.jar!/:2.0.10.2]
... 53 more

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cas-user+unsubscr...@apereo.org.
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/66ff2fcb-ce09-46e4-a98b-3c162d460b66%40apereo.org.

Reply via email to