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

O_Faulhaber at push-interactive.de O_Faulhaber at push-interactive.de
Thu Sep 13 11:28:40 CEST 2001


Hello Michael,

I did not receive any response on my email, which I did send last week.
Possibly email in the HTML format cannot be received. Therefore I send the
original message in plain text format to the list again.


-----Ursprüngliche Nachricht-----
Von: O_Faulhaber at push-interactive.de
[mailto:O_Faulhaber at push-interactive.de]
Gesendet: Freitag, 7. September 2001 12:22
An: opencms-dev at www.opencms.com
Betreff: AW: [opencms-dev] element cache & multiple bodies -> NullPointerE
xception


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: (see attachment browseroutput.jpg)

-----------------------------------------------------------------------

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/
--------------------------------------------------------------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: browseroutput.JPG
Type: image/jpeg
Size: 20757 bytes
Desc: not available
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20010913/6044cf7c/attachment.jpe>


More information about the opencms-dev mailing list