AW: [opencms-dev] element cache & multiple bodies -> NullPointerE xception

O_Faulhaber at push-interactive.de O_Faulhaber at push-interactive.de
Fri Sep 7 12:22:06 CEST 2001


Dear Michael,
 
sorry for bothering you again but it seems that I really need your help to
solve this problem:
 
Upfront one question: Was the element cache of your system switched on, when
you reconstructed my problem? If 'yes' - then the problem might probably be
larger. Therefore I will exactly descripe the steps which I took: 

*	System1: NT4/IIS/Tomcat 3.3-b1/OpenCms 4.4.0
	
*	System2: Linux/Apache/Tomcat 3.3-b1/OpenCms 4.4.0
*	Elementcache is 'on' (by default in opencms.properties)
*	I created the XML Template named "test" in /content/templates/ in
the workspace.

  _____  

XML TEMPLATE

<?xml version="1.0"?>
<XMLTEMPLATE>
<TEMPLATE>
    <![CDATA[
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
        <title>]]><method name="getTitle"/><![CDATA[</title>
    </head>
    <BODY>
         ]]>
         <ELEMENT name="body"/>
         <![CDATA[<P>]]>
         <ELEMENT name="body2"/>
         <![CDATA[
    </BODY>
    </html>
    ]]>
</TEMPLATE>
<ELEMENTDEF name="body2">
     <CLASS>com.opencms.template.CmsXmlTemplate</CLASS>
     <TEMPLATESELECTOR>body2</TEMPLATESELECTOR>
</ELEMENTDEF>
</XMLTEMPLATE>
  _____  


	
*	In the root directory I created a page named "test", which uses the
test template. 

*	Afterwards I edited the page with the WYSIWYG editor, entered this
text "Defaultbody" in the default body, added a new body (body2) and entered
this text "Text for Body2" and saved the whole. 

*	Then I looked into /content/bodys/test.html:

  _____  

BODY FILE
<?xml version="1.0" encoding="ISO-8859-1"?>
<XMLTEMPLATE>
    <TEMPLATE><![CDATA[<P>Defaultbody</P>]]></TEMPLATE>
    <template name="body2"><![CDATA[Text for Body2]]></template>
</XMLTEMPLATE>

  _____  


*	Then I looked into the page control file of /test.html:

  _____  

PAGE CONTROL FILE
<?xml version="1.0" encoding="ISO-8859-1"?>
<PAGE>
    <class>com.opencms.template.CmsXmlTemplate</class>
    <masterTemplate>/content/templates/test</masterTemplate>
    <ELEMENTDEF name="body">
        <CLASS>com.opencms.template.CmsXmlTemplate</CLASS>
        <TEMPLATE>/content/bodys/test.html</TEMPLATE>
    </ELEMENTDEF>
</PAGE>
  _____  


*	Then i clicked on test.html in the root directory with the following
result:

  _____  

BROWSER OUTPUT


  _____  

 
  _____  

SINGLE DUMP IN OPENCMS.LOG

...
[07.09.2001 10:38:09] <opencms_info> [CmsXmlTemplateFile] Cannot find
"bodytag" tag in XML template file test.
[07.09.2001 10:38:32] <opencms_info> [CmsXmlTemplateFile] Cannot find
"bodytag" tag in XML template file test.
[07.09.2001 10:38:42] <opencms_critical> [CmsXmlLanguageFile] Mandatory tag
"fileicon.compatiblePlain" missing in language file "core_de".
[07.09.2001 10:38:47] <opencms_critical> [CmsElementXml
(CmsXmlTemplate/test)] Non-CmsException in element body2
[07.09.2001 10:38:47] <opencms_critical> [CmsElementXml
(CmsXmlTemplate/test)]java.lang.NullPointerException
opencms.log lines 3076-3149/3149 (END)
  _____  

 
If I disable the element cache in opencms.properties and restart Tomcat, the
page is correctly displayed(!). The behaviour of OpenCms in this case is
identical on both systems. Therefore I cannot explain myself why the example
on your system operated correctly.
Did I perhaps do wrong somewhere? I studied the OpenCms manual quite exactly
here, but perhaps I did not correctly understood the systematics yet, which
is behind the application of several bodies in one Template. 
 
Many thanks in Advance,
Oliver

--------------------------------------------------------------------
Dipl.-Inform./Medien (FH)       Oliver Faulhaber
Push Interactive GmbH           Fon: +49/202/2427-346
VillaMedia, Viehhofstrasse 125  Fax: +49/202/2427-310
D-42117 Wuppertal               URL:  <http://www.push-interactive.de/>
http://www.push-interactive.de/
--------------------------------------------------------------------



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opencms.org/pipermail/opencms-dev/attachments/20010907/ec6e9f64/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clip_image002.jpg
Type: image/jpeg
Size: 14290 bytes
Desc: not available
URL: <http://lists.opencms.org/pipermail/opencms-dev/attachments/20010907/ec6e9f64/attachment.jpg>


More information about the opencms-dev mailing list