[opencms-dev] Problem calling methods / Method getContent in CmsMethodElement does not provide a CmsXmlTemplate / Bug?

hans huber hans.huber at virtual-identity.com
Tue Oct 15 14:58:21 CEST 2002


Hello,

I have a problem calling a method in a template. E. g. when calling 

<method name="getStylesheet"/>

in a frametemplate this will result in a NullPointerException. The reason for this is the missing "doc" Parameter in the method call. Caller is class CmsMethodElement.getContent Line 140 (in latest Revision 1.4). The third parameters for the method call is statically set to null, which causes the NullPointerException.

I tried this on a customized 4.6.1 installation and also on a clean 5.0beta installation. Both have the same result.

This is the source code from OpenCms (CmsMethodElement, line 140)

            Object methodResult = null;
            try{
                methodResult = templateClass.getClass().getMethod(m_methodName, new Class[] {
                                    CmsObject.class, String.class, A_CmsXmlContent.class,
                                     Object.class}).invoke(templateClass,
                                     new Object[] {cms, methodParameter, null, parameters});
            }catch(NoSuchMethodException exc) {

Any hints?

Thanks

Hans
 



More information about the opencms-dev mailing list