[opencms-dev] vfs.readXml

Marko Riedel markoriedelde at yahoo.de
Fri Jul 6 01:09:12 CEST 2012


Dear friends,

I have a problem understanding and using some code that I did not write but must deploy. (OpenCMS 8.0.3).


We have the following code in a template:
<c:set var="rootfolder"><cms:property name="RootFolder" file="search" /></c:set>
<c:set var="config" value="${rootfolder}elements/_config.html"/>
<c:set var="configfile" value="${vfs.readXml[config]}" />

The root folder is set to "/sites/default/". 

The file /sites/default/elements/_config.html is present and world readable as far as I can tell. The tool xmllint says it is valid xml. But I cannot access its contents. I get the following exception:

Caused by: org.opencms.file.CmsVfsResourceNotFoundException: 
Error 
reading resource from path "/sites/default/elements/_config.html".
at org.opencms.file.CmsVfsResourceNotFoundException.createException(CmsVfsResourceNotFoundException.java:71)
    at org.opencms.db.CmsDbContext.throwException(CmsDbContext.java:334)
    at org.opencms.db.CmsDbContext.report(CmsDbContext.java:286)
    at org.opencms.db.CmsSecurityManager.readResource(CmsSecurityManager.java:4687)
    at org.opencms.file.CmsObject.readResource(CmsObject.java:2943)
    at org.opencms.file.CmsObject.readFile(CmsObject.java:2357)

Can you tell me what could have gone wrong here? Or better still what can I do to pinpoint the exact problem? Where may I find the source of vfs.readXml[config] in order to learn where it breaks?

Thank you for your help!

Best regards,

Marko Riedel



More information about the opencms-dev mailing list