FSU040THUL-1368 ClassCastException when user is signed in via shibboleth
java.io.IOException: javax.xml.transform.TransformerException: java.lang.ClassCastException: class org.mycore.user2.login.MCRShibbolethUserInformation cannot be cast to class org.mycore.user2.MCRUser (org.mycore.user2.login.MCRShibbolethUserInformation and org.mycore.user2.MCRUser are in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @3a12c404)
at org.mycore.common.content.transformer.MCRXSLTransformer.transform(MCRXSLTransformer.java:243)
at org.mycore.common.xml.MCRLayoutService.transform(MCRLayoutService.java:201)
at org.mycore.common.xml.MCRLayoutService.doLayout(MCRLayoutService.java:94)
at org.mycore.solr.proxy.MCRSolrProxyServlet.handleQuery(MCRSolrProxyServlet.java:269)
at org.mycore.solr.proxy.MCRSolrProxyServlet.doGetPost(MCRSolrProxyServlet.java:164)
at org.mycore.frontend.servlets.MCRServlet.doGet(MCRServlet.java:184)
at org.mycore.frontend.servlets.MCRServlet.render(MCRServlet.java:502)
at org.mycore.frontend.servlets.MCRServlet.processRenderingPhase(MCRServlet.java:467)
at org.mycore.frontend.servlets.MCRServlet.doGetPost(MCRServlet.java:318)
at org.mycore.frontend.servlets.MCRServlet.doGet(MCRServlet.java:156)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:564)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:205)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
at org.mycore.frontend.filter.MCRUserAgentFilter.doFilter(MCRUserAgentFilter.java:87)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
at org.mycore.common.xml.MCRURIResolverFilter.doFilter(MCRURIResolverFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
at org.mycore.frontend.filter.MCRWebAppBaseFilter.doFilter(MCRWebAppBaseFilter.java:41)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
at org.mycore.frontend.filter.MCRRequestAuthenticationFilter.doFilter(MCRRequestAuthenticationFilter.java:57)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
at org.mycore.frontend.filter.MCRRequestDebugFilter.doFilter(MCRRequestDebugFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:673)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:341)
at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:429)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:894)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1740)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: javax.xml.transform.TransformerException: java.lang.ClassCastException: class org.mycore.user2.login.MCRShibbolethUserInformation cannot be cast to class org.mycore.user2.MCRUser (org.mycore.user2.login.MCRShibbolethUserInformation and org.mycore.user2.MCRUser are in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @3a12c404)
at org.apache.xalan.extensions.ExtensionHandlerJavaClass.callFunction(ExtensionHandlerJavaClass.java:417)
at org.apache.xalan.extensions.ExtensionHandlerJavaClass.callFunction(ExtensionHandlerJavaClass.java:440)
at org.apache.xalan.extensions.ExtensionsTable.extFunction(ExtensionsTable.java:222)
at org.apache.xalan.transformer.TransformerImpl.extFunction(TransformerImpl.java:475)
at org.apache.xpath.functions.FuncExtFunction.execute(FuncExtFunction.java:208)
at org.apache.xpath.Expression.bool(Expression.java:186)
at org.apache.xpath.XPath.bool(XPath.java:412)
at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:126)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:141)
at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402)
at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2272)
at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1358)
at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3449)
at org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:408)
at org.apache.xml.serializer.ToXMLSAXHandler.endDocument(ToXMLSAXHandler.java:183)
at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1369)
at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3449)
at org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:408)
at org.apache.xml.serializer.ToXMLSAXHandler.endDocument(ToXMLSAXHandler.java:183)
at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1369)
at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3449)
at org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:408)
at org.apache.xml.serializer.ToXMLSAXHandler.endDocument(ToXMLSAXHandler.java:183)
at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1369)
at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3449)
at org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:408)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDocument(AbstractSAXParser.java:754)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:547)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:889)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:825)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1224)
at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:637)
at org.mycore.common.content.transformer.MCRXSLTransformer.transform(MCRXSLTransformer.java:235)
... 51 more
Caused by: java.lang.ClassCastException: class org.mycore.user2.login.MCRShibbolethUserInformation cannot be cast to class org.mycore.user2.MCRUser (org.mycore.user2.login.MCRShibbolethUserInformation and org.mycore.user2.MCRUser are in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @3a12c404)
at de.thulb.uni_jena.refodat.access.strategies.AccessStrategy.checkRealmPermission(AccessStrategy.java:496)
at de.thulb.uni_jena.refodat.access.strategies.AccessStrategy.checkObjectPermissionTransitional(AccessStrategy.java:613)
at de.thulb.uni_jena.refodat.access.strategies.AccessStrategy.checkObjectPermission(AccessStrategy.java:283)
at de.thulb.uni_jena.refodat.access.strategies.AccessStrategy.checkPermission(AccessStrategy.java:299)
at org.mycore.access.MCRAccessManager.checkPermission(MCRAccessManager.java:277)
at jdk.internal.reflect.GeneratedMethodAccessor212.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.apache.xalan.extensions.ExtensionHandlerJavaClass.callFunction(ExtensionHandlerJavaClass.java:367)
... 107 more
Edited by Silvio Hermann