• SOLVED OpenKM 6.2 with new MySQL Datastore

  • 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.
 #19038  by techexpress
 
Hi to all ,
i'm trying to use MySQL database engine on Centos x64
So I install the 6.2.1 comunity edition , create database and modify all the files (see http://wiki.openkm.com/index.php/MySQL-OpenKM_6.2)
But in firefox :
I have this message : javax.servlet.ServletException: com.openkm.core.DatabaseException: could not execute query

I check log and
Code: Select all
    INFO  com.openkm.servlet.RepositoryStartupServlet - *** Initialize language detection engine... ***
    2012-11-02 22:58:06,734 [pool-2-thread-1] WARN  org.hibernate.util.JDBCExceptionReporter - SQL Error: 1146, SQLState: 42S02
    2012-11-02 22:58:06,734 [pool-2-thread-1] ERROR org.hibernate.util.JDBCExceptionReporter - Table 'okm_app.OKM_CONFIG' doesn't exis
I don't know where is the mistake ?
Last edited by techexpress on Fri Nov 09, 2012 8:07 pm, edited 1 time in total.
 #19046  by techexpress
 
Sure :
I'm try to upload files but I have always message from forum "extension .cfg or .xml not allowed"
OpenKM.cfg
Code: Select all
# OpenKM Hibernate configuration values
hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
hibernate.hbm2ddl=create 
OpenKM.xml:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
             xmlns:security="http://www.springframework.org/schema/security"
             xmlns:task="http://www.springframework.org/schema/task"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.springframework.org/schema/beans
                                 http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
                                 http://www.springframework.org/schema/security
                                 http://www.springframework.org/schema/security/spring-security-3.1.xsd
                                 http://www.springframework.org/schema/task
                                 http://www.springframework.org/schema/task/spring-task-3.1.xsd">

  <!-- Tasks configuration -->
  <!--
  <task:scheduler id="taskScheduler" pool-size="1"/>
  <task:scheduled-tasks scheduler="taskScheduler">
    <task:scheduled ref="textExtractorWorker" method="work" fixed-delay="60000"/>
  </task:scheduled-tasks>
  <beans:bean id="textExtractorWorker" class="com.openkm.extractor.TextExtractorWorker" />
  -->
  
  <!-- Security configuration  -->
  <!-- Source : http://wiki.openkm.com/index.php/MySQL-OpenKM_6.2  -->
 <security:authentication-manager alias="authenticationManager">
  <security:authentication-provider>
    <security:password-encoder hash="md5"/>
    <security:jdbc-user-service 
        data-source-ref="dataSource"
        users-by-username-query="select usr_id, usr_password, 1 from OKM_USER where usr_id=? and usr_active='T'"
        authorities-by-username-query="select ur_user, ur_role from OKM_USER_ROLE where ur_user=?"/>
  </security:authentication-provider>
</security:authentication-manager>
</beans:beans>
Server.xml:
Code: Select all
<?xml version='1.0' encoding='utf-8'?>
<!--
  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.
-->
<!-- Note:  A "Server" is not itself a "Container", so you may not
     define subcomponents such as "Valves" at this level.
     Documentation at /docs/config/server.html
 -->
<Server port="8005" shutdown="SHUTDOWN">
  <!-- Security listener. Documentation at /docs/config/listeners.html
  <Listener className="org.apache.catalina.security.SecurityListener" />
  -->
  <!--APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
  <Listener className="org.apache.catalina.core.JasperListener" />
  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
  
  <!-- Automatically reload log4j configuration -->
  <Listener className="com.openkm.util.Log4JInitializer" configFile="${catalina.base}/conf/log4j.properties"/>

  <!-- Global JNDI resources
       Documentation at /docs/jndi-resources-howto.html
  -->
  <GlobalNamingResources>
    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
    -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
              
              
     <!-- source http://wiki.openkm.com/index.php/MySQL-OpenKM_6.2  -->
	 
	 <Resource name="jdbc/OpenKMDS" auth="Container" type="javax.sql.DataSource"
          maxActive="100" maxIdle="30" maxWait="10000" validationQuery="select 1"
          username="openkm" password="password" driverClassName="com.mysql.jdbc.Driver"
          url="jdbc:mysql://localhost:3306/okm_app?autoReconnect=true&useUnicode=true&characterEncoding=UTF8"/>

    <!-- <Resource name="jdbc/OpenKMDS" auth="Container" type="javax.sql.DataSource"
            maxActive="100" maxIdle="30" maxWait="10000" validationQuery="select 1"
            username="openkm" password="password" driverClassName="com.mysql.jdbc.Driver"
            url="jdbc:mysql://localhost:3306/okmdb?autoReconnect=true&useUnicode=true&characterEncoding=UTF8"/> -->
            
    <Resource name="mail/OpenKM" auth="Container" type="javax.mail.Session"
            mail.smtp.host="localhost" mail.from="testing@openkm.com"/>
  </GlobalNamingResources>

  <!-- A "Service" is a collection of one or more "Connectors" that share
       a single "Container" Note:  A "Service" is not itself a "Container",
       so you may not define subcomponents such as "Valves" at this level.
       Documentation at /docs/config/service.html
   -->
  <Service name="Catalina">

    <!--The connectors can use a shared executor, you can define one or more named thread pools-->
    <!--
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
        maxThreads="150" minSpareThreads="4"/>
    -->


    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8080" address="0.0.0.0" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" address="127.0.0.1" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    -->
    <!-- Define a SSL HTTP/1.1 Connector on port 8443
         This connector uses the JSSE configuration, when using APR, the
         connector should be using the OpenSSL style configuration
         described in the APR documentation -->
    <!--
    <Connector port="8443" address="127.0.0.1" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />
    -->

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" address="127.0.0.1" protocol="AJP/1.3" redirectPort="8443" />


    <!-- An Engine represents the entry point (within Catalina) that processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request, and passes them
         on to the appropriate Host (virtual host).
         Documentation at /docs/config/engine.html -->

    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
    -->
    <Engine name="Catalina" defaultHost="localhost">

      <!--For clustering, please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) -->
      <!--
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      -->

      <!-- Use the LockOutRealm to prevent attempts to guess user passwords
           via a brute-force attack -->
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <!-- This Realm uses the UserDatabase configured in the global JNDI
             resources under the key "UserDatabase".  Any edits
             that are performed against this UserDatabase are immediately
             available for use by the Realm.  -->
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>

      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" -->
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"
               pattern="%h %l %u %t "%r" %s %b" />

      </Host>
    </Engine>
  </Service>
</Server>
Last edited by techexpress on Sat Nov 03, 2012 9:46 pm, edited 1 time in total.
 #19047  by okmuser
 
Although this is a dumb reply, I need to clear off all my doubts, so please bear with me.

Can you please confirm you used the correct password.
Code: Select all
DROP DATABASE IF EXISTS okm_app;
 
CREATE DATABASE okm_app DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;
 
CREATE USER openkm@localhost IDENTIFIED BY 'password';
GRANT ALL ON okm_app.* TO openkm@localhost WITH GRANT OPTION;
please note:
Code: Select all
IDENTIFIED BY 'password';
this should be same as the password you used in server.xml.
 #19049  by techexpress
 
Yes of course I use same password
I can connect to mysql via console with openkm credentials
Code: Select all
mysql -u openkm -p okm_app
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.61 Source distribution

mysql> use okm_app
Database changed
mysql> show tables;
Empty set (0.00 sec)
No error in mysql.log
Have this in catalina.log
Code: Select all
2012-11-03 21:20:13,868 [pool-2-thread-1] INFO  com.openkm.core.Config - LOAD - repository.config=/dev/null
2012-11-03 21:20:13,868 [pool-2-thread-1] INFO  com.openkm.core.Config - LOAD - repository.datastore.backend=fs
2012-11-03 21:20:13,868 [pool-2-thread-1] INFO  com.openkm.core.Config - LOAD - repository.datastore.home=/opt/openkm-6.2.0-community/tomcat/repository/datastore
2012-11-03 21:20:13,869 [pool-2-thread-1] INFO  com.openkm.core.Config - LOAD - repository.home=/opt/openkm-6.2.0-community/tomcat/repository
2012-11-03 21:20:13,869 [pool-2-thread-1] INFO  com.openkm.core.Config - LOAD - repository.native=true
2012-11-03 21:20:13,875 [pool-2-thread-1] INFO  com.openkm.util.WarUtils - Implementation-Version: 6.2.0
2012-11-03 21:20:13,875 [pool-2-thread-1] INFO  com.openkm.util.WarUtils - Implementation-Build: 13077
2012-11-03 21:20:13,890 [pool-2-thread-1] INFO  com.openkm.servlet.RepositoryStartupServlet - *** Application version: 6.2.0 (build: 13077) ***
2012-11-03 21:20:13,890 [pool-2-thread-1] INFO  com.openkm.servlet.RepositoryStartupServlet - *** Hibernate initialize ***
2012-11-03 21:20:14,317 [pool-2-thread-1] INFO  org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.2.0.Final
2012-11-03 21:20:14,337 [pool-2-thread-1] INFO  org.hibernate.cfg.Environment - Hibernate 3.6.10.Final
2012-11-03 21:20:14,350 [pool-2-thread-1] INFO  org.hibernate.cfg.Environment - hibernate.properties not found
2012-11-03 21:20:14,358 [pool-2-thread-1] INFO  org.hibernate.cfg.Environment - Bytecode provider name : javassist
2012-11-03 21:20:14,370 [pool-2-thread-1] INFO  org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
2012-11-03 21:20:14,874 [pool-2-thread-1] WARN  org.hibernate.util.DTDEntityResolver - recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
2012-11-03 21:20:14,998 [pool-2-thread-1] WARN  org.hibernate.util.DTDEntityResolver - recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!

lot of warning later ...

2012-11-03 21:20:27,786 [pool-2-thread-1] INFO  com.openkm.servlet.RepositoryStartupServlet - *** Initialize language detection engine... ***
2012-11-03 21:20:29,206 [pool-2-thread-1] WARN  org.hibernate.util.JDBCExceptionReporter - SQL Error: 1146, SQLState: 42S02
2012-11-03 21:20:29,206 [pool-2-thread-1] ERROR org.hibernate.util.JDBCExceptionReporter - Table 'okm_app.OKM_CONFIG' doesn't exist
2012-11-03 21:20:29,206 [pool-2-thread-1] INFO  org.hibernate.event.def.DefaultLoadEventListener - Error performing load command
org.hibernate.exception.SQLGrammarException: could not load an entity: [com.openkm.dao.bean.Config#plugin.debug]
OS is Cent Os 6.3 x64 , Mysql 5.1.61

I already reinstall from scratch to be sure
Thank's for help
 #19056  by techexpress
 
Code: Select all
+---------------------------------------------------------------------------------------------------------------+
| Grants for openkm@localhost                                                                                               |
+---------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'openkm'@'localhost' IDENTIFIED BY PASSWORD '*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19' |
| GRANT ALL PRIVILEGES ON `okm_app`.* TO 'openkm'@'localhost' WITH GRANT OPTION                                                      |
+---------------------------------------------------------------------------------------------------------------+

I think password is in MD5 format
 #19060  by techexpress
 
Yes :
Code: Select all
 nmap 192.168.6.55

Starting Nmap 5.51 ( http://nmap.org ) at 2012-11-04 17:48 EST
Nmap scan report for 192.168.6.55
Host is up (0.0000050s latency).
Not shown: 997 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
111/tcp  open  rpcbind
3306/tcp open  mysql
 #19062  by techexpress
 
java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.5) (rhel-1.50.1.11.5.el6_3-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
I'm trying also with the JDK 1.7 and 1.6 from Sun:

java -version
java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)

java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)

Same result

Thank's
Attachments
catalina.log
(9.17 KiB) Downloaded 389 times
Last edited by techexpress on Wed Nov 07, 2012 1:23 am, edited 2 times in total.
 #19063  by okmuser
 
Sorry mate, I can't help you, is there a possibility I can log into your machine? I hope you have already downloaded OpenKM again to see whether you had any issues with the downloaded file.

Cheers,
 #19150  by techexpress
 
Error message in catalina.log is :
Code: Select all
WARN  org.hibernate.util.JDBCExceptionReporter - SQL Error: 1146, SQLState: 42S02
[pool-2-thread-1] ERROR org.hibernate.util.JDBCExceptionReporter - Table 'okm_app.OKM_CONFIG' doesn't exist
I find some info about this error https://forum.hibernate.org/viewtopic.php?f=1&t=1002688
 #19202  by jllort
 
use only
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)

Ensure you can create a table with the user openkm into the database.
 #19209  by techexpress
 
Yes I can do everything on this db :
Code: Select all
mysql -u openkm -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 36
Server version: 5.1.66-0ubuntu0.11.10.2 (Ubuntu)
mysql> use okm_app
Database changed
mysql> CREATE TABLE IF NOT EXISTS `visiteurs` (
    ->   `id` int(11) NOT NULL DEFAULT '0',
    ->   `nom` text NOT NULL,
    ->   `prenom` text NOT NULL,
    ->   `age` int(11) NOT NULL,
    ->   `paye` text NOT NULL,
    ->   `sexe` text NOT NULL,
    ->   `dateInscrit` date NOT NULL,
    ->   PRIMARY KEY (`id`)
    -> ) ;
Query OK, 0 rows affected (0.02 sec)

mysql> show tables;
+-------------------+
| Tables_in_okm_app |
+-------------------+
| visiteurs         |
+-------------------+
1 row in set (0.00 sec)

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.