[opencms-dev] NullPointerException with template on xml custom content
Thierry Collogne
tcollogne at hotmail.com
Wed Jan 11 10:23:05 CET 2006
Hi all,
I have created a custom xml content. I declared an artice.jsp template for
each xml content item.
But now I want to declare a template on top of the article.jsp template.
Before adding the the template on top of to artice.jsp everyting was working
fine, now I always get a nullpointer.
This is the schematic view of the current situation
news_0001.html
news_0002.html
-> article.jsp template
-> general.jsp template
This is the code from the article.jsp
<%@ page session="false" %>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
<cms:include property="template" element="head"/>
<cms:editable/>
<div class="element">
<cms:contentload collector="singleFile" param="${opencms.uri}"
editable="true">
<h2><cms:contentshow element="Title" /></h2>
<cms:contentcheck ifexists="Image">
<img src="<cms:link><cms:contentshow element="Image"/></cms:link>">
</cms:contentcheck>
<p><cms:contentshow element="Text"/></p>
</cms:contentload>
</div>
<cms:include property="template" element="foot"/>
I think it has something to do with the inclusion of the head element.
This is the stacktrace
java.lang.NullPointerException
at
org.opencms.xml.A_CmsXmlDocument.getBookmarkName(A_CmsXmlDocument.java:116)
at org.opencms.xml.A_CmsXmlDocument.getBookmark(A_CmsXmlDocument.java:582)
at
org.opencms.xml.A_CmsXmlDocument.getValueInternal(A_CmsXmlDocument.java:656)
at
org.opencms.xml.A_CmsXmlDocument.getStringValue(A_CmsXmlDocument.java:282)
at
org.opencms.loader.CmsXmlContentLoader.service(CmsXmlContentLoader.java:232)
at
org.opencms.flex.CmsFlexRequestDispatcher.includeInternalWithCache(CmsFlexRequestDispatcher.java:419)
at
org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatcher.java:175)
at
org.opencms.jsp.CmsJspTagInclude.includeTagAction(CmsJspTagInclude.java:218)
at org.opencms.jsp.CmsJspTagInclude.doEndTag(CmsJspTagInclude.java:349)
at
org.apache.jsp.WEB_002dINF.jsp.offline.system.modules.com_wdogsystems_site.templates.article_jsp._jspx_meth_cms_include_0(org.apache.jsp.WEB_002dINF.jsp.offline.system.modules.com_wdogsystems_site.templates.article_jsp:120)
at
org.apache.jsp.WEB_002dINF.jsp.offline.system.modules.com_wdogsystems_site.templates.article_jsp._jspService(org.apache.jsp.WEB_002dINF.jsp.offline.system.modules.com_wdogsystems_site.templates.article_jsp:75)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
at
org.opencms.flex.CmsFlexRequestDispatcher.includeExternal(CmsFlexRequestDispatcher.java:193)
at
org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatcher.java:171)
at org.opencms.loader.CmsJspLoader.service(CmsJspLoader.java:416)
at
org.opencms.flex.CmsFlexRequestDispatcher.includeInternalWithCache(CmsFlexRequestDispatcher.java:419)
at
org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatcher.java:175)
at org.opencms.loader.CmsJspLoader.dispatchJsp(CmsJspLoader.java:450)
at org.opencms.loader.CmsJspLoader.load(CmsJspLoader.java:395)
at
org.opencms.loader.CmsXmlContentLoader.load(CmsXmlContentLoader.java:209)
at
org.opencms.loader.CmsResourceManager.loadResource(CmsResourceManager.java:711)
at org.opencms.main.OpenCmsCore.showResource(OpenCmsCore.java:1337)
at org.opencms.main.OpenCmsServlet.doGet(OpenCmsServlet.java:139)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)
Does anyone know what could be causing this? Is it maybe not possible to add
a template on top of another template?
More information about the opencms-dev
mailing list