• javax.servlet.ServletException: com.openkm.core.DatabaseException: could not execute query

  • Problems with installing OpenKM? No problemo, the solution is closer than you think.
Problems with installing OpenKM? No problemo, the solution is closer than you think.
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.
 #46375  by Wraith
 
Hi,

I'm attempting to install OpenKM as a service on my Windows Server 2012 R2 machine. I have followed the installation tutorial successfully [with a few necessary modifications such as needing to start OpenKM service instead of the Apache Tomcat service].

When attempting to login from the Server through "localhost:8080/OpenKM" I receive the following error:
Code: Select all
Application error
Class: 	org.apache.jasper.JasperException
Message: 	javax.servlet.ServletException: com.openkm.core.DatabaseException: could not execute query
Date: 	Wed Jul 25 19:19:46 AWST 2018
I have found a couple threads with a similiar issue however, one was for Linux and the other had a solution similiar to the installation so didn't appear appropriate. The thread that the same issue on Linux machine mentioned a potential user security issue. If that's so, then what would be the appropriate user permissions on a Windows Server?

Software installed is listed in my Signature. JAVA_HOME and CATALINA_HOME set as environment variables through the Windows GUI.

Would appreciate in advice on how to resolve. Please let me know if there is any other information I can provide to assist.

Thanks in advance.
 #46377  by lnovoa
 
Hi!,

it looks like you have a permissions problem with the database.

Can you check to connect to the database ?.
Have you given the user privileges when creating the database?
For example:
Code: Select all
CREATE USER openkm@localhost IDENTIFIED BY 'PASSWORD';
GRANT ALL ON okmdb. * TO openkm@localhost WITH GRANT OPTION;
Try ...
1. stop openkm
2. delete repository directory
3. Modify the following in the openkm.cfg:
Code: Select all
hibernate.hbm2ddl = none
>
Code: Select all
hibernate.hbm2ddl = create
4. Start openkm
 #46391  by jllort
 
Check the server.xml file where is set the database connection, you will find it at $TOMCAT_HOME/conf/server.xml

if you are installing in MySQL should make a quick review at this documentation section
https://docs.openkm.com/kcenter/view/ok ... riadb.html

Pay attention at MySQL 8 issues -> https://docs.openkm.com/kcenter/view/ok ... oting.html
 #46398  by Wraith
 
Hi Inovoa,

Appreciate your response.
Can you check to connect to the database ?
I'm assuming I can as I can see the okmdb object in the "SCHEMAS" section of MySQL Workbench. Please let me know if I need to determine a different type of connection.
Have you given the user privileges when creating the database?
For example:
Code: Select all
CREATE USER openkm@localhost IDENTIFIED BY 'PASSWORD';
GRANT ALL ON okmdb. * TO openkm@localhost WITH GRANT OPTION;
I followed the above commands, which is as per the installation tutorial. The action window indicated the commands were executed successfully. I can see a "openkm" user in the "Users and Privileges" section of MySQL Workbench. As such, I've assumed the user was created with the appropriate permissions. Please let me know if there are other checks that need to be done.

Irrespective of the above, the following steps appears to have resolved the issue. All I have to do now is resolve an "Authentication error" issue. I'll search and raise a new topic if necessary.
Try ...
1. stop openkm
2. delete repository directory
3. Modify the following in the openkm.cfg:
Code: Select all
hibernate.hbm2ddl = none
>
Code: Select all
hibernate.hbm2ddl = create
4. Start openkm
Thanks!
 #46399  by Wraith
 
Hi jllort,

Also, thanks for your reply.
Check the server.xml file where is set the database connection, you will find it at $TOMCAT_HOME/conf/server.xml
I can confirm the "server.xml" file is present.
if you are installing in MySQL should make a quick review at this documentation section https://docs.openkm.com/kcenter/view/ok ... riadb.html
Pay attention at MySQL 8 issues -> https://docs.openkm.com/kcenter/view/ok ... oting.html
I did initially install MySQL 8 however I was having issues and found a thread where it was mentioned [by yourself I think] that there was additional testing to do with MySQL 8 and it was recommended to install MySQL 5.7. Are you suggesting we can install MySQL 8 at this stage? I note that I receive an "Unsupported operating system" warning with MySQL 5.7 that I did not get with MySQL 8.

Cheers! :)
 #46411  by jllort
 
If you install MySQL 8, should consider reading throubleshoting section about this version https://docs.openkm.com/kcenter/view/ok ... oting.html ( it works, but might apply some changes described there ).

Into the catalina.log file you have the full description of the error, when you start the application, consider check with care that file, what provide the real clues for solving the issues ( good practice in your case might be delete all files into logs folder before starting the application again ).

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.