1. In 'public ObjectNode retrieveObject(Uri uri)' around line 224

old:      File file = new File(rootpath+ relative + ".structure");

new:     File file = new File(new File(rootpath), relative + ".structure");

The reason being that proper file path concatenation cannot be done with
'+'. For example, I got rootpath='files', relative='users' and the result
was file=filesusers.structure

2. Same place around line 260

old            File file = new File(rootpath+uri.getRelative());

new:             File file = new File(new File(rootpath),
uri.getRelative());

3. Same place around line 243

        } catch (FileNotFoundException e) {
            //e.printStackTrace();
            // Silent exception, except if we're on the root path
            if (relative.equals("/"))
                throw new ObjectNotFoundException(uri);

The silent ignore of the exception (which is not done in the case in the
memory descriptors store) causes the following exception:

08 Jul 2001 18:38:37 - INFO - Loading namespace xml configuration
java.lang.ClassCastException: org.apache.slide.structure.SubjectNode
        at
org.apache.slide.common.NamespaceConfig.getActionNode(NamespaceConfig.java:1
030)
        at
org.apache.slide.common.NamespaceConfig.initializeNamespaceConfig(NamespaceC
onfig.java:589)
        at
org.apache.slide.common.Namespace.loadConfiguration(Namespace.java:745)
        at org.apache.slide.common.Domain.initNamespace(Domain.java:699)
        at org.apache.slide.common.Domain.init(Domain.java:361)
        at org.apache.slide.common.Domain.selfInit(Domain.java:633)
        at org.apache.slide.common.Domain.accessNamespace(Domain.java:185)
        at xml.Test.main(Test.java:71)

Because we do not return ObjectNotFoundException, the /actions is created as
SubjectNode and then when we try to use it we get a cast error because we
try to cast it as ActionNode....

/d

Reply via email to