[opencms-dev] NullpointerExeption when editing a page.

Arash Kaffamanesh arash.kaffamanesh at pomegranate.de
Fri Dec 16 15:09:25 CET 2005


You are using the wrong tutorial, it was for OpenCms 5.0 and I guess you
are using OpenCms 6, read throgh Alkacon Documenation and have a look in
the source of templateone.

Kind Regards,
Arash

-----Original Message-----
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Thierry Collogne
Sent: Freitag, 16. Dezember 2005 11:46
To: opencms-dev at opencms.org
Subject: [opencms-dev] NullpointerExeption when editing a page.


Hi,

I have just started using OpenCms and started with a tutorial I found on
the 
web.

In this tutorial a default body is created :

<?xml version="1.0" encoding="ISO-8859-1"?>
<XMLTEMPLATE>
<TEMPLATE>
<![CDATA[]]>
</TEMPLATE>
</XMLTEMPLATE>

An xml for the template


<?xml version="1.0" encoding="ISO-8859-1"?>

<xmltemplate>

  <stylesheet>/resources/css/test.css</stylesheet>

  <template><element name="jsptemplate"/></template>

  <elementdef name="jsptemplate">
    <class>com.opencms.flex.CmsJspTemplate</class>
    <template>../jsptemplates/test.jsp</template>
  </elementdef>

</xmltemplate>


A jsp template

<%@ page import="com.opencms.flex.jsp.*" %>
<%@ page session="false" %>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>

<%
  // Create a JSP action element
  com.opencms.flex.jsp.CmsJspActionElement cms = new 
CmsJspActionElement(pageContext, request, response);
%>

<cms:template element="head">
<html>
  <head>
    <title>Test Site - <cms:property name="title" escapeHtml="true" 
/></title>
    <link title="Flex Stylesheet" href 
="<cms:link>/resources/css/test.css</cms:link>" type="text/css" 
rel="STYLESHEET">
  </head>
  <body>
    <cms:include file="navigation.jsp" />
</cms:template>


<cms:template element="body">
  <cms:include element="body" />
</cms:template>

<cms:template element="foot">
  </body>
</html>
</cms:template>

When I try to create a new html page using this template and
default_body 
and try to edit it, I get a NullPointerException.
This is the stacktrace :

java.lang.NullPointerException
	at
org.opencms.xml.page.CmsXmlPage.convertOldDocument(CmsXmlPage.java:556)
	at
org.opencms.xml.page.CmsXmlPage.initDocument(CmsXmlPage.java:492)
	at org.opencms.xml.page.CmsXmlPage.<init>(CmsXmlPage.java:161)
	at 
org.opencms.xml.page.CmsXmlPageFactory.unmarshal(CmsXmlPageFactory.java:
144)
	at 
org.opencms.xml.page.CmsXmlPageFactory.unmarshal(CmsXmlPageFactory.java:
209)
	at 
org.opencms.xml.page.CmsXmlPageFactory.unmarshal(CmsXmlPageFactory.java:
158)
	at 
org.opencms.workplace.editors.CmsSimplePageEditor.initWorkplaceRequestVa
lues(CmsSimplePageEditor.java:237)
	at 
org.opencms.workplace.CmsWorkplace.initWorkplaceMembers(CmsWorkplace.jav
a:2084)
	at
org.opencms.workplace.CmsWorkplace.<init>(CmsWorkplace.java:264)
	at
org.opencms.workplace.tools.CmsToolDialog.<init>(CmsToolDialog.java:86)
	at org.opencms.workplace.CmsDialog.<init>(CmsDialog.java:249)
	at
org.opencms.workplace.editors.CmsEditor.<init>(CmsEditor.java:189)
	at 
org.opencms.workplace.editors.CmsDefaultPageEditor.<init>(CmsDefaultPage
Editor.java:116)
	at 
org.opencms.workplace.editors.CmsSimplePageEditor.<init>(CmsSimplePageEd
itor.java:90)
	at 
org.opencms.editors.htmlarea.CmsHtmlAreaEditor.<init>(CmsHtmlAreaEditor.
java:76)
	at 
org.apache.jsp.WEB_002dINF.jsp.offline.system.workplace.editors.htmlarea
.editor_jsp._jspService(org.apache.jsp.WEB_002dINF.jsp.offline.system.wo
rkplace.editors.htmlarea.editor_jsp:53)
	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.ja
va: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(Applica
tionFilterChain.java:252)
	at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:173)
	at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc
her.java:672)
	at 
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDisp
atcher.java:574)
	at 
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispat
cher.java:499)
	at 
org.opencms.flex.CmsFlexRequestDispatcher.includeExternal(CmsFlexRequest
Dispatcher.java:193)
	at 
org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatch
er.java:171)
	at
org.opencms.loader.CmsJspLoader.service(CmsJspLoader.java:416)
	at 
org.opencms.flex.CmsFlexRequestDispatcher.includeInternalWithCache(CmsFl
exRequestDispatcher.java:419)
	at 
org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatch
er.java:175)
	at 
org.opencms.jsp.CmsJspTagInclude.includeTagAction(CmsJspTagInclude.java:
218)
	at 
org.opencms.jsp.CmsJspActionElement.include(CmsJspActionElement.java:384
)
	at 
org.opencms.jsp.CmsJspActionElement.include(CmsJspActionElement.java:408
)
	at 
org.apache.jsp.WEB_002dINF.jsp.offline.system.workplace.editors.editor_0
05fmain_jsp._jspService(org.apache.jsp.WEB_002dINF.jsp.offline.system.wo
rkplace.editors.editor_005fmain_jsp:50)
	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.ja
va: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(Applica
tionFilterChain.java:252)
	at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:173)
	at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc
her.java:672)
	at 
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDisp
atcher.java:574)
	at 
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispat
cher.java:499)
	at 
org.opencms.flex.CmsFlexRequestDispatcher.includeExternal(CmsFlexRequest
Dispatcher.java:193)
	at 
org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatch
er.java:171)
	at
org.opencms.loader.CmsJspLoader.service(CmsJspLoader.java:416)
	at 
org.opencms.flex.CmsFlexRequestDispatcher.includeInternalWithCache(CmsFl
exRequestDispatcher.java:419)
	at 
org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatch
er.java:175)
	at
org.opencms.loader.CmsJspLoader.dispatchJsp(CmsJspLoader.java:450)
	at org.opencms.loader.CmsJspLoader.load(CmsJspLoader.java:395)
	at 
org.opencms.loader.CmsResourceManager.loadResource(CmsResourceManager.ja
va: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(Applica
tionFilterChain.java:252)
	at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:173)
	at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:213)
	at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.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:1
48)
	at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:86
8)
	at 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.proc
essConnection(Http11BaseProtocol.java:663)
	at 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint
.java:527)
	at 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollow
erWorkerThread.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?

Thanks,

Thierry




_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please
visit http://mail.opencms.org/mailman/listinfo/opencms-dev




More information about the opencms-dev mailing list