[opencms-dev] a weird problem ...
ruben malchow
r_malchow at web.de
Sun Nov 5 12:10:47 CET 2006
is it a trailing slash again?
i am currently getting thefollowing exception:
( 1 / 1 ) Publishing file /default/published.txt ... !!! Error publishing file "/sites/default/published.txt".
!!! Exception Unable to read resource with ID "5d1e5c1e-6cb6-11db-9b38-1544a99c51af".
org.opencms.file.CmsVfsResourceNotFoundException: Unable to read resource with ID "5d1e5c1e-6cb6-11db-9b38-1544a99c51af".
at org.opencms.db.generic.CmsVfsDriver.readResource(CmsVfsDriver.java:1382)
at org.opencms.db.generic.CmsProjectDriver.publishFile(CmsProjectDriver.
now, what i do is pretty much this:
co.getRequestContext().setSiteRoot("/sites"); // no trailing slash ?!
/*
make sure it isn't locked or something, if nothing else helps, steal
the lock ...
*/
co.publishResource("/default/published.txt",true,report); // leading slash??!?
in this example, "/sites/default/published.txt" DOES exists. the actual
values may vary, but my debugger tells me they actually are what i
expect them to be. now i could try every possible combination of
trailing and/or leading slashes, but what strikes me most is that the ID
given in the exception is NOT a resource id, but the (correct!)
structure id of the item in question. is that just another example of my
confusion with the naming of structure and resource elements? i
understand that the CmsResource objects actually are not only directly
linked to the resource table in the db, but got a bit of structure mixed
in, but shouldn't the error message read "unable to read resource with
STRUCTURE id "foo-bar-something" or "... with RESOURCE if
"bar-foo-something" instead? i mean, it's not entirely clear to me what
it actually tries to retrieve ... and i don't have a strong urge to look
at the sql logs, either ...
anyway. anyone out there with a clear understanding of this frigging
trailing/leading slash issue? help? please?
.rm
More information about the opencms-dev
mailing list