jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcel Reutegger (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-534) RepositoryStub fails to load default properties file
Date Wed, 09 Aug 2006 08:39:15 GMT
    [ 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

        

Mime
View raw message