• Application error after restarting Tomcat

  • 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.
 #28094  by matt81
 
Hi ,
I have installed Openkm Community version 5.6.2, and all was well, i could create folders and files etc. I then went to shutdown Tomcat and restart it again.
I then received the following error on the screen:
Code: Select all
Application error
Class: 	org.apache.jasper.JasperException
Message: 	javax.servlet.ServletException: com.openkm.core.DatabaseException: could not execute query
Please find below log file:
Code: Select all
2014-03-14 05:13:08,533 [http-bio-0.0.0.0-8080-exec-3] WARN  org.hibernate.util.JDBCExceptionReporter - SQL Error: -5501, SQLState: 42501
2014-03-14 05:13:08,533 [http-bio-0.0.0.0-8080-exec-3] ERROR org.hibernate.util.JDBCExceptionReporter - user lacks privilege or object not found: OKM_LANGUAGE
2014-03-14 05:13:08,534 [http-bio-0.0.0.0-8080-exec-3] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/OpenKM].[jsp] - Servlet.service() for servlet jsp threw exception
org.hsqldb.HsqlException: user lacks privilege or object not found: OKM_LANGUAGE
	at org.hsqldb.error.Error.error(Unknown Source)
	at org.hsqldb.error.Error.error(Unknown Source)
	at org.hsqldb.SchemaManager.getTable(Unknown Source)
	at org.hsqldb.ParserDQL.readTableName(Unknown Source)
	at org.hsqldb.ParserDQL.readTableOrSubquery(Unknown Source)
	at org.hsqldb.ParserDQL.XreadTableReference(Unknown Source)
	at org.hsqldb.ParserDQL.XreadFromClause(Unknown Source)
	at org.hsqldb.ParserDQL.XreadTableExpression(Unknown Source)
	at org.hsqldb.ParserDQL.XreadQuerySpecification(Unknown Source)
	at org.hsqldb.ParserDQL.XreadSimpleTable(Unknown Source)
	at org.hsqldb.ParserDQL.XreadQueryPrimary(Unknown Source)
	at org.hsqldb.ParserDQL.XreadQueryTerm(Unknown Source)
	at org.hsqldb.ParserDQL.XreadQueryExpressionBody(Unknown Source)
	at org.hsqldb.ParserDQL.XreadQueryExpression(Unknown Source)
	at org.hsqldb.ParserDQL.compileCursorSpecification(Unknown Source)
	at org.hsqldb.ParserCommand.compilePart(Unknown Source)
	at org.hsqldb.ParserCommand.compileStatement(Unknown Source)
	at org.hsqldb.Session.compileStatement(Unknown Source)
	at org.hsqldb.StatementManager.compile(Unknown Source)
	at org.hsqldb.Session.execute(Unknown Source)
	at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source)
	at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source)
	at org.apache.tomcat.dbcp.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:281)
	at org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:313)
	at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
	at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452)
	at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
	at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1700)
	at org.hibernate.loader.Loader.doQuery(Loader.java:801)
	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
	at org.hibernate.loader.Loader.doList(Loader.java:2542)
	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
	at org.hibernate.loader.Loader.list(Loader.java:2271)
	at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:459)
	at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:365)
	at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
	at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268)
What is the problem?
 #28106  by jllort
 
Version 5.6.2 not exists, I suppose you're talking about 6.2.5

Did you changed default database or are you using HSQL ? seems the table OKM_LANGUAGE has not been created correctly. Is a clean installation ( do you got some data into ? ).
 #28117  by matt81
 
Yes it's 6.2.5 Community version, I haven't changed the default database, I haven't touched anything. I have isntalled it twice and still the same problem, so it must be something wrong.
It was a clean install I just downloaded it from the website and installed it, so I don't know what is happening, but surely I shouldn't have to change anything. I went to set up the pdf2swf config setting and then did a restart and nothing, an error. I have read that other people experienced the asme problem without solution.

Please tell us what the issue is and give us instructions on how to fix it, but as i said i shouldn;t have change anything, if I ahve to do this all the time it will be a pain.

Thanks
 #28184  by jllort
 
definitively is not a problem with path. Do you got information into openkm or is fresh installation ? In second case I suggest configure openkm with mysql follow the steps here http://wiki.openkm.com/index.php/MySQL_-_OpenKM_6.2

Sometimes can be problems with cookies in browser you can try http://ip:8080/OpenKM/frontend/index.jsp?lang=en-GB ( but I think the problem in your case is quite different ).
 #28209  by matt81
 
Thanks for your reply.
However can you tell me how to change the database to MySql. On the link you gave me it says that I cannot change it once the database is created, so it has to be before Openkm is installed. How do I go about doing that? If I download whatever version of Openkm it gives me an executable file, so I cannot configure the database that way? Do I have to install another package? Plase give me instructions, there is nothing I could find.
 #28219  by jllort
 
You can do with your actual tomcat installation. If you got files I suggest first export data http://wiki.openkm.com/index.php/Repository_export and after configured mysql import http://wiki.openkm.com/index.php/Repository_import

The process to change database will clean all repository do it is easy.
Stop application
Simply change OpenKM.cfg parameters to what are indicated in the page:
Code: Select all
hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
hibernate.hbm2ddl=create
Create database as is indicated
Code: Select all
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;
Change 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="*secret*" driverClassName="com.mysql.jdbc.Driver"
          url="jdbc:mysql://localhost:3306/okmdb?autoReconnect=true&useUnicode=true&characterEncoding=UTF8"/>
Start application ( nothing else )

I think mysql jar lib is included in tomcat libs folder.
 #28226  by matt81
 
Thanks for the reply, you have explained it well, however i still receive the same error.
Please find below log file, it looks like it cannot load mysql jdbc driver. I checked and the jar file exists in tomcat/libs/mysql-connector-java-5.1.12-bin.jar.
What could the problem be?
Code: Select all
2014-03-31 00:09:04,902 [http-bio-0.0.0.0-8080-exec-1] WARN  org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: null
2014-03-31 00:09:04,903 [http-bio-0.0.0.0-8080-exec-1] ERROR org.hibernate.util.JDBCExceptionReporter - Cannot load JDBC driver class 'com.MySQL.jdbc.Driver'
2014-03-31 00:09:04,904 [http-bio-0.0.0.0-8080-exec-1] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/OpenKM].[jsp] - Servlet.service() for servlet jsp threw exception
java.lang.ClassNotFoundException: com.MySQL.jdbc.Driver
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
 #28236  by matt81
 
I am guessing this could be a compatibility issue. I am using Openkm community version 6.2.5, which is running Tomcat version 7.0.27.
I have MySQL version 5.5.34. Do you think this has anything to do with it. I cannot change the version of MySQL, it surely should work with all.
Pease advice me of any suggestions.
Thanks
 #28244  by matt81
 
I have finaly solved this. Although you guys have explained the procedure well, you have left out the major points needed to get this done.
It CANNOT be done if OpenKM is already installed, the database cannot be changed.
Openkm has to be downloaded first, changed to the new DB details and then running it.
You have to download the OpenKM bundle file, where you can configure it and run tomcat.
This is done.
 #28256  by jllort
 
Really when you want to change database, you must create newer, does not exists a process to migrate from PostgreSQL to Mysql ( take it as example ). To create new database simply you need to set OpenKM.cfg parameter hibernate.hbm2ddl=create and restart openkm ( it will create a new database with empty repository and will be lost any previous information ).

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.