Page 1 of 1

Can't Get MySQL working with OpenKM

PostPosted:Wed Jan 28, 2015 7:15 pm
by b33gopher
I am trialing 6.4.14 Pro on Ubuntu 14.04. I am trying to setup OpenKM with mySQL following these directions http://wiki.openkm.com/index.php/MySQL_-_OpenKM_6.2 but I am getting an error when browsing to the server. I'm sure I am missing something but can't seem to figure out what. Any help would be appreciated.

1) I have installed OpenKM to /opt/openkm-version#
2) I installed mysql
3) before running openkm I did the following

a) configured OpenKM.cfg with these lines
Code: Select all
hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
hibernate.hbm2ddl=create
b) created database and user
Code: Select all
DROP DATABASE IF EXISTS okmdb;
CREATE DATABASE okmdb DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;
CREATE USER openkm@localhost IDENTIFIED BY '*secret*';
GRANT ALL ON okmdb.* TO openkm@localhost WITH GRANT OPTION;
c) added the following lines to the server.xml file
Code: Select all
<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"/>
4) OpenKM.xml isn't recreated until OpenKM is started. However, once the file is created. my entries matched what is in the documentation
Code: Select all
<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>
5) Started OpenKM service
6) Browsed to http://<server ip>:8080/OpenKM/login.jsp
7) Received Error message: see attached document

Re: Can't Get MySQL working with OpenKM

PostPosted:Thu Jan 29, 2015 9:11 pm
by pavila
I cant understand what are you trying to do. If you downloaded OpenKM 6.4.x trial after the installation process you have Tomcat + OpenKM already configured. The trial is configured to use an embeded database called Hypersonic. I think it's enought for testing. Why do you need to install it for MySQL?

Re: Can't Get MySQL working with OpenKM

PostPosted:Thu Jan 29, 2015 9:20 pm
by b33gopher
I'm looking at purchasing your Pro version. I'm not that familiar with MYSQL and wanted to make sure I could configure MYSQL with OpenKM before proceeding to purchase the product.

Re: Can't Get MySQL working with OpenKM

PostPosted:Fri Jan 30, 2015 5:45 am
by pavila
Most of our customers have OpenKM with OpenKM. Don't care about configuration because we install and configure OpenKM for your.

Re: Can't Get MySQL working with OpenKM

PostPosted:Fri Jan 30, 2015 2:23 pm
by b33gopher
As long as you have a support contract, I'm sure that is fine for many of your customers. However, if we don't have a support contract, and need to do a disaster recovery or migrate the software to another server for example, then it's important to understand how the software is configured/installed with mysql.

Re: Can't Get MySQL working with OpenKM

PostPosted:Sat Jan 31, 2015 7:57 am
by pavila
Well, it's quite simple. The steps your followed are right. But trial has been modified to ease it's installation process. You won't be able to configure it with MySQL unles you modify "WEB-INF/web.xml", where Spring is configured. This part should be this way:
Code: Select all
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
      /WEB-INF/applicationContext.xml
      file:${catalina.home}/OpenKM.xml
    </param-value>
  </context-param>
Keep on mind that this trial has a time limitation, so disaster recovery or migration has little sense.

Re: Can't Get MySQL working with OpenKM

PostPosted:Sat Jan 31, 2015 6:19 pm
by b33gopher
Thanks for your reply. My intension is to have a disaster recovery setup for the production Pro install not the trial. I asssumed the trial would be setup similar to the actual Pro install which is why I wanted to get it working with MYSQL. Apparently that isn't the case. There isn't any specific documentation pertaining to the MSSQL setup for Pro that I've found. I've only found documentation pertaining to an older commmunity version 6.2 which is what I linked to in my original post. Does that particular documentation also pertain to the Pro version or is the MYSQL Pro version documentation only available through a support contract? That's fine if it is. It just seems a bit unclear on your site.

Re: Can't Get MySQL working with OpenKM

PostPosted:Sun Feb 01, 2015 1:55 pm
by jllort
The steps for connecting community and professional are exactly the same ( same files, and same configuration ). About documentation we're doing a major improvemente, and I hope in 3-4 months will be able to be shown ( then will be clear what's professional and what community documentation, because now all is not clear, we know it and we're working to solve ).