[opencms-dev] Access a file by uuid

Sandrine Prousteau s.prousteau at eurelis.com
Fri Dec 12 15:24:44 CET 2008


When I click on details:

org.opencms.file.CmsVfsResourceNotFoundException: Error reading resource with the ID 005b59dc-bbbe-11dd-9b62-e94a49fd8c42.
	at org.opencms.file.CmsVfsResourceNotFoundException.createException(CmsVfsResourceNotFoundException.java:78)
	at org.opencms.db.CmsDbContext.throwException(CmsDbContext.java:238)
	at org.opencms.db.CmsDbContext.report(CmsDbContext.java:212)
	at org.opencms.db.CmsSecurityManager.readResource(CmsSecurityManager.java:3992)
	at org.opencms.file.CmsObject.readResource(CmsObject.java:3394)
	at org.opencms.file.CmsObject.readResource(CmsObject.java:3361)
	at org.apache.jsp.WEB_002dINF.jsp.offline.sites.default_.testcuuid_jsp._jspService(testcuuid_jsp.java:80)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:696)
	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:585)
	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:510)
	at org.opencms.flex.CmsFlexRequestDispatcher.includeExternal(CmsFlexRequestDispatcher.java:194)
	at org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatcher.java:169)
	at org.opencms.loader.CmsJspLoader.service(CmsJspLoader.java:1193)
	at org.opencms.flex.CmsFlexRequestDispatcher.includeInternalWithCache(CmsFlexRequestDispatcher.java:423)
	at org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatcher.java:173)
	at org.opencms.loader.CmsJspLoader.dispatchJsp(CmsJspLoader.java:1227)
	at org.opencms.loader.CmsJspLoader.load(CmsJspLoader.java:1171)
	at org.opencms.loader.CmsResourceManager.loadResource(CmsResourceManager.java:964)
	at org.opencms.main.OpenCmsCore.showResource(OpenCmsCore.java:1498)
	at org.opencms.main.OpenCmsServlet.doGet(OpenCmsServlet.java:152)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
	at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
	at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
	at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
	at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
	at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
	at java.lang.Thread.run(Thread.java:595)
Caused by: org.opencms.file.CmsVfsResourceNotFoundException: Unable to read resource with ID "005b59dc-bbbe-11dd-9b62-e94a49fd8c42".
	at org.opencms.db.generic.CmsVfsDriver.readResource(CmsVfsDriver.java:1925)
	at org.opencms.db.CmsDriverManager.readResource(CmsDriverManager.java:6513)
	at org.opencms.db.CmsSecurityManager.readResource(CmsSecurityManager.java:5822)
	at org.opencms.db.CmsSecurityManager.readResource(CmsSecurityManager.java:3990)
	... 52 more

-----Message d'origine-----
De : opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] De la part de Sebastian Himberger
Envoyé : vendredi 12 décembre 2008 15:09
À : The OpenCms mailing list
Objet : Re: [opencms-dev] Access a file by uuid

Hi,

works perfectly for me!

What's the exact stack trace? In the log file or when you click on Details.

Regards,
Sebastian

Sandrine Prousteau schrieb:
> On Secure/Export, I've got this:
>
> State: unchanged
> Permalink: http://www.test5.spr/opencms/opencms/permalink/005b59db-bbbe-11dd-9b62-e94a49fd8c42
>
> On my jsp, I've got this:
>
> Ref Id (seen in Secure/Export) : 005b59dc-bbbe-11dd-9b62-e94a49fd8c42<br/>
> Resource Id : <%=cms.getCmsObject().readResource("/Tests_wiki/myCsv").getResourceId()%><br/>
> CmsUUID : <%=CmsUUID.valueOf("005b59dc-bbbe-11dd-9b62-e94a49fd8c42").getStringValue()   %><br/>
> Resource path : <%=cms.getCmsObject().readResource(new CmsUUID("005b59dc-bbbe-11dd-9b62-e94a49fd8c42")).getRootPath()  %><br/>
>
> And it show this:
>
> Error reading resource with the ID 005b59dc-bbbe-11dd-9b62-e94a49fd8c42.
> Reason: Unable to read resource with ID "005b59dc-bbbe-11dd-9b62-e94a49fd8c42".
>
> I don't understand. I'm on Admin - admin (the default connexion to workplace).
>
>
> -----Message d'origine-----
> De : opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] De la part de Sebastian Himberger
> Envoyé : vendredi 12 décembre 2008 11:39
> À : The OpenCms mailing list
> Objet : Re: [opencms-dev] Access a file by uuid
>
> Hi Sandrine,
>
> this user is important:
>
> cmso.loginUser("Admin", "thePassWord");
>
> because this is the one which will try to read the file. Also make sure
> you have the correct uuid. You can get it via the context menü:
> Advanced->Secure/Export: http://<domain>/permalink/<uuid>
>
> best regards,
> Sebastian
>
>
> Sandrine Prousteau schrieb:
>   
>> I'm connected to the workplace as Admin (default administrator)...
>>
>> -----Message d'origine-----
>> De : opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] De la part de Sebastian Himberger
>> Envoyé : jeudi 11 décembre 2008 20:24
>> À : The OpenCms mailing list
>> Objet : Re: [opencms-dev] Access a file by uuid
>>
>> Hi,
>>
>> this works for me:
>>
>> <%@ page
>> import="org.opencms.file.*,org.opencms.jsp.*,org.opencms.util.*,org.opencms.main.*"
>> %>
>> <%
>>
>> String uuid = "ceece147-3144-11dc-a69a-5f50d3bd539c";
>>
>> CmsObject cmso = OpenCms.initCmsObject("Guest");
>> cmso.loginUser("Admin", "thePassWord");
>>
>> CmsResource res = cmso.readResource(new CmsUUID(uuid));
>>
>> out.println(res.getName());
>>
>> %>
>>
>> Are you sure the user who logs in has read access to the resource?
>>
>> best regards,
>> Sebastian
>>
>> Yves Glodt schrieb:
>>   
>>     
>>> Hello,
>>>
>>>
>>> is it possible to find and access a file in the VFS by it's uuid?
>>>
>>>
>>> Background: I have certains PDF documents in my vfs which are not
>>> accessible
>>> for any user, logged in or not, and I want to serve them with
>>> obfuscated urls
>>> à la /getFile.jsp?id=xxxxxx and it would be nice if I could just use
>>> the uuid
>>> to identify them.
>>> I use OpenCms 7.0.4. Maybe there is another way to achieve this...? :-)
>>>
>>>
>>> Best regards,
>>> Yves
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>>
>>> _______________________________________________
>>> This mail is sent to you from the opencms-dev mailing list
>>> To change your list options, or to unsubscribe from the list, please visit
>>> http://lists.opencms.org/mailman/listinfo/opencms-dev
>>>     
>>>       
>> _______________________________________________
>> This mail is sent to you from the opencms-dev mailing list
>> To change your list options, or to unsubscribe from the list, please visit
>> http://lists.opencms.org/mailman/listinfo/opencms-dev
>>
>> _______________________________________________
>> This mail is sent to you from the opencms-dev mailing list
>> To change your list options, or to unsubscribe from the list, please visit
>> http://lists.opencms.org/mailman/listinfo/opencms-dev
>>   
>>     
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>   


_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev



More information about the opencms-dev mailing list