• Setup OpenKM with MySQL

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #8024  by alimalik
 
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>

<datasources>
<!-- OpenKM User Activity -->
<local-tx-datasource>
<jndi-name>DefaultDS</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/DefaultDS?createDatabaseIfNotExist=true</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
<password></password>
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<track-statements/>
<!--<security-domain>HsqlDbRealm</security-domain>-->
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</local-tx-datasource>

</datasources>
I just modify the openkm-ds.xml as show above in the code:

The database is cretaed: but i got the following errors when running (run.sh) as show below:
Code: Select all
org.jboss.mq.SpyJMSException: Could not resolve uncommited transactions.  Message recovery may not be accurate; - nested throwable: (com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Every derived table must have its own alias)
        at org.jboss.mq.pm.jdbc2.PersistenceManager.resolveAllUncommitedTXs(PersistenceManager.java:489)
        at org.jboss.mq.pm.jdbc2.PersistenceManager.startService(PersistenceManager.java:1842)
        at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
        at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
        at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
        at $Proxy0.start(Unknown Source)
        at org.jboss.system.ServiceController.start(ServiceController.java:417)
        at org.jboss.system.ServiceController.start(ServiceController.java:435)
        at org.jboss.system.ServiceController.start(ServiceController.java:435)
        at org.jboss.system.ServiceController.start(ServiceController.java:435)
        at org.jboss.system.ServiceController.start(ServiceController.java:435)
        at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
        at $Proxy4.start(Unknown Source)
        at org.jboss.deployment.SARDeployer.start(SARDeployer.java:304)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
        at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
        at $Proxy42.start(Unknown Source)
        at org.jboss.deployment.XSLSubDeployer.start(XSLSubDeployer.java:197)
        at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
        at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
        at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
        at $Proxy9.deploy(Unknown Source)
        at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
        at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
        at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
        at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
        at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
        at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
        at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
        at $Proxy0.start(Unknown Source)
        at org.jboss.system.ServiceController.start(ServiceController.java:417)
        at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
        at $Proxy4.start(Unknown Source)
        at org.jboss.deployment.SARDeployer.start(SARDeployer.java:304)
        at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
        at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
        at $Proxy5.deploy(Unknown Source)
        at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
        at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
        at org.jboss.Main.boot(Main.java:200)
        at org.jboss.Main$1.run(Main.java:508)
        at java.lang.Thread.run(Thread.java:662)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Every derived table must have its own alias
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
        at com.mysql.jdbc.Util.getInstance(Util.java:384)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3562)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3494)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1960)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2114)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2696)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2105)
        at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2264)
        at org.jboss.resource.adapter.jdbc.CachedPreparedStatement.executeQuery(CachedPreparedStatement.java:90)
        at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:342)
        at org.jboss.mq.pm.jdbc2.PersistenceManager.resolveAllUncommitedTXs(PersistenceManager.java:421)
        ... 111 more
and also
Code: Select all
17:17:07,385 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

--- MBeans waiting for other MBeans ---
ObjectName: jboss.mq:service=PersistenceManager
  State: FAILED
  Reason: org.jboss.mq.SpyJMSException: Could not resolve uncommited transactions.  Message recovery may not be accurate; - nested throwable: (com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Every derived table must have its own alias)
  I Depend On:
    jboss.jca:service=DataSourceBinding,name=DefaultDS
  Depends On Me:
    jboss.mq:service=DestinationManager

--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss.mq:service=PersistenceManager
  State: FAILED
  Reason: org.jboss.mq.SpyJMSException: Could not resolve uncommited transactions.  Message recovery may not be accurate; - nested throwable: (com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Every derived table must have its own alias)
  I Depend On:
    jboss.jca:service=DataSourceBinding,name=DefaultDS
  Depends On Me:
    jboss.mq:service=DestinationManager


17:17:07,861 INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
17:17:07,932 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-0.0.0.0-8009
17:17:08,308 INFO  [Server] JBoss (MX MicroKernel) [4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] Started in 48s:96ms
The sesion started but with these errors:

Please help me in this regard
 #8048  by jllort
 
You must create some database that can be connected by user and pass ( ensure this is right ), we recommend user not be root !
The name might be other than DefaultDS might be OpenKMDS.

In wiki is well done explained, that kind of experiments seems strange and dangerous. I hope you're doing it with a fresh installation not a migration procedure ?
 #8067  by alimalik
 
Now i setup new installation and created a new database with username and password,

And i modify the 2 files:

1. OpenKM.cfg

as
Code: Select all
hibernate.dialect=org.hibernate.dialect.MySQL5Dialect

hibernate.hbm2ddl=create
2. openkm-ds.xml

as
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>

<datasources>
<!-- OpenKM User Activity -->
<local-tx-datasource>
<jndi-name>dms</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/dms?createDatabaseIfNotExist=true</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>openkm</user-name>
<password>secret</password>
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<track-statements/>
<!--<security-domain>HsqlDbRealm</security-domain>-->
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</local-tx-datasource>


</datasources>
1. Does any other file need to modify or not?
2. Or i just run the script?

Thanks
 #8072  by dzacharo
 
dzacharo wrote:
jllort wrote:First, repository configuration only take effects first time you start jboss, then configuration can not be changed if you don't restarting entire creation of OpenKM.

If you've not changed repository.xml configuration by default blobs ( documents ) are stored in local disc under repository folder at jboss home. But can be changed to be stored in dbms changing configuration in repository.xml

By default if you've got a small repository, less 100GB configure to hard disk is good option ( normal we make it, althought backup must be dbms and hard disk ), because you don't lose time retrieving document ( dbms to temporal disc and then forwarded acrros application server ) if document is yet stored in local hard disk is automatically retrived to user across application server. Only is more greater installations we decide for complete database support, basically because administrators want to take advantage of getting all information on DBMS.
If I change the option of OpenKM.cfg

hibernate.hbm2ddl=none
to hibernate.hbm2ddl=update

would it solve my case or do I need to enter hibernate.hbm2ddl=create?

Thanks for the prompt reply!
Dimitris.
I followed the mysql instructions from the wiki (modified files repository.xml, openkm-ds.xml) (login-config.xml needed no change) to the letter BEFORE I started jboss (run.sh).
Then, as the wiki suggests, I started openkm (run.sh b 0.0.0.0). The tables were successfully created in mysql but at the same time, a repository directory was created at the local filesystem.
I uploaded new documents but they were not uploaded directly at mysql but at the local repository.
Would you like me to send you my config files for further investigation?

Cheers,
Dimitris.
 #8077  by jllort
 
If you want files be stored in dbms must change repository.xml and return creating repository as first time ( delete repository folder ). Repository folder it'll be created always with minor information, if you setting repository.xml to store files there.

Take a look here http://wiki.openkm.com/index.php/Reposi ... figuration
 #8138  by alimalik
 
Hi dzacharo and Jillort;

can u send me the configuration files for Mysql connectivity.

Thanks
 #8154  by dzacharo
 
jllort wrote:If you want files be stored in dbms must change repository.xml and return creating repository as first time ( delete repository folder ). Repository folder it'll be created always with minor information, if you setting repository.xml to store files there.

Take a look here http://wiki.openkm.com/index.php/Reposi ... figuration
Thanks for the reply. If I understood the above link correctly (not being a java expert myself...), the repository.xml as proposed in the mysql instructions wiki page lists:
Code: Select all
    <!-- DataStore improve file handling performance -->
    <DataStore class="org.apache.jackrabbit.core.data.FileDataStore">
        <param name="path" value="${rep.home}/repository/datastore"/>
        <param name="minRecordLength" value="100"/>
    </DataStore>
Could you please provide the proper configuration that must be modified in the repository.xml in order to have all files stored at the mysql db? It would be even better to provide a separate repository.xml at http://wiki.openkm.com/index.php/MySQL-OpenKM_5.0 with settings for full mysql integration (with the notice that performance would be somehow degraded due to the mysql data file fetching).

Cheers and thank you for the help so far.
Dimitris.
 #8156  by dzacharo
 
It seems I managed to solve the problem. Replace the last Datastore tags from:
Code: Select all
    <DataStore class="org.apache.jackrabbit.core.data.FileDataStore">
        <param name="path" value="${rep.home}/repository/datastore"/>
        <param name="minRecordLength" value="100"/>
    </DataStore>
to:
Code: Select all
    <DataStore class="org.apache.jackrabbit.core.data.db.DbDataStore">
          <param name="url" value="jdbc:mysql://XXX.XXXf.XX.gr:3306/okm_repo?autoReconnect=true"/>
          <param name="user" value="openkm"/>
          <param name="password" value="XXXXXXXX"/>
          <param name="driver" value="com.mysql.jdbc.Driver"/>
        <param name="minRecordLength" value="100"/>
        <param name="copyWhenReading" value="true"/> 
    </DataStore>
Best regards,
Dimitris.
 #8165  by alimalik
 
I got error message like this:
Code: Select all
14:59:36,880 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

--- Incompletely deployed packages ---
org.jboss.deployment.DeploymentInfo@6a19364e { url=file:/opt/OpenKm/server/default/deploy/openkm-ds.xml }
  deployer: org.jboss.deployment.XSLSubDeployer@d713fe
  status: Deployment FAILED reason: Class does not expose a management interface: java.lang.Object; - nested throwable: (javax.management.NotCompliantMBeanException: Class does not expose a management interface: java.lang.Object)
  state: FAILED
  watch: file:/opt/OpenKm/server/default/deploy/openkm-ds.xml
  altDD: null
  lastDeployed: 1295344745044
  lastModified: 1295344745000
  mbeans:


14:59:37,084 INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
14:59:37,141 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-0.0.0.0-8009
14:59:37,263 INFO  [Server] JBoss (MX MicroKernel) [4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] Started in 51s:654ms
 #8168  by jllort
 
alimalik change must be done in repository.xml not in openkm-ds.xml
 #8232  by alimalik
 
Now i got error message like this:
Code: Select all
ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] Unsuccessful: create table JBPM_ACTION (ID_ bigint no
t null auto_increment, class char(1) not null, NAME_ varchar(255), ISPROPAGATIONALLOWED_ bit, ACTIONEXPRESSION_ varchar(255),
 ISASYNC_ bit, REFERENCEDACTION_ bigint, ACTIONDELEGATION_ bigint, EVENT_ bigint, PROCESSDEFINITION_ bigint, EXPRESSION_ varc
har(4000), TIMERNAME_ varchar(255), DUEDATE_ varchar(255), REPEAT_ varchar(255), TRANSITIONNAME_ varchar(255), TIMERACTION_ b
igint, EVENTINDEX_ integer, EXCEPTIONHANDLER_ bigint, EXCEPTIONHANDLERINDEX_ integer, primary key (ID_))
2011-01-20 08:49:24,958 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] Table already exists: JBPM_ACTION in statement [creat
e table JBPM_ACTION]
 #8238  by jllort
 
Don't worry for this error, every time starting jboss seems wants create the table but yet exists.
 #8367  by DemiGodz
 
I just wondering what is the default username and password in mysql DB of openKM.. I tried to put a db and i saw this in

OKM_USER 'okmAdmin' 'Administrator' '21232f297a57a5a743894a0e4a801fc3' 'admin@noreply.com'

Thanks..
Regards,

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.