jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denis Trebulyov <dendroi...@gmail.com>
Subject Re: How to use MySQL persistence manager with Jackrabbit standalone
Date Fri, 01 Mar 2013 15:58:46 GMT
Seems that main moment is:
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

Please check mysql-connector-java-*.jar in the classpath.

2013/3/1 Lars Janssen <lars@fazy.net>

> Hi Denis,
>
> Thanks, just given that a try. It looks like I get a similar error, log
> below.
>
> I'm not sure what it means by "Cannot instantiate persistence manager" - is
> there something I should do to install/configure the persistence managers?
> I must admit I've pretty much "taken it out of the box and switched it on"
> :)
>
> Error log follows...
>
>
> 2013-03-01 15:48:05.794 INFO  [main] RepositoryImpl.java:256
> Starting repository...
> 2013-03-01 15:48:05.796 INFO  [main] LocalFileSystem.java:164
>  LocalFileSystem initialized at path jackrabbit/repository
> 2013-03-01 15:48:05.876 INFO  [main] NodeTypeRegistry.java:870         no
> custom node type definitions found
> 2013-03-01 15:48:05.894 INFO  [main] LocalFileSystem.java:164
>  LocalFileSystem initialized at path jackrabbit/version
> 2013-03-01 15:48:05.906 WARN  [main] SimpleBeanFactory.java:38
> org.apache.jackrabbit.core.persistence.db.SimpleDbPersistenceManager has
> been deprecated
> 2013-03-01 15:48:05.912 ERROR [main] RepositoryImpl.java:366
> failed to start Repository: Cannot instantiate persistence manager
> org.apache.jackrabbit.core.persistence.db.SimpleDbPersistenceManager
> javax.jcr.RepositoryException: Cannot instantiate persistence manager
> org.apache.jackrabbit.core.persistence.db.SimpleDbPersistenceManager
>         at
>
> org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1353)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.apache.jackrabbit.core.RepositoryImpl.createVersionManager(RepositoryImpl.java:486)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:311)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:589)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.apache.jackrabbit.core.RepositoryContext.create(RepositoryContext.java:149)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.apache.jackrabbit.servlet.jackrabbit.JackrabbitRepositoryServlet.init(JackrabbitRepositoryServlet.java:109)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at javax.servlet.GenericServlet.init(GenericServlet.java:241)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at org.mortbay.jetty.Server.doStart(Server.java:224)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at org.apache.jackrabbit.standalone.Main.run(Main.java:173)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at org.apache.jackrabbit.standalone.Main.main(Main.java:60)
> [jackrabbit-standalone-2.6.0.jar:na]
> Caused by: javax.jcr.RepositoryException: Could not load JDBC driver class
> com.mysql.jdbc.Driver
>         at
>
> org.apache.jackrabbit.core.util.db.ConnectionFactory.getDriverClass(ConnectionFactory.java:265)
> ~[jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.apache.jackrabbit.core.util.db.ConnectionFactory.createDataSource(ConnectionFactory.java:233)
> ~[jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.apache.jackrabbit.core.util.db.ConnectionFactory.getDataSource(ConnectionFactory.java:169)
> ~[jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.apache.jackrabbit.core.persistence.db.SimpleDbPersistenceManager.getConnection(SimpleDbPersistenceManager.java:198)
> ~[jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager.initConnection(DatabasePersistenceManager.java:779)
> ~[jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager.init(DatabasePersistenceManager.java:219)
> ~[jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1349)
> [jackrabbit-standalone-2.6.0.jar:na]
>         ... 23 common frames omitted
> Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
> ~[na:1.6.0_24]
>         at java.security.AccessController.doPrivileged(Native Method)
> ~[na:1.6.0_24]
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
> ~[na:1.6.0_24]
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
> ~[na:1.6.0_24]
>         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
> ~[na:1.6.0_24]
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
> ~[na:1.6.0_24]
>         at java.lang.Class.forName0(Native Method) ~[na:1.6.0_24]
>         at java.lang.Class.forName(Class.java:186) ~[na:1.6.0_24]
>         at
>
> org.apache.jackrabbit.core.util.db.ConnectionFactory.getDriverClass(ConnectionFactory.java:260)
> ~[jackrabbit-standalone-2.6.0.jar:na]
>         ... 29 common frames omitted
> 2013-03-01 15:48:05.912 INFO  [main] RepositoryImpl.java:1060
>  Shutting down repository...
> 2013-03-01 15:48:05.914 INFO  [main] RepositoryImpl.java:1165
>  Repository has been shutdown
> 2013-03-01 15:48:05.915 WARN  [main] Slf4jLog.java:89
>  unavailable
> javax.jcr.RepositoryException: Cannot instantiate persistence manager
> org.apache.jackrabbit.core.persistence.db.SimpleDbPersistenceManager
>         at
>
> org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1353)
> ~[jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.apache.jackrabbit.core.RepositoryImpl.createVersionManager(RepositoryImpl.java:486)
> ~[jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:311)
> ~[jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:589)
> ~[jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.apache.jackrabbit.core.RepositoryContext.create(RepositoryContext.java:149)
> ~[jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.apache.jackrabbit.servlet.jackrabbit.JackrabbitRepositoryServlet.init(JackrabbitRepositoryServlet.java:109)
> ~[jackrabbit-standalone-2.6.0.jar:na]
>         at javax.servlet.GenericServlet.init(GenericServlet.java:241)
> ~[jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at org.mortbay.jetty.Server.doStart(Server.java:224)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at org.apache.jackrabbit.standalone.Main.run(Main.java:173)
> [jackrabbit-standalone-2.6.0.jar:na]
>         at org.apache.jackrabbit.standalone.Main.main(Main.java:60)
> [jackrabbit-standalone-2.6.0.jar:na]
> Caused by: javax.jcr.RepositoryException: Could not load JDBC driver class
> com.mysql.jdbc.Driver
>         at
>
> org.apache.jackrabbit.core.util.db.ConnectionFactory.getDriverClass(ConnectionFactory.java:265)
> ~[jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.apache.jackrabbit.core.util.db.ConnectionFactory.createDataSource(ConnectionFactory.java:233)
> ~[jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.apache.jackrabbit.core.util.db.ConnectionFactory.getDataSource(ConnectionFactory.java:169)
> ~[jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.apache.jackrabbit.core.persistence.db.SimpleDbPersistenceManager.getConnection(SimpleDbPersistenceManager.java:198)
> ~[jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager.initConnection(DatabasePersistenceManager.java:779)
> ~[jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager.init(DatabasePersistenceManager.java:219)
> ~[jackrabbit-standalone-2.6.0.jar:na]
>         at
>
> org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1349)
> ~[jackrabbit-standalone-2.6.0.jar:na]
>         ... 23 common frames omitted
> Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
> ~[na:1.6.0_24]
>         at java.security.AccessController.doPrivileged(Native Method)
> ~[na:1.6.0_24]
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
> ~[na:1.6.0_24]
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
> ~[na:1.6.0_24]
>         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
> ~[na:1.6.0_24]
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
> ~[na:1.6.0_24]
>         at java.lang.Class.forName0(Native Method) ~[na:1.6.0_24]
>         at java.lang.Class.forName(Class.java:186) ~[na:1.6.0_24]
>         at
>
> org.apache.jackrabbit.core.util.db.ConnectionFactory.getDriverClass(ConnectionFactory.java:260)
> ~[jackrabbit-standalone-2.6.0.jar:na]
>         ... 29 common frames omitted
> 2013-03-01 15:48:05.916 INFO  [main] RepositoryAccessServlet.java:98
> RepositoryAccessServlet initialized.
> 2013-03-01 15:48:05.922 INFO  [main] AbstractWebdavServlet.java:169
>  authenticate-header = Basic realm="Jackrabbit Webdav Server"
> 2013-03-01 15:48:05.923 INFO  [main] AbstractWebdavServlet.java:174
>  csrf-protection = null
> 2013-03-01 15:48:05.923 INFO  [main] AbstractWebdavServlet.java:181
>  createAbsoluteURI = true
> 2013-03-01 15:48:05.923 INFO  [main] SimpleWebdavServlet.java:144
>  resource-path-prefix = '/repository'
> 2013-03-01 15:48:06.038 INFO  [main] AbstractWebdavServlet.java:169
>  authenticate-header = Basic realm="Jackrabbit Webdav Server"
> 2013-03-01 15:48:06.038 INFO  [main] AbstractWebdavServlet.java:174
>  csrf-protection = null
> 2013-03-01 15:48:06.038 INFO  [main] AbstractWebdavServlet.java:181
>  createAbsoluteURI = true
>
>
> Best regards,
>
> Lars.
>
>
>
> On Fri, Mar 1, 2013 at 3:34 PM, Denis Trebulyov <dendroidua@gmail.com
> >wrote:
>
> > Hi, Lars,
> > As variant - try to use
> > org.apache.jackrabbit.core.persistence.db.SimpleDbPersistenceManager
> > instead of
> > org.apache.jackrabbit.core.persistence.pool.MySqlPersistenceManager
> >
> > Like:
> > <PersistenceManager
> >
> >
> class="org.apache.jackrabbit.core.persistence.db.SimpleDbPersistenceManager">
> >            <param name="driver" value="com.mysql.jdbc.Driver" />
> >            <param name="url"
> value="jdbc:mysql://localhost:3306/jackrabbit"
> > />
> >            <param name="user" value="....." />
> >            <param name="password" value="....." />
> >            <param name="schema" value="mysql" />
> >            <param name="schemaObjectPrefix" value="...." />
> >            <param name="externalBLOBs" value="false" />
> > </PersistenceManager>
> >
> > But I am not sure about usage in the latest jcr versions.
> >
> > Regards,
> > Denis
> >
> >
> > 2013/3/1 Lars Janssen <lars-listmail@ukmix.net>
> >
> > > Hi all,
> > >
> > > I've been successfully using Apache Jackrabbit 2.4.3 and now 2.6.0
> > > (standalone server in both cases) using the default configuration, so
> the
> > > repository is stored on the filesystem.
> > >
> > > How can I make it connect to a MySQL back end instead? I don't need to
> > > worry about migration, just set it up as a fresh install.
> > >
> > > After trying the steps below, Jackrabbit fails to start correctly or
> > > populate the DATASTORE table in the database, and I find this error in
> > the
> > > logs:
> > >
> > > ERROR [main] RepositoryImpl.java:366
> > >            failed to start Repository: Cannot instantiate persistence
> > > manager
> > org.apache.jackrabbit.core.persistence.pool.MySqlPersistenceManager
> > >     javax.jcr.RepositoryException: Cannot instantiate persistence
> manager
> > > org.apache.jackrabbit.core.persistence.pool.MySqlPersistenceManager
> > >     [... oodles of backtrace cut ...]
> > > What I've done so far:
> > >
> > > I've created the Jackrabbit database/user, which I can connect to no
> > > problem:
> > >
> > > mysql -D jackrabbit -u jackrabbit -h localhost -pjackrabbit
> > > I started with a clean slate (empty /var/jackrabbit directory), except
> > the
> > > configuration file comes from here:
> > > https://raw.github.com/wiki/jackalope/jackalope/files/repository.xml
> > >
> > > Here's the startup script I'm using:
> > > https://github.com/sixty-nine/Jackrabbit-startup-script
> > >
> > > And here's the java process that runs:
> > >
> > > java -XX:MaxPermSize=128m -Xmx512M -Xms128M
> > -Dcom.sun.management.jmxremote
> > > -Dcom.sun.management.jmxremote.port=1111
> > > -Dcom.sun.management.jmxremote.authenticate=true
> > > -Dcom.sun.management.jmxremote.ssl=false
> > >
> > >
> >
> -Dcom.sun.management.jmxremote.password.file=/opt/jackrabbit/startup/jmx.user
> > >
> >
> -Dcom.sun.management.jmxremote.access.file=/opt/jackrabbit/startup/jmx.role
> > > -jar /opt/jackrabbit/jackrabbit-standalone-2.6.0.jar -h 127.0.0.1 -p
> 8080
> > > I don't think I get far enough for it to matter, but I'm using MySQL
> > > 5.5.28-1.
> > >
> > > I'm having the above problem with both 2.4.3 and 2.6.0.
> > >
> > > Also:
> > >
> > > java version "1.6.0_24"
> > > OpenJDK Runtime Environment (IcedTea6 1.11.5) (6b24-1.11.5-1)
> > > OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
> > > Plus I subsequently installed the MySQL JDBC library on Debian:
> > >
> > > apt-get install libmysql-java
> > >
> > > Thanks,
> > >
> > > Lars.
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message