You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Julian Reschke (JIRA)" <ji...@apache.org> on 2006/08/08 18:24:13 UTC

[jira] Created: (JCR-534) RepositoryStub fails to load default properties file

RepositoryStub fails to load default properties file
----------------------------------------------------

                 Key: JCR-534
                 URL: http://issues.apache.org/jira/browse/JCR-534
             Project: Jackrabbit
          Issue Type: Bug
          Components: JCR TCK
            Reporter: Julian Reschke
            Priority: Minor


In org.apache.jackrabbit.test.getInstance(), the code tries to load the default config file using

  RepositoryStub.class.getClassLoader().getResourceAsStream(...)

I think this needs to be

  RepositoryStub.class.getResourceAsStream(...)


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JCR-534) RepositoryStub fails to load default properties file

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-534?page=comments#action_12426874 ] 
            
Marcel Reutegger commented on JCR-534:
--------------------------------------

Class.getResourceAsStream() has a different semantic than ClassLoader.getResourceAsStream(). The latter does not modify the name of the requested resource whereas the first does.

Class.getResourceAsStream() JavaDoc:

"This method delegates the call to its class loader, after making these changes to the resource name: if the resource name starts with "/", it is unchanged; otherwise, the package name is prepended to the resource name after converting "." to "/"."

In case of the RepositoryStub this would result in searching for a resource with path: /org/apache/jackrabbit/test/repositoryStubImpl/properties

To load the repositoryStubImpl.properties file with the current code you have to place the file in a folder which is in your classpath or package the file in a separate jar file and put that file in your classpath.

> RepositoryStub fails to load default properties file
> ----------------------------------------------------
>
>                 Key: JCR-534
>                 URL: http://issues.apache.org/jira/browse/JCR-534
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: JCR TCK
>            Reporter: Julian Reschke
>            Priority: Minor
>
> In org.apache.jackrabbit.test.getInstance(), the code tries to load the default config file using
>   RepositoryStub.class.getClassLoader().getResourceAsStream(...)
> I think this needs to be
>   RepositoryStub.class.getResourceAsStream(...)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JCR-534) RepositoryStub fails to load default properties file

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-534?page=comments#action_12427489 ] 
            
Julian Reschke commented on JCR-534:
------------------------------------

Marcel,

I think you got that wrong. The conversion of "." to "/" is applied to the package name, not the resource name. So with the change proposed by me, the file would be found in

  org/apache/jackrabbit/test/repositoryStubImpl.properties

...which seems to be right place to me. Right now, the file is found at

  repositoryStubImpl.properties

I can live with that, but is this really the intent?


> RepositoryStub fails to load default properties file
> ----------------------------------------------------
>
>                 Key: JCR-534
>                 URL: http://issues.apache.org/jira/browse/JCR-534
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: JCR TCK
>            Reporter: Julian Reschke
>            Priority: Minor
>
> In org.apache.jackrabbit.test.getInstance(), the code tries to load the default config file using
>   RepositoryStub.class.getClassLoader().getResourceAsStream(...)
> I think this needs to be
>   RepositoryStub.class.getResourceAsStream(...)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (JCR-534) RepositoryStub fails to load default properties file

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-534?page=all ]

Marcel Reutegger resolved JCR-534.
----------------------------------

    Resolution: Won't Fix

> I think you got that wrong. The conversion of "." to "/" is applied to the package name,
> not the resource name.

Ah, you are right. That JavaDoc is quite confusing, it doesn't really say that all but the last '.' is replaced.

But anyway...

> I can live with that, but is this really the intent?

Yes it is. This makes it easier to provide a repositoryStubImpl.properties file by simply placing it into a classes folder without having to care in what package it should be.

Please note that you can also indicate to the TCK which property file it should use by specifying a JVM system property:

-Djavax.jcr.tck.properties=/home/me/myrepo.properties

> RepositoryStub fails to load default properties file
> ----------------------------------------------------
>
>                 Key: JCR-534
>                 URL: http://issues.apache.org/jira/browse/JCR-534
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: JCR TCK
>            Reporter: Julian Reschke
>            Priority: Minor
>
> In org.apache.jackrabbit.test.getInstance(), the code tries to load the default config file using
>   RepositoryStub.class.getClassLoader().getResourceAsStream(...)
> I think this needs to be
>   RepositoryStub.class.getResourceAsStream(...)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira