Page 1 of 1

Connection problem 1 day after server start

PostPosted:Wed Feb 29, 2012 11:34 am
by andrea.todeschini
Hi,
I have migrated from Openkm 5.0.4 to OpenKm 5.1.8. I use mysql as database. All features and the repository are ok and fully running, but about after 1 day that application is running, I obtain the follow error:
Code: Select all
2012-02-28 00:00:55,891 INFO  [org.apache.jackrabbit.core.persistence.bundle.util.LRUNodeIdCache] num=764/10240 hits=9578 miss=70422
2012-02-28 12:03:03,016 WARN  [org.hibernate.util.JDBCExceptionReporter] SQL Error: 0, SQLState: 08S01
2012-02-28 12:03:03,016 ERROR [org.hibernate.util.JDBCExceptionReporter] The last packet successfully received from the server was 71.415.344 milliseconds ago.  The last packet sent successfully to the server was 71.415.344 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem. 


Consider that autoReconnect=true is setted in openkm-ds.xml as you can see:
Code: Select all
    <jndi-name>OpenKMDS</jndi-name>
    <connection-url>jdbc:mysql://localhost:3306/okm_app518?autoReconnect=true</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>openkm</user-name>
    <password>xxxxxx</password>
    <min-pool-size>5</min-pool-size>
    <max-pool-size>20</max-pool-size>
    <idle-timeout-minutes>28680</idle-timeout-minutes>
    <prepared-statement-cache-size>32</prepared-statement-cache-size>


and in repositoy.xml
Code: Select all
        <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager">
          <param name="driver" value="com.mysql.jdbc.Driver"/>
          <param name="url" value="jdbc:mysql://localhost:3306/okm_repo518?autoReconnect=true"/>
          <param name="schema" value="mysql"/>
          <param name="user" value="openkm"/>
          <param name="password" value="xxxxxxx"/>
          <param name="schemaObjectPrefix" value="version_"/>
          <param name="externalBLOBs" value="false"/>
        </PersistenceManager>


So each day I must restart the server to work. What can I do to solve this problem?

Thanks in advance.
Andrea

Re: Connection problem 1 day after server start

PostPosted:Thu Mar 01, 2012 4:03 pm
by jllort
Your configuration seems right, but try with it

try adding
Code: Select all
<idle-timeout-minutes>28680</idle-timeout-minutes>
    <exception-sorter-class-name>com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter</exception-sorter-class-name>
    <valid-connection-checker-class-name>com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker</valid-connection-checker-class-name>
    <metadata>
        <type-mapping>mySQL</type-mapping>
    </metadata>

Re: Connection problem 1 day after server start

PostPosted:Thu Mar 22, 2012 7:59 am
by andrea.todeschini
I have added the lines above, but the problem was not solved. Can you suggest me some other settings or solutions?

Than you so much,
Andrea

Re: Connection problem 1 day after server start

PostPosted:Fri Mar 23, 2012 11:01 am
by jllort
you could take a look at repository/default and into some subfolder there is workspace.xml

really I don't know why you get this error. I should be done a revision in deep, try use same mysql driver that you used in 5.0.4 if it solves something, but as I said I think configuration is correctly.

Re: Connection problem 1 day after server start

PostPosted:Sun Mar 25, 2012 5:48 am
by vkasgpta
try with HSQL in 5.1 instead of mysql and see if it works?

Re: Connection problem 1 day after server start

PostPosted:Tue Mar 27, 2012 7:47 pm
by andrea.todeschini
Hsql is a language, not a database. How do you intend to use hsql instead of mysql? Can you explain me where do I have to change my code?

Thank you so much!

Andrea

Re: Connection problem 1 day after server start

PostPosted:Sat Apr 07, 2012 6:59 am
by vkasgpta
the default installation without any changes inside the files will be using HSQL db, i noticed your file showed mysql...? not sure if thats default setting or changed...

Re: Connection problem 1 day after server start

PostPosted:Sat Apr 14, 2012 8:20 am
by andrea.todeschini
I need to use mysql, so I have changed the default settings, where do I have to restore setting if I still want to use MySql?

Thans,
Andrea

Re: Connection problem 1 day after server start

PostPosted:Sun Apr 15, 2012 8:17 am
by jllort
After OpenKM has started with some database only can be changed on migration procedure, not with yet started openkm repository.