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

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.
Post Reply
Wraith
Fresh Boarder
Fresh Boarder
Posts: 16
Joined: Fri Apr 03, 2015 1:45 pm

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

Post by Wraith » Wed Jul 25, 2018 12:35 pm

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.
OS: Windows Server 2012 R2
OPENKM: v6.3.6 Community Edition
mySQL: v8.0.12
Tomcat: v8.5.24
Python: v2.7.15 32-bit

lnovoa
Expert Boarder
Expert Boarder
Posts: 101
Joined: Tue Mar 27, 2018 8:00 am

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

Post by lnovoa » Wed Jul 25, 2018 2:42 pm

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

jllort
Moderator
Moderator
Posts: 10314
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

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

Post by jllort » Thu Jul 26, 2018 3:29 pm

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

Wraith
Fresh Boarder
Fresh Boarder
Posts: 16
Joined: Fri Apr 03, 2015 1:45 pm

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

Post by Wraith » Fri Jul 27, 2018 12:03 pm

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!
OS: Windows Server 2012 R2
OPENKM: v6.3.6 Community Edition
mySQL: v8.0.12
Tomcat: v8.5.24
Python: v2.7.15 32-bit

Wraith
Fresh Boarder
Fresh Boarder
Posts: 16
Joined: Fri Apr 03, 2015 1:45 pm

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

Post by Wraith » Fri Jul 27, 2018 12:10 pm

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! :)
OS: Windows Server 2012 R2
OPENKM: v6.3.6 Community Edition
mySQL: v8.0.12
Tomcat: v8.5.24
Python: v2.7.15 32-bit

jllort
Moderator
Moderator
Posts: 10314
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

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

Post by jllort » Sun Jul 29, 2018 7:51 am

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 ).

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests