You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "fabrizio giustina (JIRA)" <ji...@apache.org> on 2005/08/27 15:49:04 UTC

[jira] Created: (JCR-201) [contrib-bdb] initialization fails if directory doesn't exist

[contrib-bdb] initialization fails if directory doesn't exist
-------------------------------------------------------------

         Key: JCR-201
         URL: http://issues.apache.org/jira/browse/JCR-201
     Project: Jackrabbit
        Type: Bug
    Versions: 1.0    
 Reporter: fabrizio giustina
    Priority: Minor


BerkeleyDBPersistenceManager initialization fails if the directory configured doesn't exist (this doesn't happen with other PMs).
This can easily be fixed in the persistence manager, by making it create all the directories in the path (actually it only creates the last -db- directory).

The trivial patch is to replace envDir.mkdir() to envDir.mkdirs() (note the final "s") at BerkeleyDBPersistenceManager  line 73:
        if (!envDir.exists())
            envDir.mkdir();
should be:
        if (!envDir.exists())
            envDir.mkdirs();

(I am not submitting any svn diff since the manual fix sounds so trivial, it's easier to change it manually)


-- 
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-201) [contrib-bdb] initialization fails if directory doesn't exist

Posted by "fabrizio giustina (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-201?page=comments#action_12320357 ] 

fabrizio giustina commented on JCR-201:
---------------------------------------

This is the configuration for versioning I was using with ObjectPersistenceManager:

    <Versioning rootPath="${rep.home}/version">
        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${rep.home}/workspaces/version" />
        </FileSystem>
        <PersistenceManager class="org.apache.jackrabbit.core.state.obj.ObjectPersistenceManager" />
    </Versioning>

the "version" directory doesn't exists, but it's created by the PM at startup.
The same configuration, changing only the PM to BerkeleyDBPersistenceManager:
    
    <Versioning rootPath="${rep.home}/version">
        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${rep.home}/workspaces/version" />
        </FileSystem>
        <PersistenceManager class="org.apache.jackrabbit.core.state.bdb.BerkeleyDBPersistenceManager" />
    </Versioning>
    
This time the "version" directory is not created (the PM tries to create a "db" dir inside it and ignores the failure) and bdb throw an exception during initialization



> [contrib-bdb] initialization fails if directory doesn't exist
> -------------------------------------------------------------
>
>          Key: JCR-201
>          URL: http://issues.apache.org/jira/browse/JCR-201
>      Project: Jackrabbit
>         Type: Bug
>     Versions: 1.0
>     Reporter: fabrizio giustina
>     Priority: Minor

>
> BerkeleyDBPersistenceManager initialization fails if the directory configured doesn't exist (this doesn't happen with other PMs).
> This can easily be fixed in the persistence manager, by making it create all the directories in the path (actually it only creates the last -db- directory).
> The trivial patch is to replace envDir.mkdir() to envDir.mkdirs() (note the final "s") at BerkeleyDBPersistenceManager  line 73:
>         if (!envDir.exists())
>             envDir.mkdir();
> should be:
>         if (!envDir.exists())
>             envDir.mkdirs();
> (I am not submitting any svn diff since the manual fix sounds so trivial, it's easier to change it manually)

-- 
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] Assigned: (JCR-201) [contrib-bdb] initialization fails if directory doesn't exist

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

Edgar Poce reassigned JCR-201:
------------------------------

    Assign To: Edgar Poce

> [contrib-bdb] initialization fails if directory doesn't exist
> -------------------------------------------------------------
>
>          Key: JCR-201
>          URL: http://issues.apache.org/jira/browse/JCR-201
>      Project: Jackrabbit
>         Type: Bug
>     Versions: 1.0
>     Reporter: fabrizio giustina
>     Assignee: Edgar Poce
>     Priority: Minor

>
> BerkeleyDBPersistenceManager initialization fails if the directory configured doesn't exist (this doesn't happen with other PMs).
> This can easily be fixed in the persistence manager, by making it create all the directories in the path (actually it only creates the last -db- directory).
> The trivial patch is to replace envDir.mkdir() to envDir.mkdirs() (note the final "s") at BerkeleyDBPersistenceManager  line 73:
>         if (!envDir.exists())
>             envDir.mkdir();
> should be:
>         if (!envDir.exists())
>             envDir.mkdirs();
> (I am not submitting any svn diff since the manual fix sounds so trivial, it's easier to change it manually)

-- 
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-201) [contrib-bdb] initialization fails if directory doesn't exist

Posted by "Edgar Poce (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-201?page=all ]
     
Edgar Poce resolved JCR-201:
----------------------------

    Resolution: Fixed

Fixed as suggested, thanks fabrizio.

> [contrib-bdb] initialization fails if directory doesn't exist
> -------------------------------------------------------------
>
>          Key: JCR-201
>          URL: http://issues.apache.org/jira/browse/JCR-201
>      Project: Jackrabbit
>         Type: Bug
>     Versions: 1.0
>     Reporter: fabrizio giustina
>     Assignee: Edgar Poce
>     Priority: Minor

>
> BerkeleyDBPersistenceManager initialization fails if the directory configured doesn't exist (this doesn't happen with other PMs).
> This can easily be fixed in the persistence manager, by making it create all the directories in the path (actually it only creates the last -db- directory).
> The trivial patch is to replace envDir.mkdir() to envDir.mkdirs() (note the final "s") at BerkeleyDBPersistenceManager  line 73:
>         if (!envDir.exists())
>             envDir.mkdir();
> should be:
>         if (!envDir.exists())
>             envDir.mkdirs();
> (I am not submitting any svn diff since the manual fix sounds so trivial, it's easier to change it manually)

-- 
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] Closed: (JCR-201) [contrib-bdb] initialization fails if directory doesn't exist

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-201?page=all ]
     
Stefan Guggisberg closed JCR-201:
---------------------------------


closing resolved issue

> [contrib-bdb] initialization fails if directory doesn't exist
> -------------------------------------------------------------
>
>          Key: JCR-201
>          URL: http://issues.apache.org/jira/browse/JCR-201
>      Project: Jackrabbit
>         Type: Bug
>     Versions: 1.0
>     Reporter: fabrizio giustina
>     Assignee: Edgar Poce
>     Priority: Minor

>
> BerkeleyDBPersistenceManager initialization fails if the directory configured doesn't exist (this doesn't happen with other PMs).
> This can easily be fixed in the persistence manager, by making it create all the directories in the path (actually it only creates the last -db- directory).
> The trivial patch is to replace envDir.mkdir() to envDir.mkdirs() (note the final "s") at BerkeleyDBPersistenceManager  line 73:
>         if (!envDir.exists())
>             envDir.mkdir();
> should be:
>         if (!envDir.exists())
>             envDir.mkdirs();
> (I am not submitting any svn diff since the manual fix sounds so trivial, it's easier to change it manually)

-- 
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-201) [contrib-bdb] initialization fails if directory doesn't exist

Posted by "Edgar Poce (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-201?page=comments#action_12320338 ] 

Edgar Poce commented on JCR-201:
--------------------------------

> BerkeleyDBPersistenceManager initialization fails if the directory configured 
> doesn't exist (this doesn't happen with other PMs). 

which configured directory? The path to /[repo home]/workspaces is created on repository startup, see RepositoryConfig.init(), and the workspace folder creation is resolved in RepositoryConfig.createWorkspaceConfig().

So, the PM should be able to create a /[repo home]/workspaces/[workspace name]/db folder safely. Am I missing something? Could you provide details about how to reproduce the error?

> [contrib-bdb] initialization fails if directory doesn't exist
> -------------------------------------------------------------
>
>          Key: JCR-201
>          URL: http://issues.apache.org/jira/browse/JCR-201
>      Project: Jackrabbit
>         Type: Bug
>     Versions: 1.0
>     Reporter: fabrizio giustina
>     Priority: Minor

>
> BerkeleyDBPersistenceManager initialization fails if the directory configured doesn't exist (this doesn't happen with other PMs).
> This can easily be fixed in the persistence manager, by making it create all the directories in the path (actually it only creates the last -db- directory).
> The trivial patch is to replace envDir.mkdir() to envDir.mkdirs() (note the final "s") at BerkeleyDBPersistenceManager  line 73:
>         if (!envDir.exists())
>             envDir.mkdir();
> should be:
>         if (!envDir.exists())
>             envDir.mkdirs();
> (I am not submitting any svn diff since the manual fix sounds so trivial, it's easier to change it manually)

-- 
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