You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Robert Oschwald <ro...@symentis.com> on 2010/11/11 10:15:38 UTC

JackRabbit 2.0.0 Communications link failure

Hi folks,

I use JackRabbit 2.0.0-core in one of my Spring projects with MySQL. 
I get the following messages if I do not use the repository for a longer time:

ERROR org.apache.jackrabbit.core.persistence.bundle.ConnectionRecoveryManager - could not execute statement, reason: Communications link failure
The last packet successfully received from the server was 31,174,813 milliseconds ago.  The last packet sent successfully to the server was 0 milliseconds ago., state/code: 08S01/0

and after a while:
ERROR org.apache.jackrabbit.core.persistence.bundle.ConnectionRecoveryManager - could not execute statement, reason: The last packet successfully received from the server was 39,618,240 milliseconds ago.  The last packet sent successfully to the server was 39,618,240 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., state/code: 08S01/0

I read few notes on the internet, some of them are really scaring saying the repository might be corrupted.

So I exported/imported the repository to a new deployment but receive exactly the same messages.
In my app, I do not recognize any problems.

Here is my repository.xml file. Maybe I got a configuration problem?

<Repository>
    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
      <param name="path" value="/jcr_repo/content/repository"/>
    </FileSystem>

    <DataStore class="org.apache.jackrabbit.core.data.FileDataStore">
  	  <param name="path" value="/jcr_repo/content/repository/datastore"/>
	</DataStore>

    <Security appName="Jackrabbit">
        <SecurityManager class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager" workspaceName="security">
        </SecurityManager>

        <AccessManager class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager">
        </AccessManager>

        <LoginModule class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule">
           <param name="anonymousId" value="anonymous"/>
           <param name="adminId" value="xxx"/>
        </LoginModule>
    </Security>

    <Workspaces rootPath="/jcr_repo/content/workspaces" defaultWorkspace="default"/>
    
    <Workspace name="${wsp.name}">
        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${wsp.home}"/>
        </FileSystem>

	<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/myapp_jcr" />
	      <param name="schema" value="mysql"/><!-- db type -->
	      <param name="user" value="yyy"/>
	      <param name="password" value="ZZZ" />
	      <param name="schemaObjectPrefix" value="${wsp.name}_" />
	      <param name="externalBLOBs" value="true" /> <!-- store binary data in filesystem -->
	</PersistenceManager>

        <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            <param name="path" value="${wsp.home}/index"/>
            <param name="supportHighlighting" value="true"/>
        </SearchIndex>
    </Workspace>

    <Versioning rootPath="/jcr_repo/content/version">
        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="/jcr_repo/content/version" />
        </FileSystem>

	<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/myapp_jcr" />
  	      <param name="user" value="yyy"/>
  	      <param name="password" value="ZZZ" />
              <param name="schemaObjectPrefix" value="version_" />
	</PersistenceManager>
    </Versioning>

    <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
        <param name="path" value="/jcr_repo/content/repository/index"/>
        <param name="supportHighlighting" value="true"/>
    </SearchIndex>
</Repository>

RE: JackRabbit 2.0.0 Communications link failure

Posted by Jukka Zitting <jz...@adobe.com>.
Hi,

From: Robert Oschwald [mailto:roos@symentis.com]
> I thought the bundle persistence manager correctly recovers lost
> connections since 1.4...

Correct. The log entries in your case are coming from the connection recovery code. I guess there's some problem in that code if the repository doesn't recover in your case.

> If I need to switch from bundle to pool, I assume I need to
> export/import the repo, right?

No, the pooled persistence managers are fully compatible with the respective bundle PMs. The only change is the way in which they handle database connections, and they even support the exact same configuration parameters as the bundle PMs. You should be able to switch by simply changing the package name in your workspace.xml (and repository.xml) files.

BR,

Jukka Zitting

Re: JackRabbit 2.0.0 Communications link failure

Posted by Robert Oschwald <ro...@symentis.com>.
Jutta, thanks for the info.

I thought the bundle persistence manager correctly recovers lost connections since 1.4...
Is it possible to set a test query like in dbcp connection pools if using the bundle persistence manager?
Maybe this is only a cosmetic bug?

If I need to switch from bundle to pool, I assume I need to export/import the repo, right?
Robert


Am 11.11.2010 um 10:53 schrieb Jukka Zitting:

> Hi,
> 
> From: Robert Oschwald [mailto:roos@symentis.com]
>> I use JackRabbit 2.0.0-core in one of my Spring projects with MySQL.
>> I get the following messages if I do not use the repository for a
>> longer time:
> 
> These are caused by MySQL automatically terminating client connections after they've been unused for a longer period of time. The connection recovery code in Jackrabbit tries to recover from this, but it looks like the recovery doesn't work in your case.
> 
>> org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager
> 
> You might want to try switching to o.a.j.core.persistence.pool.MySqlPersistenceManager (note the s/bundle/pool/), as it uses a connection pool instead of a single persistent connection for accessing the repository. The pool is more resilient against forcibly terminated connections.
> 
> BR,
> 
> Jukka Zitting


RE: JackRabbit 2.0.0 Communications link failure

Posted by Jukka Zitting <jz...@adobe.com>.
Hi,

From: Robert Oschwald [mailto:roos@symentis.com]
> I use JackRabbit 2.0.0-core in one of my Spring projects with MySQL.
> I get the following messages if I do not use the repository for a
> longer time:

These are caused by MySQL automatically terminating client connections after they've been unused for a longer period of time. The connection recovery code in Jackrabbit tries to recover from this, but it looks like the recovery doesn't work in your case.

> org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager

You might want to try switching to o.a.j.core.persistence.pool.MySqlPersistenceManager (note the s/bundle/pool/), as it uses a connection pool instead of a single persistent connection for accessing the repository. The pool is more resilient against forcibly terminated connections.

BR,

Jukka Zitting