Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE when display tag is before container tag #711

Closed
StephanSchrader opened this issue Feb 5, 2021 · 1 comment
Closed

NPE when display tag is before container tag #711

StephanSchrader opened this issue Feb 5, 2021 · 1 comment

Comments

@StephanSchrader
Copy link

StephanSchrader commented Feb 5, 2021

Hi all,

we are facing a problem when a cms:display tag comes before a cms:container tag. In that case, a NullPointerException pops up.

This problem occurs in Offline project only.

Steps to reproduce:

  1. Run docker image as described in https://hub.docker.com/r/alkacon/opencms-docker
  2. Login to workplace: http://localhost/workplace
  3. Install attached module de.mnbn.opencms.displaybug_0.1.zip
  4. Open page: http://localhost/displaybug; an error appears
  5. Open page: http://localhost/displaybug?bug=off; no error appears
  6. Switch to Project "Online"
  7. Open page: http://localhost/displaybug; no error appears

Do you have any ideas how solve this problem?

05 Feb 2021 11:14:24,761 ERROR [  org.opencms.main.OpenCmsCore:2507] javax.servlet.jsp.JspException: java.lang.NullPointerException rendering URL http://localhost/opencms/displaybug
javax.servlet.ServletException: javax.servlet.jsp.JspException: java.lang.NullPointerException
	at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:663) ~[jasper.jar:9.0.37]
	at org.apache.jsp.WEB_002dINF.jsp.offline.system.modules.de_mnbn_opencms_displaybug.templates.main_jsp._jspService(main_jsp.java:220) ~[?:?]
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:71) ~[jasper.jar:9.0.37]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) ~[servlet-api.jar:4.0.FR]
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:477) ~[jasper.jar:9.0.37]
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385) ~[jasper.jar:9.0.37]
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329) ~[jasper.jar:9.0.37]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) ~[servlet-api.jar:4.0.FR]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[catalina.jar:9.0.37]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:9.0.37]
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712) ~[catalina.jar:9.0.37]
	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:580) ~[catalina.jar:9.0.37]
	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:516) ~[catalina.jar:9.0.37]
	at org.opencms.flex.CmsFlexRequestDispatcher.includeExternal(CmsFlexRequestDispatcher.java:191) ~[opencms.jar:11.0.1]
	at org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatcher.java:165) ~[opencms.jar:11.0.1]
	at org.opencms.loader.CmsJspLoader.service(CmsJspLoader.java:654) ~[opencms.jar:11.0.1]
	at org.opencms.flex.CmsFlexRequestDispatcher.includeInternalWithCache(CmsFlexRequestDispatcher.java:443) ~[opencms.jar:11.0.1]
	at org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatcher.java:169) ~[opencms.jar:11.0.1]
	at org.opencms.loader.CmsJspLoader.dispatchJsp(CmsJspLoader.java:982) ~[opencms.jar:11.0.1]
	at org.opencms.loader.CmsJspLoader.load(CmsJspLoader.java:533) ~[opencms.jar:11.0.1]
	at org.opencms.loader.CmsXmlContainerPageLoader.load(CmsXmlContainerPageLoader.java:108) ~[opencms.jar:11.0.1]
	at org.opencms.loader.CmsResourceManager.loadResource(CmsResourceManager.java:1194) ~[opencms.jar:11.0.1]
	at org.opencms.main.OpenCmsCore.showResource(OpenCmsCore.java:2038) [opencms.jar:11.0.1]
	at org.opencms.main.OpenCmsServlet.doGet(OpenCmsServlet.java:161) [opencms.jar:11.0.1]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:626) [servlet-api.jar:4.0.FR]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) [servlet-api.jar:4.0.FR]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [catalina.jar:9.0.37]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.37]
	at org.opencms.jsp.jsonpart.CmsJsonPartFilter.doFilter(CmsJsonPartFilter.java:298) [opencms.jar:11.0.1]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.37]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.37]
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712) [catalina.jar:9.0.37]
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459) [catalina.jar:9.0.37]
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:384) [catalina.jar:9.0.37]
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312) [catalina.jar:9.0.37]
	at org.opencms.main.OpenCmsUrlServletFilter.doFilter(OpenCmsUrlServletFilter.java:127) [opencms.jar:11.0.1]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.37]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.37]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) [catalina.jar:9.0.37]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [catalina.jar:9.0.37]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) [catalina.jar:9.0.37]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [catalina.jar:9.0.37]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [catalina.jar:9.0.37]
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690) [catalina.jar:9.0.37]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [catalina.jar:9.0.37]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [catalina.jar:9.0.37]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373) [tomcat-coyote.jar:9.0.37]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-coyote.jar:9.0.37]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) [tomcat-coyote.jar:9.0.37]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1589) [tomcat-coyote.jar:9.0.37]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:9.0.37]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:9.0.37]
	at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.NullPointerException
	at org.opencms.flex.CmsFlexRequest.setAttribute(CmsFlexRequest.java:713) ~[opencms.jar:11.0.1]
	at org.opencms.xml.containerpage.CmsXmlContainerPageFactory.unmarshal(CmsXmlContainerPageFactory.java:355) ~[opencms.jar:11.0.1]
	at org.opencms.jsp.util.CmsJspStandardContextBean.getPage(CmsJspStandardContextBean.java:2216) ~[opencms.jar:11.0.1]
	at org.opencms.jsp.util.CmsJspStandardContextBean.initPage(CmsJspStandardContextBean.java:1840) ~[opencms.jar:11.0.1]
	at org.opencms.jsp.CmsJspTagContainer.doEndTag(CmsJspTagContainer.java:471) ~[opencms.jar:11.0.1]
	at org.apache.jsp.WEB_002dINF.jsp.offline.system.modules.de_mnbn_opencms_displaybug.templates.main_jsp._jspx_meth_cms_005fcontainer_005f0(main_jsp.java:497) ~[?:?]
	at org.apache.jsp.WEB_002dINF.jsp.offline.system.modules.de_mnbn_opencms_displaybug.templates.main_jsp._jspService(main_jsp.java:196) ~[?:?]
	... 53 more
gWestenberger added a commit that referenced this issue Sep 21, 2021
…tag caused an NPE in the Offline project (github issue #711).
@gWestenberger
Copy link
Contributor

Fixed in master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants