You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Claus Goettfert <cl...@gmx.net> on 2002/05/21 00:32:07 UTC
accessing file via slide
hi all,
I use retail slide 1.0.16 and run into problems when trying to access a
file via slide. I used an example posted previously here but I always get a
nullpointerexception whatever path variation I try on line
NodeRevisionDescriptors revisionDescriptors =
content.retrieve(slideToken, "/files/test.txt");
I use slide out of the box except adding a user for accessing the tomcat
manager (via tomcat-users.xml) and setting a password for user john in
/conf/slide/slide.data.
I used the user john to add the "test.txt" file to /files/ via "my network
places". so there is a file "/files/test.txt" via webdav client and a file
called "jakarta-slide/server/contentstore/files/test.txt_1.0" even after
stopping, restarting slide.
additionally changing the "rootpath" in domain.xml doesn't seem to have any
effect (see below?). slide always stores files in
jakarta-slide/server/contentstore (slide server started from
jakarta-slide/server/, the Domain.xml file is also located at
jakarta-slide/server/Domain.xml).
here is my sourcecode:
<--->
PrintWriter out = response.getWriter();
try{
NamespaceAccessToken token = Domain.accessNamespace(new
SecurityToken(""), "slide");
Structure structure = token.getStructureHelper();
Security security = token.getSecurityHelper();
Lock lock = token.getLockHelper();
Content content = token.getContentHelper();
CredentialsToken credToken =
new CredentialsToken(new String("john"));
SlideToken slideToken = new SlideTokenImpl(credToken);
// structure.create(slideToken, new SubjectNode(),
"/files/slideTestFolder");
NodeRevisionDescriptors revisionDescriptors =
content.retrieve(slideToken, "/files/test.txt");
} catch (Exception ex) {
ex.printStackTrace(out);
}
<-->
when executing the servlet slide throws exceptions like:
ClassCastException: slidestore.reference.MemoryDescriptorsStore
....
ClassCastException: slidestore.reference.FileContentStore
....
ClassCastException: slidestore.reference.DefaultStore
.....
or warnings like:
org.apache.slide.common.Domain - WARNING - Service memory
(org.apache.slide.store.StandardStore) access error :
org.apache.slide.common.SlideException: caus is empty
and a nullpointerexception.
all on line:
NamespaceAccessToken token = Domain.accessNamespace(new
SecurityToken(""), "slide");
...
can anyone please give me some hints what is wrong? or point me to some
examples how to use the slide api (simple file access, property access or
similar)? i didn't find anything, the examples provided seem to cover some
other topics.
regards,
claus goettfert
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>