You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Tony Giaccone <tg...@masslight.net> on 2010/06/25 18:28:03 UTC

Slightly out of the norm... (perhaps)


I've been working with sling, which has an embedded version of Jackrabbit.  If you check out the sling code, the repository by default uses DERBY as it's Persistence manager.

I'd like to swap out Derby for a more traditional database. I'd like to use Oracle. However, I'm working with a client where I have to VPN in  to get to the clients DB and that makes using it more complicated. So as a first step because I can easily run Postgres on my lap top. I worked on swapping out Postgres for Derby and after a bit of work was able to successfully do so. 

However, the client actually uses Oracle, and I need to be able to use Jackrabbit with Oracle as the persistence manager. I assumed that once I understood how to get one JDBC based data source working a second would be relatively easy. However, I seem to have hit a roadblock and I'm not sure why. This doesn't feel like a JDBC driver issue, but I'm not sure where the problem is. 

To get Oracle working,  I've added the oracle drivers to the build and changed the repository.xml file to indicate the appropriate information for the oracle configuration. 

This is the stanza of XML Im using to configure the Persistence manager. 

        <PersistenceManager class="org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager">
            <param name="url" value="jdbc:oracle:thin:@oraclehost.mycompany.com:1521:MyDev" />
            <param name="user" value="document_manager"/>
            <param name="password" value="document_manager"/>
            <param name="schemaObjectPrefix" value="jcr${wsp.name}_"/>
            <param name="tableSpace" value="" />
            <param name="externalBLOBs" value="false"/>
        </PersistenceManager>


The error I'm getting at start up is:

in /usr/local/glassfish/domains/domain1/config/sling/_sling/jackrabbit (org.apache.jackrabbit.core.config.ConfigurationException: Replacement not found for ${wsp.name}.) org.apache.jackrabbit.core.config.ConfigurationException: Replacement not found for ${wsp.name}.


I dont' understand why there should be a problem with wsp.name. Is there something I'm missing?


Tony Giaccone


Re: Slightly out of the norm... (perhaps)

Posted by Justin Edelson <ju...@gmail.com>.
Pretty sure something exactly like this was posted within the past
weeks, but I forgot what the resolution was. Search the archives for
that ClassCastException and if you don't find anything, create a new thread.

Justin

On 6/28/10 5:07 PM, Tony Giaccone wrote:
> Ok, 
> 
> So one step forward I can now talk to the DB and create tables. However, I'm still getting an error when Jackrabbit tries to create initialize the repository..
> 
> I was going to include the DDL for the tables, but it's fairly complicated.
> 
> the following tables have been created:
> 
> PUBLICBINVAL
> PUBLICNODE
> PUBLICPROP
> PUBLICREFS
> 
> However, when the app tries to initialize the database, and write out the root nodes, I get these error messages...
> 
> 
> 
> 28.06.2010 16:42:00.588 *INFO* [SCR Component Actor] org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager Database: Oracle / Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
> With the Partitioning, OLAP, Data Mining and Real Application Testing options
> 28.06.2010 16:42:00.588 *INFO* [SCR Component Actor] org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager Driver: Oracle JDBC driver / 11.1.0.7.0-Production
> 28.06.2010 16:42:01.047 *ERROR* [SCR Component Actor] org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager failed to write node state: deadbeef-face-babe-cafe-babecafebabe java.lang.reflect.InvocationTargetException
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 
> with this a bit further down..
> 
> 
> Caused by: java.lang.ClassCastException: org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper cannot be cast to oracle.jdbc.OracleConnection
>         at oracle.sql.BLOB.createTemporary(BLOB.java:530)
>         ... 32 more
> 
> and this:
> 
> 28.06.2010 16:42:01.055 *ERROR* [SCR Component Actor] org.apache.jackrabbit.core.RepositoryImpl failed to start Repository: org.apache.jackrabbit.core.state.ItemStateException: failed to write node state: deadbeef-face-babe-cafe-babecafebabe javax.jcr.RepositoryException: org.apache.jackrabbit.core.state.ItemStateException: failed to write node state: deadbeef-face-babe-cafe-babecafebabe
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl.<init>(InternalVersionManagerImpl.java:257)
> 
> followed by:
> 
> 
> Caused by: java.lang.ClassCastException: org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper cannot be cast to oracle.jdbc.OracleConnection
>         at oracle.sql.BLOB.createTemporary(BLOB.java:530)
> 
> 
> I'm wondering if this is a driver related issue? But I haven't a clue...
> 
> 
> 


Re: Slightly out of the norm... (perhaps)

Posted by Tony Giaccone <tg...@masslight.net>.
Ok, 

So one step forward I can now talk to the DB and create tables. However, I'm still getting an error when Jackrabbit tries to create initialize the repository..

I was going to include the DDL for the tables, but it's fairly complicated.

the following tables have been created:

PUBLICBINVAL
PUBLICNODE
PUBLICPROP
PUBLICREFS

However, when the app tries to initialize the database, and write out the root nodes, I get these error messages...



28.06.2010 16:42:00.588 *INFO* [SCR Component Actor] org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager Database: Oracle / Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
28.06.2010 16:42:00.588 *INFO* [SCR Component Actor] org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager Driver: Oracle JDBC driver / 11.1.0.7.0-Production
28.06.2010 16:42:01.047 *ERROR* [SCR Component Actor] org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager failed to write node state: deadbeef-face-babe-cafe-babecafebabe java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

with this a bit further down..


Caused by: java.lang.ClassCastException: org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper cannot be cast to oracle.jdbc.OracleConnection
        at oracle.sql.BLOB.createTemporary(BLOB.java:530)
        ... 32 more

and this:

28.06.2010 16:42:01.055 *ERROR* [SCR Component Actor] org.apache.jackrabbit.core.RepositoryImpl failed to start Repository: org.apache.jackrabbit.core.state.ItemStateException: failed to write node state: deadbeef-face-babe-cafe-babecafebabe javax.jcr.RepositoryException: org.apache.jackrabbit.core.state.ItemStateException: failed to write node state: deadbeef-face-babe-cafe-babecafebabe
        at org.apache.jackrabbit.core.version.InternalVersionManagerImpl.<init>(InternalVersionManagerImpl.java:257)

followed by:


Caused by: java.lang.ClassCastException: org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper cannot be cast to oracle.jdbc.OracleConnection
        at oracle.sql.BLOB.createTemporary(BLOB.java:530)


I'm wondering if this is a driver related issue? But I haven't a clue...




Re: Slightly out of the norm... (perhaps)

Posted by Justin Edelson <ju...@gmail.com>.
As suspected, you have a reference to ${wsp.name} inside the Versioning
configuration:

>     <Versioning rootPath="${rep.home}/version">
>         <FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
>              <param name="path" value="${rep.home}/version" />
>         </FileSystem>
>
> 	<PersistenceManager
class="org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager">
>   	    <param name="url" value="jdbc:oracle:thin:@localhost:1521:DEV" />
>   	    <param name="user" value="dmuser"/>
>   	    <param name="password" value="dmuser_pw"/>
>   	    <param name="schemaObjectPrefix" value="${wsp.name}_"/>
> 	    <param name="tableSpace" value="" />
>   	    <param name="externalBLOBs" value="false"/>
> 	</PersistenceManager>
>
>     </Versioning>

${wsp.name} can't be used inside the Versioning configuration as
versioning isn't workspace-specific.

Justin

On 6/28/10 2:27 PM, Tony Giaccone wrote:
> 
> On Jun 25, 2010, at 12:32 PM, Justin Edelson wrote:
> 
>> Tony-
>> I should have thought of this before, but is it possible this is the PM
>> configuration inside the Versioning element? I think that would explain
>> the error.
>>
>> If not, you should probably post the *whole* repository.xml file.
>>
>> Justin
> 
> 
> Justin,
> 
> Glad to do it...
> 
> I moved sling.home to a new location  on the file system and this file 
> comes from ${sling.home}/jackrabbit
> 
> 
> I did make two changes to this repository.xml file, for obvious reasons, I 
> changed the host name and I changed the userid and password.  
> I have used that information the jdbc url and the userid and password
> to connect to oracle and I know that they work. 
> 
> 
> I'm open to suggestions.
> 
> Tony
> 
> 
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <!--
>   Licensed to the Apache Software Foundation (ASF) under one
>   or more contributor license agreements.  See the NOTICE file
>   distributed with this work for additional information
>   regarding copyright ownership.  The ASF licenses this file
>   to you under the Apache License, Version 2.0 (the
>   "License"); you may not use this file except in compliance
>   with the License.  You may obtain a copy of the License at
> 
>    http://www.apache.org/licenses/LICENSE-2.0
> 
>   Unless required by applicable law or agreed to in writing,
>   software distributed under the License is distributed on an
>   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>   KIND, either express or implied.  See the License for the
>   specific language governing permissions and limitations
>   under the License.
> -->
> <!DOCTYPE Repository
>           PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 2.0//EN"
>           "http://jackrabbit.apache.org/dtd/repository-2.0.dtd">
> 
> <Repository>
>     <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
>         <param name="path" value="${rep.home}/repository"/>    
>     </FileSystem>
> 
>     <DataStore class="org.apache.jackrabbit.core.data.FileDataStore"/>
> 
>     <Security appName="Jackrabbit">
>         <SecurityManager class="org.apache.jackrabbit.core.DefaultSecurityManager" workspaceName="security">
>         </SecurityManager>
> 
>         <AccessManager class="org.apache.sling.jcr.jackrabbit.server.impl.security.PluggableDefaultAccessManager">
>         </AccessManager>
> 
>         <LoginModule class="org.apache.sling.jcr.jackrabbit.server.impl.security.PluggableDefaultLoginModule">
>             <param name="anonymousId" value="anonymous"/>
>             <param name="adminId" value="admin"/>
>         </LoginModule>
>     </Security>
> 
>     <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/>
> 
>     <Workspace name="${wsp.name}">
>         <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
>             <param name="path" value="${wsp.home}"/> 
>         </FileSystem>
> 	<PersistenceManager class="org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager">
>   	    <param name="url" value="jdbc:oracle:thin:@localhost:1521:DEV" />
>   	    <param name="user" value="dmuser"/>
>   	    <param name="password" value="dmuser_pw"/>
>   	    <param name="schemaObjectPrefix" value="${wsp.name}_"/>
> 	    <param name="tableSpace" value="" />
>   	    <param name="externalBLOBs" value="false"/>
> 	</PersistenceManager>
> 
>         <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
>             <param name="path" value="${wsp.home}/index"/>
>             <param name="supportHighlighting" value="true"/>
>         </SearchIndex>
>     </Workspace>
> 
>     <Versioning rootPath="${rep.home}/version">
>         <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
>              <param name="path" value="${rep.home}/version" />
>         </FileSystem>
> 
> 	<PersistenceManager class="org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager">
>   	    <param name="url" value="jdbc:oracle:thin:@localhost:1521:DEV" />
>   	    <param name="user" value="dmuser"/>
>   	    <param name="password" value="dmuser_pw"/>
>   	    <param name="schemaObjectPrefix" value="${wsp.name}_"/>
> 	    <param name="tableSpace" value="" />
>   	    <param name="externalBLOBs" value="false"/>
> 	</PersistenceManager>
> 
>     </Versioning>
> 
>     <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
>         <param name="path" value="${rep.home}/repository/index"/>
>         <param name="supportHighlighting" value="true"/>
>     </SearchIndex>
> </Repository>
> 


Re: Slightly out of the norm... (perhaps)

Posted by Tony Giaccone <tg...@masslight.net>.
On Jun 25, 2010, at 12:32 PM, Justin Edelson wrote:

> Tony-
> I should have thought of this before, but is it possible this is the PM
> configuration inside the Versioning element? I think that would explain
> the error.
> 
> If not, you should probably post the *whole* repository.xml file.
> 
> Justin


Justin,

Glad to do it...

I moved sling.home to a new location  on the file system and this file 
comes from ${sling.home}/jackrabbit


I did make two changes to this repository.xml file, for obvious reasons, I 
changed the host name and I changed the userid and password.  
I have used that information the jdbc url and the userid and password
to connect to oracle and I know that they work. 


I'm open to suggestions.

Tony



<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
-->
<!DOCTYPE Repository
          PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 2.0//EN"
          "http://jackrabbit.apache.org/dtd/repository-2.0.dtd">

<Repository>
    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
        <param name="path" value="${rep.home}/repository"/>    
    </FileSystem>

    <DataStore class="org.apache.jackrabbit.core.data.FileDataStore"/>

    <Security appName="Jackrabbit">
        <SecurityManager class="org.apache.jackrabbit.core.DefaultSecurityManager" workspaceName="security">
        </SecurityManager>

        <AccessManager class="org.apache.sling.jcr.jackrabbit.server.impl.security.PluggableDefaultAccessManager">
        </AccessManager>

        <LoginModule class="org.apache.sling.jcr.jackrabbit.server.impl.security.PluggableDefaultLoginModule">
            <param name="anonymousId" value="anonymous"/>
            <param name="adminId" value="admin"/>
        </LoginModule>
    </Security>

    <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/>

    <Workspace name="${wsp.name}">
        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${wsp.home}"/> 
        </FileSystem>
	<PersistenceManager class="org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager">
  	    <param name="url" value="jdbc:oracle:thin:@localhost:1521:DEV" />
  	    <param name="user" value="dmuser"/>
  	    <param name="password" value="dmuser_pw"/>
  	    <param name="schemaObjectPrefix" value="${wsp.name}_"/>
	    <param name="tableSpace" value="" />
  	    <param name="externalBLOBs" value="false"/>
	</PersistenceManager>

        <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            <param name="path" value="${wsp.home}/index"/>
            <param name="supportHighlighting" value="true"/>
        </SearchIndex>
    </Workspace>

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

	<PersistenceManager class="org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager">
  	    <param name="url" value="jdbc:oracle:thin:@localhost:1521:DEV" />
  	    <param name="user" value="dmuser"/>
  	    <param name="password" value="dmuser_pw"/>
  	    <param name="schemaObjectPrefix" value="${wsp.name}_"/>
	    <param name="tableSpace" value="" />
  	    <param name="externalBLOBs" value="false"/>
	</PersistenceManager>

    </Versioning>

    <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
        <param name="path" value="${rep.home}/repository/index"/>
        <param name="supportHighlighting" value="true"/>
    </SearchIndex>
</Repository>


RE: [english 100%] Re: Slightly out of the norm... (perhaps)

Posted by Wouter Boers <wo...@ikke.net>.
Hi Tony,

Perhaps to make the migration easier you could use the datasource
configuration. I've been using this one for a while now:
    <Workspace name="${wsp.name}">
        <FileSystem
class="org.apache.jackrabbit.core.fs.db.OracleFileSystem">
            <param name="driver" value="javax.naming.InitialContext"/>
            <param name="url" value="jdbc/JcrDS"/>
            <param name="schemaObjectPrefix" value="jcr_ws_fs_" />
            <param name="schema" value="oracle_fs" />
        </FileSystem>
        <PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.OraclePersistenceManage
r">
            <param name="externalBLOBs" value="false" />
            <param name="bundleCacheSize" value="8" />
            <param name="consistencyCheck" value="false" />
            <param name="minBlobSize" value="16384" />
            <param name="driver" value="javax.naming.InitialContext"/>
            <param name="url" value="jdbc/JcrDS"/>
            <param name="schema" value="oracle_pm" />
            <param name="schemaObjectPrefix" value="jcr_ws_pm_" />
        </PersistenceManager>
        <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            <param name="path" value="${wsp.home}/index" />
            <param name="supportHighlighting" value="true" />
        </SearchIndex>
    </Workspace>

-----Oorspronkelijk bericht-----
Van: Justin Edelson [mailto:justinedelson@gmail.com] 
Verzonden: vrijdag 25 juni 2010 18:33
Aan: users@jackrabbit.apache.org
Onderwerp: [english 100%] Re: Slightly out of the norm... (perhaps)

Tony-
I should have thought of this before, but is it possible this is the PM
configuration inside the Versioning element? I think that would explain
the error.

If not, you should probably post the *whole* repository.xml file.

Justin

On 6/25/10 12:28 PM, Tony Giaccone wrote:
> 
> 
> I've been working with sling, which has an embedded version of Jackrabbit.
If you check out the sling code, the repository by default uses DERBY as
it's Persistence manager.
> 
> I'd like to swap out Derby for a more traditional database. I'd like to
use Oracle. However, I'm working with a client where I have to VPN in  to
get to the clients DB and that makes using it more complicated. So as a
first step because I can easily run Postgres on my lap top. I worked on
swapping out Postgres for Derby and after a bit of work was able to
successfully do so. 
> 
> However, the client actually uses Oracle, and I need to be able to use
Jackrabbit with Oracle as the persistence manager. I assumed that once I
understood how to get one JDBC based data source working a second would be
relatively easy. However, I seem to have hit a roadblock and I'm not sure
why. This doesn't feel like a JDBC driver issue, but I'm not sure where the
problem is. 
> 
> To get Oracle working,  I've added the oracle drivers to the build and
changed the repository.xml file to indicate the appropriate information for
the oracle configuration. 
> 
> This is the stanza of XML Im using to configure the Persistence manager. 
> 
>         <PersistenceManager
class="org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager">
>             <param name="url"
value="jdbc:oracle:thin:@oraclehost.mycompany.com:1521:MyDev" />
>             <param name="user" value="document_manager"/>
>             <param name="password" value="document_manager"/>
>             <param name="schemaObjectPrefix" value="jcr${wsp.name}_"/>
>             <param name="tableSpace" value="" />
>             <param name="externalBLOBs" value="false"/>
>         </PersistenceManager>
> 
> 
> The error I'm getting at start up is:
> 
> in /usr/local/glassfish/domains/domain1/config/sling/_sling/jackrabbit
(org.apache.jackrabbit.core.config.ConfigurationException: Replacement not
found for ${wsp.name}.)
org.apache.jackrabbit.core.config.ConfigurationException: Replacement not
found for ${wsp.name}.
> 
> 
> I dont' understand why there should be a problem with wsp.name. Is there
something I'm missing?
> 
> 
> Tony Giaccone
> 



Re: Slightly out of the norm... (perhaps)

Posted by Justin Edelson <ju...@gmail.com>.
Tony-
I should have thought of this before, but is it possible this is the PM
configuration inside the Versioning element? I think that would explain
the error.

If not, you should probably post the *whole* repository.xml file.

Justin

On 6/25/10 12:28 PM, Tony Giaccone wrote:
> 
> 
> I've been working with sling, which has an embedded version of Jackrabbit.  If you check out the sling code, the repository by default uses DERBY as it's Persistence manager.
> 
> I'd like to swap out Derby for a more traditional database. I'd like to use Oracle. However, I'm working with a client where I have to VPN in  to get to the clients DB and that makes using it more complicated. So as a first step because I can easily run Postgres on my lap top. I worked on swapping out Postgres for Derby and after a bit of work was able to successfully do so. 
> 
> However, the client actually uses Oracle, and I need to be able to use Jackrabbit with Oracle as the persistence manager. I assumed that once I understood how to get one JDBC based data source working a second would be relatively easy. However, I seem to have hit a roadblock and I'm not sure why. This doesn't feel like a JDBC driver issue, but I'm not sure where the problem is. 
> 
> To get Oracle working,  I've added the oracle drivers to the build and changed the repository.xml file to indicate the appropriate information for the oracle configuration. 
> 
> This is the stanza of XML Im using to configure the Persistence manager. 
> 
>         <PersistenceManager class="org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager">
>             <param name="url" value="jdbc:oracle:thin:@oraclehost.mycompany.com:1521:MyDev" />
>             <param name="user" value="document_manager"/>
>             <param name="password" value="document_manager"/>
>             <param name="schemaObjectPrefix" value="jcr${wsp.name}_"/>
>             <param name="tableSpace" value="" />
>             <param name="externalBLOBs" value="false"/>
>         </PersistenceManager>
> 
> 
> The error I'm getting at start up is:
> 
> in /usr/local/glassfish/domains/domain1/config/sling/_sling/jackrabbit (org.apache.jackrabbit.core.config.ConfigurationException: Replacement not found for ${wsp.name}.) org.apache.jackrabbit.core.config.ConfigurationException: Replacement not found for ${wsp.name}.
> 
> 
> I dont' understand why there should be a problem with wsp.name. Is there something I'm missing?
> 
> 
> Tony Giaccone
> 


Re: Slightly out of the norm... (perhaps)

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

> This is the stanza of XML Im using to configure the Persistence manager.

You probably changed the wrong part of the configuration. Could you
post your complete repository.xml and all workspace.xml files?

Regards,
Thomas