You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Dominique Pfister <do...@day.com> on 2009/07/09 12:25:38 UTC

Re: Build failed in Hudson: Jackrabbit-trunk » Jackrabbit Core #636

Hi,

I was able to find out how those "repository" and "repository.xml" are
created; it is actually a combination of tests:

o.a.j.test.api.RepositoryFactoryTest#testDefaultRepository:
instantiates a TransientRepository with home=null/config=null and
o.a.j.core.RepositoryFactoryImpl registers this repository in its
static REPOSITORY_INSTANCES map, with key=null.

o.a.j.core.integration.RepositoryFactoryImplTest#testDefaultRepository:
sets system properties with
home=target/repository/config=target/repository.xml and asks
o.a.j.core.RepositoryFactoryImpl to get or create a repository with
key=null. Unfortunately, the transient repository registered above is
still in the map and therefore this test inadvertently uses the wrong
repository, which will create those file system entries.

This can be reproduced by creating a read-only file "repository", and
running the two tests in sequence. I then get failures with stack
trace:

javax.jcr.RepositoryException: Invalid repository configuration file:
repository.xml
	at o.a.j.core.TransientRepository$2.getRepository(TransientRepository.java:230)
        ...
Caused by: o.a.j.ConfigurationException: Repository directory
repository does not exist
	at o.a.j.core.config.RepositoryConfig.create(RepositoryConfig.java:174)
	...

I don't know exactly where this should be fixed: use system properties
in RepositoryFactoryTest as well or provide some clean up in
RepositoryFactoryImpl's REPOSITORY_INSTANCES map. Marcel, can you (or
Julian) take a look at this?

Regards
Dominique


On Tue, Jun 30, 2009 at 11:28 PM, Tobias Bocanegra<tr...@day.com> wrote:
> hi,
>
>> For some reason the Hudson build creates an unexpected ./repository
>> directory (not ./target/repository) that gets flagged by RAT. I'm not
>> yet sure what causes that, but for now I simply added an extra RAT
>> exclude rule that should make the Hudson build succeed again.
>
> it's not just the hudson build - i have those "repository" and
> "repository.xml", too.
> i guess it's one of the tests that does not use the proper repository home.
>
> regards, toby
>

Re: Build failed in Hudson: Jackrabbit-trunk » Jackrabbit Core #636

Posted by Marcel Reutegger <ma...@gmx.net>.
Hi,

https://issues.apache.org/jira/browse/JCR-2203 should fix this problem.

regards
 marcel

On Thu, Jul 9, 2009 at 12:25, Dominique
Pfister<do...@day.com> wrote:
> Hi,
>
> I was able to find out how those "repository" and "repository.xml" are
> created; it is actually a combination of tests:
>
> o.a.j.test.api.RepositoryFactoryTest#testDefaultRepository:
> instantiates a TransientRepository with home=null/config=null and
> o.a.j.core.RepositoryFactoryImpl registers this repository in its
> static REPOSITORY_INSTANCES map, with key=null.
>
> o.a.j.core.integration.RepositoryFactoryImplTest#testDefaultRepository:
> sets system properties with
> home=target/repository/config=target/repository.xml and asks
> o.a.j.core.RepositoryFactoryImpl to get or create a repository with
> key=null. Unfortunately, the transient repository registered above is
> still in the map and therefore this test inadvertently uses the wrong
> repository, which will create those file system entries.
>
> This can be reproduced by creating a read-only file "repository", and
> running the two tests in sequence. I then get failures with stack
> trace:
>
> javax.jcr.RepositoryException: Invalid repository configuration file:
> repository.xml
>        at o.a.j.core.TransientRepository$2.getRepository(TransientRepository.java:230)
>        ...
> Caused by: o.a.j.ConfigurationException: Repository directory
> repository does not exist
>        at o.a.j.core.config.RepositoryConfig.create(RepositoryConfig.java:174)
>        ...
>
> I don't know exactly where this should be fixed: use system properties
> in RepositoryFactoryTest as well or provide some clean up in
> RepositoryFactoryImpl's REPOSITORY_INSTANCES map. Marcel, can you (or
> Julian) take a look at this?
>
> Regards
> Dominique
>
>
> On Tue, Jun 30, 2009 at 11:28 PM, Tobias Bocanegra<tr...@day.com> wrote:
>> hi,
>>
>>> For some reason the Hudson build creates an unexpected ./repository
>>> directory (not ./target/repository) that gets flagged by RAT. I'm not
>>> yet sure what causes that, but for now I simply added an extra RAT
>>> exclude rule that should make the Hudson build succeed again.
>>
>> it's not just the hudson build - i have those "repository" and
>> "repository.xml", too.
>> i guess it's one of the tests that does not use the proper repository home.
>>
>> regards, toby
>>
>

Re: Build failed in Hudson: Jackrabbit-trunk » Jackrabbit Core #636

Posted by Marcel Reutegger <ma...@gmx.net>.
Hi,

I'll have a look.

regards
 marcel

On Thu, Jul 9, 2009 at 12:25, Dominique
Pfister<do...@day.com> wrote:
> Hi,
>
> I was able to find out how those "repository" and "repository.xml" are
> created; it is actually a combination of tests:
>
> o.a.j.test.api.RepositoryFactoryTest#testDefaultRepository:
> instantiates a TransientRepository with home=null/config=null and
> o.a.j.core.RepositoryFactoryImpl registers this repository in its
> static REPOSITORY_INSTANCES map, with key=null.
>
> o.a.j.core.integration.RepositoryFactoryImplTest#testDefaultRepository:
> sets system properties with
> home=target/repository/config=target/repository.xml and asks
> o.a.j.core.RepositoryFactoryImpl to get or create a repository with
> key=null. Unfortunately, the transient repository registered above is
> still in the map and therefore this test inadvertently uses the wrong
> repository, which will create those file system entries.
>
> This can be reproduced by creating a read-only file "repository", and
> running the two tests in sequence. I then get failures with stack
> trace:
>
> javax.jcr.RepositoryException: Invalid repository configuration file:
> repository.xml
>        at o.a.j.core.TransientRepository$2.getRepository(TransientRepository.java:230)
>        ...
> Caused by: o.a.j.ConfigurationException: Repository directory
> repository does not exist
>        at o.a.j.core.config.RepositoryConfig.create(RepositoryConfig.java:174)
>        ...
>
> I don't know exactly where this should be fixed: use system properties
> in RepositoryFactoryTest as well or provide some clean up in
> RepositoryFactoryImpl's REPOSITORY_INSTANCES map. Marcel, can you (or
> Julian) take a look at this?
>
> Regards
> Dominique
>
>
> On Tue, Jun 30, 2009 at 11:28 PM, Tobias Bocanegra<tr...@day.com> wrote:
>> hi,
>>
>>> For some reason the Hudson build creates an unexpected ./repository
>>> directory (not ./target/repository) that gets flagged by RAT. I'm not
>>> yet sure what causes that, but for now I simply added an extra RAT
>>> exclude rule that should make the Hudson build succeed again.
>>
>> it's not just the hudson build - i have those "repository" and
>> "repository.xml", too.
>> i guess it's one of the tests that does not use the proper repository home.
>>
>> regards, toby
>>
>