Page 1 of 1

Application error after restarting Tomcat

PostPosted:Fri Mar 14, 2014 5:24 am
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?

Re: Application error after restarting Tomcat

PostPosted:Sat Mar 15, 2014 6:51 pm
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 ? ).

Re: Application error after restarting Tomcat

PostPosted:Sun Mar 16, 2014 10:16 pm
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

Re: Application error after restarting Tomcat

PostPosted:Tue Mar 18, 2014 9:50 pm
by matt81
Can I get an answer please?

Re: Application error after restarting Tomcat

PostPosted:Fri Mar 21, 2014 9:21 am
by jllort
What is the application path in your hard disk ?

Re: Application error after restarting Tomcat

PostPosted:Sun Mar 23, 2014 10:52 pm
by matt81
Thanks for replying back.
I am using Ubuntu and the path is /opt/openkm-6.2.5-community.
You think the path has something to do with it?

Re: Application error after restarting Tomcat

PostPosted:Tue Mar 25, 2014 8:46 am
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 ).

Re: Application error after restarting Tomcat

PostPosted:Thu Mar 27, 2014 10:05 pm
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.

Re: Application error after restarting Tomcat

PostPosted:Sat Mar 29, 2014 7:53 am
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.

Re: Application error after restarting Tomcat

PostPosted:Mon Mar 31, 2014 12:21 am
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)

Re: Application error after restarting Tomcat

PostPosted:Tue Apr 01, 2014 11:17 pm
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

Re: Application error after restarting Tomcat

PostPosted:Thu Apr 03, 2014 9:49 pm
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.

Re: Application error after restarting Tomcat

PostPosted:Fri Apr 04, 2014 3:09 pm
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 ).