Login  Register

Re: Help: Why JCR is using the Apache derby driver???

Posted by Francis ANDRE on Apr 07, 2012; 7:07am
URL: http://ofbiz.116.s1.nabble.com/Help-Why-JCR-is-using-the-Apache-derby-driver-tp4535454p4538982.html

Hi

I finally found the problem which is in the jackrabbit core library. The jcr
core method ConnectionFactory.getDriverClass is using Class.forName instead of
Thread.currentThread().getContextClassLoader. Made an issue as
https://issues.apache.org/jira/browse/JCR-3288

Francis

Le 06/04/2012 07:06, mohit gupta a écrit :

> Hi francis
>
> Please add the  Derby jdbc jar file in ofbiz/framework/entity/lib/jdbc folder.
> don't need entry the Derby jdbc jar to the ofbiz-component.xml.
> But some change in ofbiz/framework/entity/config/entityengine.xml file change
> like jdbc-username and jdbc-password in <datasource name="localderby">
> And again restart the project.
>
> Thanks & Regards
> Mohit Gupta
>
> On Thu, Apr 5, 2012 at 10:33 PM, Francis ANDRE
> <[hidden email] <mailto:[hidden email]>>
> wrote:
>
>     Hi
>
>     Running OFBiz under Eclipse and starting the JCR component leads to an
>     ClassNotFoundException as follow: Why JCR is using the Apache Derby Driver
>     while the ofbiz database is Postgres??? How can I fix this problem?? (I
>     added the Derby jdbc jar to the ofbiz-component.xml but this leads too to
>     the same exception.
>
>     Rgds
>
>
>     Caused by: javax.jcr.RepositoryException: Could not load JDBC driver class
>     org.apache.derby.jdbc.EmbeddedDriver
>        at
>     org.apache.jackrabbit.core.util.db.ConnectionFactory.getDriverClass(ConnectionFactory.java:263)
>        at
>     org.apache.jackrabbit.core.util.db.ConnectionFactory.createDataSource(ConnectionFactory.java:231)
>        at
>     org.apache.jackrabbit.core.util.db.ConnectionFactory.getDataSource(ConnectionFactory.java:167)
>        at
>     org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.getDataSource(BundleDbPersistenceManager.java:575)
>        at
>     org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.init(BundleDbPersistenceManager.java:543)
>        at
>     org.apache.jackrabbit.core.persistence.pool.DerbyPersistenceManager.init(DerbyPersistenceManager.java:250)
>        at
>     org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1342)
>        ... 14 more
>     Caused by: java.lang.ClassNotFoundException:
>     org.apache.derby.jdbc.EmbeddedDriver
>        at java.net.URLClassLoader$1.run(Unknown Source)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at java.net.URLClassLoader.findClass(Unknown Source)
>        at java.lang.ClassLoader.loadClass(Unknown Source)
>        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>        at java.lang.ClassLoader.loadClass(Unknown Source)
>        at java.lang.Class.forName0(Native Method)
>        at java.lang.Class.forName(Unknown Source)
>        at
>     org.apache.jackrabbit.core.util.db.ConnectionFactory.getDriverClass(ConnectionFactory.java:258)
>
>
>
>
>