cancel
Showing results for 
Search instead for 
Did you mean: 

JCR-RMI NOT A SOLUTION FOR THE MOMENT!

rdanner
Champ in-the-making
Champ in-the-making
Well we've been looking closer at JCR-RMI and at the moment its entirely busted.  As Lennard points out, due to the Thread Local strategy behind security and the JCR Session and the fact that the RMI server can run your remote object in whatever thread it wants you are very likely to have problems just using the Jackrabbit extension to use remote the JCR implementation. So don't waste any time messing with it.

I didn't see this problem back when I was playing with JCR/RMI because I was using the interface in very small conversations and under no real load.

We're going to try and work around the issue by managing threads on the server side and binding remote objects to the server side threads. 

I think the workaround has serious limitations like the number of open sessions (because it is directly related to the number of managed threads on the server side.)

If we get something working it will be posted here.  If you have thoughts on how to work around the issue please post them!
16 REPLIES 16

finner
Champ in-the-making
Champ in-the-making
Hi Russ,
Thanks for a very speedy reply !!
I removed the jackrabbit-jcr-rmi-1-3-1.jar and replaced it with the jcr-rmi-1-impl-classes.jar and now I can read and add a nodes in an Alfresco repo without errors. The Web Client isn't displaying the newly added nodes for some reason though…. ?
Anyway, for anyone who may be interested:
My test program has the following JARS in the classpath
- jcr-1.0.jar
- extension-jcr-thread-bound.jar
- extension-jcr-rmi.jar
- jcr-rmi-1-impl-classes.jar

Cheers
Finner

vijay_alfresco
Champ in-the-making
Champ in-the-making
Hi Finner,

Could you please post code of the client calling sequence

Thanks,
Vijay

incanus
Champ in-the-making
Champ in-the-making
I removed the jackrabbit-jcr-rmi-1-3-1.jar and replaced it with the jcr-rmi-1-impl-classes.jar and now I can read and add a nodes in an Alfresco repo without errors.

what about removing nodes? I've the same jars, and i can read an add nodes, but when i try to remove, it throws an exception. The same that it throws when the lucene index and the files are de-syncronized.

(sorry about my english)
thanx

EDIT: sometimes it throws a jdbd generic exception trying to insert a child association

rdanner
Champ in-the-making
Champ in-the-making
I removed the jackrabbit-jcr-rmi-1-3-1.jar and replaced it with the jcr-rmi-1-impl-classes.jar and now I can read and add a nodes in an Alfresco repo without errors.

what about removing nodes? I've the same jars, and i can read an add nodes, but when i try to remove, it throws an exception. The same that it throws when the lucene index and the files are de-syncronized.

(sorry about my english)
thanx

EDIT: sometimes it throws a jdbd generic exception trying to insert a child association

Hrmm
Can you post it?

incanus
Champ in-the-making
Champ in-the-making
here it is. i hope someone could see the problem


11:16:07,205 ERROR [alfresco.thread.WorkerThreadManager] error on dispatched met
hod [remove]
org.springframework.orm.hibernate3.HibernateJdbcException: JDBC exception on Hib
ernate data access; nested exception is org.hibernate.exception.GenericJDBCExcep
tion: could not insert: [org.alfresco.repo.domain.hibernate.ChildAssocImpl]
Caused by:
org.hibernate.exception.GenericJDBCException: could not insert: [org.alfresco.re
po.domain.hibernate.ChildAssocImpl]
        at org.hibernate.exception.SQLStateConverter.handledNonSpecificException
(SQLStateConverter.java:103)
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.j
ava:91)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelp
er.java:43)
        at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(Abstr
actReturningDelegate.java:40)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(Abstrac
tEntityPersister.java:2108)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(Abstrac
tEntityPersister.java:2588)
        at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentit
yInsertAction.java:48)
        at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
        at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplic
ate(AbstractSaveEventListener.java:290)
        at org.hibernate.event.def.AbstractSaveEventListener.performSave(Abstrac
tSaveEventListener.java:180)
        at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId
(AbstractSaveEventListener.java:108)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGene
ratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
        at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrR
equestedId(DefaultSaveEventListener.java:33)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTran
sient(DefaultSaveOrUpdateEventListener.java:175)
        at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(
DefaultSaveEventListener.java:27)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpda
te(DefaultSaveOrUpdateEventListener.java:70)
        at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
        at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
        at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
        at org.springframework.orm.hibernate3.HibernateTemplate$12.doInHibernate
(HibernateTemplate.java:630)
        at org.springframework.orm.hibernate3.HibernateTemplate.execute(Hibernat
eTemplate.java:367)
        at org.springframework.orm.hibernate3.HibernateTemplate.save(HibernateTe
mplate.java:627)
        at org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl.newCh
ildAssoc(HibernateNodeDaoServiceImpl.java:590)
        at sun.reflect.GeneratedMethodAccessor478.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflecti
on(AopUtils.java:281)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJo
inpoint(ReflectiveMethodInvocation.java:187)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:154)
        at org.alfresco.repo.transaction.TransactionalDaoInterceptor.invoke(Tran
sactionalDaoInterceptor.java:68)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:176)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynami
cAopProxy.java:210)
        at $Proxy1.newChildAssoc(Unknown Source)
        at org.alfresco.repo.node.db.DbNodeServiceImpl.moveNode(DbNodeServiceImp
l.java:439)
        at org.alfresco.repo.node.db.DbNodeServiceImpl.archiveNode(DbNodeService
Impl.java:1570)
        at org.alfresco.repo.node.db.DbNodeServiceImpl.deleteNode(DbNodeServiceI
mpl.java:737)
        at org.alfresco.repo.node.db.DbNodeServiceImpl.removeChild(DbNodeService
Impl.java:808)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflecti
on(AopUtils.java:281)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJo
inpoint(ReflectiveMethodInvocation.java:187)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:154)
        at org.alfresco.repo.transaction.TransactionResourceInterceptor.invoke(T
ransactionResourceInterceptor.java:138)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:176)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynami
cAopProxy.java:210)
        at $Proxy2.removeChild(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.alfresco.repo.service.StoreRedirectorProxyFactory$RedirectorInvoc
ationHandler.invoke(StoreRedirectorProxyFactory.java:221)
        at $Proxy3.removeChild(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflecti
on(AopUtils.java:281)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJo
inpoint(ReflectiveMethodInvocation.java:187)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:154)
        at org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterce
ptor.java:211)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:176)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynami
cAopProxy.java:210)
        at $Proxy2.removeChild(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflecti
on(AopUtils.java:281)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJo
inpoint(ReflectiveMethodInvocation.java:187)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:154)
        at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInter
ceptor.invoke(MethodSecurityInterceptor.java:80)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:176)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethod
Interceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:176)
        at org.alfresco.repo.audit.AuditComponentImpl.auditImpl(AuditComponentIm
pl.java:256)
        at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.j
ava:191)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInte
rceptor.java:69)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:176)
        at org.springframework.transaction.interceptor.TransactionInterceptor.in
voke(TransactionInterceptor.java:107)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:176)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynami
cAopProxy.java:210)
        at $Proxy2.removeChild(Unknown Source)
        at org.alfresco.jcr.item.NodeImpl.remove(NodeImpl.java:278)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.alfresco.jcr.util.JCRProxyFactory$SessionContextInvocationHandler
.invoke(JCRProxyFactory.java:138)
        at $Proxy92.remove(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.alfresco.thread.WorkerThreadImpl.run(WorkerThreadImpl.java:97)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:650)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:675)
        at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.SQLException: Lock wait timeout exceeded; try restarting tra
nsaction
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
        at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedSt
atement.java:1160)
        at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPrepared
Statement.java:685)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:1400)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:1314)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:1299)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(Del
egatingPreparedStatement.java:101)
        at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAn
dExtract(IdentityGenerator.java:73)
        at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(Abstr
actReturningDelegate.java:33)
        … 95 more

geraud
Champ in-the-making
Champ in-the-making
Hi,

I tried this code on another installation (I worked with another machine this week). I had to change the type of eActualException to Throwable, otherwise it didn't compile.

Now the following exception is thrown by the client :

java.lang.ClassCastException: $Proxy87
        at $Proxy86.getMixinNodeTypes(Unknown Source)
        at org.apache.jackrabbit.rmi.server.ServerNode.getMixinNodeTypes(ServerNode.java:178)

No exception is thrown on the server(alfresco)-side. I am not sure that this is the same problem… maybe it is due to a wrong config.

I found the problem : this kind of exception is thrown when a method returns an array of objects ( getMixinNodeTypes()  returns NodeType[]).
I've got the same problem while accessing locks stored in a session ( Session.getLockTokens() returns String[]).


Géraud

anediaz
Champ in-the-making
Champ in-the-making
Hi everybody,
I've tried several times to get the nodes of the root node, but aparently this is not possible. This is what I do:

"rootNode = vJcrSession.getRootNode();
NodeIterator iter = rootNode.getNodes();"


The error is the same as the others', the unmarshalling error.
I've added all the .jars mentioned in a older post, but I doesn't work.

What I'm trying to do is a search of content of a file, but instead of searching like this "/app:company_home/app:dictionary/app:scripts/cm:backup.js"
I would like to do the search just putting the names, like this "/Company Home/Data Dictionary/Scripts/backup.js"

Does anyone know how to do it? What I've thougth is to get all the nodes of the root node and search the nodes by the "cm:name" property, but I don't know how to do it.

I would really apreciate any help. Thanks