You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by hsp_ <pi...@ibest.com.br> on 2009/02/09 19:53:53 UTC

Change the PM to DbDataStore.

Hi;
I need to configure the repository in the other way it is working. I will
create a new empty instance.
Nowadays it is working with jackrabbit version 1.4.8, and the repository
configuration is (using by JNDI):
---------------------------
<Repository>
 <FileSystem
class="org.apache.jackrabbit.core.fs.db.JNDIDatabaseFileSystem">
  
  
  
  
 </FileSystem>
 <Security appName="Jackrabbit">
  <AccessManager class="server.seg.Security"></AccessManager>
  <LoginModule
class="org.apache.jackrabbit.core.security.SimpleLoginModule">
   
  </LoginModule>
 </Security>
 <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default" />
  <Workspace name="${wsp.name}">
   <FileSystem
class="org.apache.jackrabbit.core.fs.db.JNDIDatabaseFileSystem">
    
    
     
    
   </FileSystem>
  <PersistenceManager
class="org.apache.jackrabbit.core.persistence.db.JNDIDatabasePersistenceManager">
   
   
    
   
   
  </PersistenceManager>
  <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
... </SearchIndex>
 </Workspace>
 <Versioning rootPath="${rep.home}/version">
  <FileSystem
class="org.apache.jackrabbit.core.fs.db.JNDIDatabaseFileSystem">
   
   
    
   
  </FileSystem>
  <PersistenceManager
class="org.apache.jackrabbit.core.persistence.db.JNDIDatabasePersistenceManager">
   
   
    
   
   
  </PersistenceManager>
 </Versioning>
 <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
  
 </SearchIndex>
</Repository>
---------------------------
I did changes in this file, to use the DbDataStore, but whitout sucess,
follow the file:
=====================
<Repository>
 <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
  
  
  
  
 </FileSystem>
 <Security appName="Jackrabbit">
  <AccessManager class="server.seg.Security"></AccessManager>
  <LoginModule
class="org.apache.jackrabbit.core.security.SimpleLoginModule">
   
  </LoginModule>
 </Security>
 <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default" />
  <Workspace name="${wsp.name}">
   <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
    
    
     
    
   </FileSystem>
   <PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.PostgreSQLPersistenceManager">
    
    
     
    
   </PersistenceManager>
   <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
... </SearchIndex>
  </Workspace>
  <Versioning rootPath="${rep.home}/version">
   <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
    
    
     
    
   </FileSystem>
   <PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.PostgreSQLPersistenceManager">
    
    
     
    
   </PersistenceManager>
  </Versioning>
  <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
   
   
   
  </SearchIndex>     
  <DataStore class="org.apache.jackrabbit.core.data.db.DbDataStore">
   
   
   
  </DataStore>
</Repository>
=====================
This way I am getting the error in jboss 4.0.5:
2009-02-09 16:51:59,709 INFO  [org.apache.jackrabbit.core.RepositoryImpl]
Starting repository...
2009-02-09 16:51:59,732 ERROR
[org.apache.jackrabbit.core.fs.db.DbFileSystem] failed to initialize file
system
java.sql.SQLException: No suitable driver found for java:jdbc/DesenvDS
	at java.sql.DriverManager.getConnection(DriverManager.java:602)
	at java.sql.DriverManager.getConnection(DriverManager.java:185)
	at
org.apache.jackrabbit.core.fs.db.DbFileSystem.getConnection(DbFileSystem.java:187)
	at
org.apache.jackrabbit.core.fs.db.DatabaseFileSystem.initConnection(DatabaseFileSystem.java:956)
	at
org.apache.jackrabbit.core.fs.db.DatabaseFileSystem.init(DatabaseFileSystem.java:175)
	at
org.apache.jackrabbit.core.config.FileSystemConfig.createFileSystem(FileSystemConfig.java:47)
	at
org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:244)
	at
org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:557)
        ....
My intention is to prepare the configuration to migrate the actual
repository in the new PM format because the deprecated PM I am using.
Have I doing something wrong, or it will not working with JNDI? I have
followed the instructions in the wiki.
Regards
Helio.
-- 
View this message in context: http://www.nabble.com/Change-the-PM-to-DbDataStore.-tp21919003p21919003.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Change the PM to DbDataStore.

Posted by hsp_ <pi...@ibest.com.br>.
I did the build, it worked with jndi in the version 1.4.8.
At least in my tests it is ok, I will do some more...
Thanks ;-)

Thomas Müller-2 wrote:
> 
> Hi,
> 
> So, the solution is rebuild my own jackrabbit 1.4.8 with the classes
> afected
>> patched in version 1.5, while I don't be able to upgrade to 1.5, this way
>> all configurations will manage connection by JNDI, right?
> 
> 
> This might work, but I'm not sure.
> 
> Regards,
> Thomas
> 
> 

-- 
View this message in context: http://www.nabble.com/Change-the-PM-to-DbDataStore.-tp21919003p21983841.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Change the PM to DbDataStore.

Posted by Thomas Müller <th...@day.com>.
Hi,

So, the solution is rebuild my own jackrabbit 1.4.8 with the classes afected
> patched in version 1.5, while I don't be able to upgrade to 1.5, this way
> all configurations will manage connection by JNDI, right?


This might work, but I'm not sure.

Regards,
Thomas

Re: Change the PM to DbDataStore.

Posted by hsp_ <pi...@ibest.com.br>.
So, the solution is rebuild my own jackrabbit 1.4.8 with the classes afected
patched in version 1.5, while I don't be able to upgrade to 1.5, this way
all configurations will manage connection by JNDI, right?
Thanks Thomas and Alexander.



Thomas Müller-2 wrote:
> 
> Hi,
> 
> And about other blocks "FileSystem" and the last "DataStore", I saw in [1]
>> that you mentioned, the configuration for JNDI is possible by:
>> "JNDI can be used to get the connection. In this case, use the
>> javax.naming.InitialContext as the driver, and the JNDI name as the URL.
>> If
>> the user and password are configured in the JNDI resource, they should
>> not
>> be configured here. Example JNDI settings:
>>
>>  < param name="driver" value="javax.naming.InitialContext" />
>>  < param name="url" value="java:comp/env/jdbc/Test" />
>>  "
>> So, it was what I did in the blocks, are they right?
> 
> 
> This is not supported yet in Jackrabbit 1.4.x. See
> See https://issues.apache.org/jira/browse/JCR-1309
> and
> http://jackrabbit.apache.org/api/1.4/org/apache/jackrabbit/core/fs/db/DbFileSystem.html
> 
> Regards,
> Thomas
> 
> 

-- 
View this message in context: http://www.nabble.com/Change-the-PM-to-DbDataStore.-tp21919003p21935661.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Change the PM to DbDataStore.

Posted by Thomas Müller <th...@day.com>.
Hi,

And about other blocks "FileSystem" and the last "DataStore", I saw in [1]
> that you mentioned, the configuration for JNDI is possible by:
> "JNDI can be used to get the connection. In this case, use the
> javax.naming.InitialContext as the driver, and the JNDI name as the URL. If
> the user and password are configured in the JNDI resource, they should not
> be configured here. Example JNDI settings:
>
>  < param name="driver" value="javax.naming.InitialContext" />
>  < param name="url" value="java:comp/env/jdbc/Test" />
>  "
> So, it was what I did in the blocks, are they right?


This is not supported yet in Jackrabbit 1.4.x. See
See https://issues.apache.org/jira/browse/JCR-1309
and
http://jackrabbit.apache.org/api/1.4/org/apache/jackrabbit/core/fs/db/DbFileSystem.html

Regards,
Thomas

Re: Change the PM to DbDataStore.

Posted by Alexander Klimetschek <ak...@day.com>.
On Tue, Feb 10, 2009 at 2:56 PM, hsp_ <pi...@ibest.com.br> wrote:
>
> Alexander, thanks by help;
>
> That means the way I configured the repository.xml is correct (?!), but the
> params, specifically in the "PersistenceManager" block must all have the
> configurations informed:
>    *  < param name="bundleCacheSize" value="8"/>
>    * < param name="consistencyCheck" value="false"/>
>    * < param name="minBlobSize" value="16384"/>
>    * < param name="driver" value="org.postgresql.Driver"/>
>    * < param name="url" value=""/>
>    * < param name="user" value=""/>
>    * < param name="password" value=""/>
>    * < param name="schema" value="postgresql"/>
>    * < param name="schemaObjectPrefix" value=""/>
>    * < param name="errorHandling" value=""/>
>
> So, this way, I presume that JNDI won't work anymore (like before I was
> using) and must be present directly in the repository.xml, am I right?
> And about other blocks "FileSystem" and the last "DataStore", I saw in [1]
> that you mentioned, the configuration for JNDI is possible by:
> "JNDI can be used to get the connection. In this case, use the
> javax.naming.InitialContext as the driver, and the JNDI name as the URL. If
> the user and password are configured in the JNDI resource, they should not
> be configured here. Example JNDI settings:
>
>  < param name="driver" value="javax.naming.InitialContext" />
>  < param name="url" value="java:comp/env/jdbc/Test" />
>  "
> So, it was what I did in the blocks, are they right?

If you previously used the JNDI PM, you would have to look at the
definition of that JNDI resource in your servlet container or app
server. There you should find the JDBC configuration (driver, url,
user + password) that you should now put directly into the
FileSystem/PersistenceManager configuration.

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Re: Change the PM to DbDataStore.

Posted by hsp_ <pi...@ibest.com.br>.
Alexander, thanks by help;

That means the way I configured the repository.xml is correct (?!), but the
params, specifically in the "PersistenceManager" block must all have the
configurations informed:
    *  < param name="bundleCacheSize" value="8"/>
    * < param name="consistencyCheck" value="false"/>
    * < param name="minBlobSize" value="16384"/>
    * < param name="driver" value="org.postgresql.Driver"/>
    * < param name="url" value=""/>
    * < param name="user" value=""/>
    * < param name="password" value=""/>
    * < param name="schema" value="postgresql"/>
    * < param name="schemaObjectPrefix" value=""/>
    * < param name="errorHandling" value=""/> 

So, this way, I presume that JNDI won't work anymore (like before I was
using) and must be present directly in the repository.xml, am I right?
And about other blocks "FileSystem" and the last "DataStore", I saw in [1]
that you mentioned, the configuration for JNDI is possible by:
"JNDI can be used to get the connection. In this case, use the
javax.naming.InitialContext as the driver, and the JNDI name as the URL. If
the user and password are configured in the JNDI resource, they should not
be configured here. Example JNDI settings:

 < param name="driver" value="javax.naming.InitialContext" />
 < param name="url" value="java:comp/env/jdbc/Test" />
 "
So, it was what I did in the blocks, are they right?

Thanks in advanced for your help.
Helio.



Alexander Klimetschek wrote:
> 
> On Mon, Feb 9, 2009 at 7:53 PM, hsp_ <pi...@ibest.com.br> wrote:
>> 2009-02-09 16:51:59,732 ERROR
>> [org.apache.jackrabbit.core.fs.db.DbFileSystem] failed to initialize file
>> system
>> java.sql.SQLException: No suitable driver found for java:jdbc/DesenvDS
> 
> This means you need to configure the jdbc url and the driver for your
> DbFileSystem (see [1] for a description).
> 
> And please note: if you change the persistence manager, Jackrabbit
> won't migrate automatically. It will only use the persistence manager
> configured in the workspace.xml and access whatever is configured, eg.
> a certain database and certain tables within. However, if you only
> change from using JNDI to direct database persistence managers, you
> just have to get the jdbc config right.
> 
> 
> [1]
> http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/core/fs/db/DbFileSystem.html
> [2]
> http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/core/persistence/bundle/PostgreSQLPersistenceManager.html
> 
> Regards,
> Alex
> 
> -- 
> Alexander Klimetschek
> alexander.klimetschek@day.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Change-the-PM-to-DbDataStore.-tp21919003p21934108.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Change the PM to DbDataStore.

Posted by Alexander Klimetschek <ak...@day.com>.
On Mon, Feb 9, 2009 at 7:53 PM, hsp_ <pi...@ibest.com.br> wrote:
> 2009-02-09 16:51:59,732 ERROR
> [org.apache.jackrabbit.core.fs.db.DbFileSystem] failed to initialize file
> system
> java.sql.SQLException: No suitable driver found for java:jdbc/DesenvDS

This means you need to configure the jdbc url and the driver for your
DbFileSystem (see [1] for a description).

And please note: if you change the persistence manager, Jackrabbit
won't migrate automatically. It will only use the persistence manager
configured in the workspace.xml and access whatever is configured, eg.
a certain database and certain tables within. However, if you only
change from using JNDI to direct database persistence managers, you
just have to get the jdbc config right.


[1] http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/core/fs/db/DbFileSystem.html
[2] http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/core/persistence/bundle/PostgreSQLPersistenceManager.html

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com