jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 小川 貴裕 <og...@brainsellers.com>
Subject InvalidItemStateException on clustering jackrabbit
Date Fri, 13 Feb 2009 06:43:50 GMT
Dear all,
I'm a test engeneer in Japan.

We deploy jackrabbit-webapp 1.4 for our application to store pdf documents.
And I am reserching how to use jackrabbit on clustering servers.

In our test on clustering jackrabbit with shared repository on MySQL5.1,
An InvalidItemStateException occurs when registering documents
simultaneously from 2 nodes.

--
>Caused by: javax.jcr.InvalidItemStateException:
> cafebabe-cafe-babe-cafe-babecafebabe has been modified externally
> at org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException
> (ServerObject.java:104)
> at
org.apache.jackrabbit.rmi.server.ServerSession.save(ServerSession.java:212)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke
> (DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
--

It seems very serious, but check SQL trace from MySQL, this failed
connection
issues only some select and gives up.

--
> 5 Query SHOW WARNINGS
> 5 Query /* mysql-connector-java-5.1.7 ( Revision: ${svn.Revision} )
*/SELECT @@session.auto_increment_increment
> 5 Query SHOW COLLATION
> 5 Query SET character_set_results = NULL
> 5 Query SET autocommit=1
> 5 Query select BUNDLE_DATA from PM_WS_BUNDLE where NODE_ID =
x'CAFEBABECAFEBABECAFEBABECAFEBABE'
> 5 Query select BUNDLE_DATA from PM_WS_BUNDLE where NODE_ID =
x'C74FA522295945668895FDDFA07BDEF1'
> 5 Query select BUNDLE_DATA from PM_WS_BUNDLE where NODE_ID =
x'2F0E18E2B49343CDADE6B6A5A01F74FE'
--

So, this connection does nothing harm to the repository,
and after a few seconds, same API call succeeds and documents
can be stored and read.

I have tried transaction-isolation setting at my.ini, then,
tried to use Oracle10, but same Exception occurs.

Then, this should be jackrabbit problem, I think.
I've tried FineGrainedISMLocking of jackrabbit, but nothing changed...

It seemes to me that there are many users operating jackrabbit
on clustering servers and no one have met this problem.
So I think something is wrong with us( =repository.xml)...

<<< Please help us. Any suggestion is appreciated. >>>

But Yesterday, I found JCR-1940, it is still opened...

> (JCR-1940)
> Date: Jan 19, 2009 4:41:35 am
> Reporter: Richa Khurana
> Priority: Blocker
>
> We have a enabled jackrabbit clustering. In this mode following
exception occurswhen 2 users simultaneouly add documents to Jack rabbit
repository registeredwith node id 1 and 2 respectively-
>
> 14:59:55,312 ERROR [DocumentHelper] Exception occurred while adding a
manuallyuploaded document to the jackrabbit:
> javax.jcr.InvalidItemStateException:
cafebabe-cafe-babe-cafe-babecafebabe hasbeen modified externally
> at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1109)
> at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:846)

...If there is no measure, we have to add some codes to catch this Exception
and retry after a few random seconds.
But I think it should be the last measure.

Thank you for reading long question.

----
Takahiro OGAWA <ogawa(at)brainsellers.com>
<http://www.brainsellers.com/>

----an extract from our repository.xml----
<Repository>

<FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
<param name="driver" value="com.mysql.jdbc.Driver"/>
<param name="url" value="jdbc:mysql://192.168.0.131:3306/jackrabbit"/>
<param name="user" value="jackrabbit"/>
<param name="password" value="jackrabbit"/>
<param name="schema" value="mysql"/>
<param name="schemaObjectPrefix" value="FS_REPO_"/>
</FileSystem>

<!--
security configuration
-->
<Security appName="Jackrabbit">
<!--
access manager:
class: FQN of class implementing the AccessManager interface
-->
<AccessManager
class="org.apache.jackrabbit.core.security.SimpleAccessManager">
<!-- <param name="config" value="${rep.home}/access.xml"/> -->
</AccessManager>

<LoginModule class="org.apache.catalina.realm.JAASMemoryLoginModule">
<!-- anonymous user name ('anonymous' is the default value) -->
</LoginModule>
</Security>

<!--
location of workspaces root directory and name of default workspace
-->
<Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/>

<!--
workspace configuration template:
used to create the initial workspace if there's no workspace yet
-->
<Workspace name="${wsp.name}">
<FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
<param name="driver" value="com.mysql.jdbc.Driver"/>
<param name="url" value="jdbc:mysql://192.168.0.131:3306/jackrabbit"/>
<param name="user" value="jackrabbit"/>
<param name="password" value="jackrabbit"/>
<param name="schema" value="mysql"/>
<param name="schemaObjectPrefix" value="FS_WS_"/>
</FileSystem>

<PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager">
<param name="url" value="jdbc:mysql://192.168.0.131:3306/jackrabbit"/>
<param name="user" value="jackrabbit" />
<param name="password" value="jackrabbit" />
<param name="schema" value="mysql"/>
<param name="schemaObjectPrefix" value="PM_WS_"/>
</PersistenceManager>

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

<!--
Configures the versioning
-->
<Versioning rootPath="${rep.home}/version">
<FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
<param name="driver" value="com.mysql.jdbc.Driver"/>
<param name="url" value="jdbc:mysql://192.168.0.131:3306/jackrabbit"/>
<param name="user" value="jackrabbit"/>
<param name="password" value="jackrabbit"/>
<param name="schema" value="mysql"/>
<param name="schemaObjectPrefix" value="FS_VER_"/>
</FileSystem>

<PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager">
<param name="url" value="jdbc:mysql://192.168.0.131:3306/jackrabbit"/>
<param name="user" value="jackrabbit" />
<param name="password" value="jackrabbit" />
<param name="schema" value="mysql"/>
<param name="schemaObjectPrefix" value="PM_VER_"/>
</PersistenceManager>
<ISMLocking
class="org.apache.jackrabbit.core.state.FineGrainedISMLocking">
</ISMLocking>
</Versioning>

<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
<param name="path" value="${rep.home}/repository/index"/>
</SearchIndex>

<Cluster id="node1">
<Journal class="org.apache.jackrabbit.core.journal.DatabaseJournal">
<param name="revision" value="${rep.home}/revision"/>
<param name="driver" value="com.mysql.jdbc.Driver"/>
<param name="url" value="jdbc:mysql://192.168.0.131:3306/jackrabbit"/>
<param name="user" value="jackrabbit"/>
<param name="password" value="jackrabbit"/>
<param name="schema" value="mysql"/>
<param name="schemaObjectPrefix" value="JOURNAL_"/>
</Journal>
</Cluster>

</Repository>


Mime
View raw message