[opencms-dev] Java class to translate XML code contained in the VFS in HTML page source code
Massimiliano
massyc at mclink.it
Wed Nov 5 01:53:01 CET 2003
Hi Stephan,
I modified my source code using the CmsXmlTemplate class but I receive a
NullPointerException.
Do you have idea to resolve this problem?
This is the exception trace:
[CmsElementXml (CmsXmlTemplate/index.html)] adding variant "key_http_"
to cache.
java.lang.NullPointerException
at java.lang.String$2.run(String.java:267)
at java.security.AccessController.doPrivileged(Native Method)
at java.lang.String$CharToByteCache.getConverter(String.java:263)
at java.lang.String.getCTBConverter(String.java:408)
at java.lang.String.getBytes(String.java:1193)
at
com.opencms.template.cache.A_CmsElement.resolveVariant(A_CmsElement.java:425)
at
com.opencms.template.CmsXmlTemplate.startProcessing(CmsXmlTemplate.java:1314)
at com.opencms.template.CmsXmlTemplate.getContent(CmsXmlTemplate.java:164)
at
com.ibm.opencms.integration.OpenCMSConnector.getPage(OpenCMSConnector.java:97)
at
com.ibm.opencms.integration.test.OpenCMSConnectorTest.main(OpenCMSConnectorTest.java:27)
Thanks again,
Massimiliano.
Stephan Hartmann wrote:
> Hi Massimiliano,
>
> the launcher mechanism calls a getContent method of an instance of
> com.opencms.template.CmsXmlTemplate and writes the result (a byte[])
> directly into the http response.
> You should try something like this:
>
> CmsXmlTemplate cxl = new CmsXmlTemplate();
> byte[] result = cxl.getContent(cmso, "/vfs/path/to/file", null, new
> Hashtable(), null);
>
> Bye,
> Stephan
More information about the opencms-dev
mailing list