cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco Via RMI

rdanner
Champ in-the-making
Champ in-the-making
For those interested:

I have put alfresco behind the JCR-RMI library from jackrabbit.
All i had to do was make a simple bean to register the repository and then leverage their client on the remote end.


I have a build for just the RMI-JCR and the additional alfresco config and classes.

I had done a significant portion of an RMI wrapper before I ran in to jackrabbit (I should be looking a little harder before i leap).

Works like a charm.  Their library does not use remote activation which I would like to include for robustness sake.
62 REPLIES 62

davidc
Star Contributor
Star Contributor
Russ, that's fantastic - I was hoping someone would try out that configuration, and I'm happy to hear it was successful.  We're working on level 2 now (aiming for release beginning of next year), so perhaps we can bundle the Jackrabbit RMI layer with that release too.  Just need to check it's valid - license etc.

rdanner
Champ in-the-making
Champ in-the-making
Russ, that's fantastic - I was hoping someone would try out that configuration, and I'm happy to hear it was successful.  We're working on level 2 now (aiming for release beginning of next year), so perhaps we can bundle the Jackrabbit RMI layer with that release too.  Just need to check it's valid - license etc.

I was successful in opening a remote session and pulling content based on an id then reading the content property.

I didnt test other level one functions but those worked great.


Heres the link to my work

http://www.posit-group.org/cache/jcr-rmi-alfresco.zip

rdanner
Champ in-the-making
Champ in-the-making
Russ, that's fantastic - I was hoping someone would try out that configuration, and I'm happy to hear it was successful.  We're working on level 2 now (aiming for release beginning of next year), so perhaps we can bundle the Jackrabbit RMI layer with that release too.  Just need to check it's valid - license etc.

I was successful in opening a remote session and pulling content based on an id then reading the content property.

I didnt test other level one functions but those worked great.


Heres the link to my work

http://www.posit-group.org/cache/jcr-rmi-alfresco.zip

I named the class that registers the RMI object something stupid like factory this or that… its not a good name.  also the class doesnt have any good stuff like logging (pretty unfinished) but good enough for jazz

davidc
Star Contributor
Star Contributor
I've downloaded and will take a look.  Thanks.

ananius
Champ in-the-making
Champ in-the-making
Hi,

I downloaded the package and was able to get the repository over RMI and login. But how am I supposed to handle transactions in the remote client? Where do i get the UserTransaction?

I have following code in the client:

ClientRepositoryFactory factory = new ClientRepositoryFactory();
Repository repository = factory.getRepository(rmiUrl);
SimpleCredentials credentials = new SimpleCredentials("admin", "admin".toCharArray());
Session session = repository.login(credentials);
Node rootNode = session.getRootNode();

And it throws exception:

javax.jcr.RepositoryException: Session must be used within the context of a transaction.

unsu
Champ in-the-making
Champ in-the-making
Folks,

I got stuck with the RMI access. I am trying to use rdanner’s RemoteJcrFactory in order to access the remote repository.

I ran out of ideas how to get it to work. First of all, am fairly new to JBoss, that might be an issue here.
I downloaded the night build alfresco-src-19122005.zip. I compile with default="build-jboss". The build goes through, so that the war file is correctly generated and deployed to the app server. I have noticed that all the jcr classes are not part of the main war file and are in the ..\projects\jcr\build\dist directory as a part of alfresco-jcr-tck.war.

I modified the configuration files rdanner mentioned to change:
repository.properties (the part with the RMI JCR Configuration)
application-context.xml (added <import resource="classpath:alfresco/jcr-rmi-context.xml" />)
and put the jcr-rmi-context.xml in the
..\jboss\server\default\conf\alfresco

Now, I copied the alfresco-jcr-tck.war manually into the
.. \jboss\server\default\deploy – is that correct?

Somehow starting the app server I get:
org.springframework.beans.factory.BeanDefinitionStoreException: Cannot register alias 'TransactionService' for bean name 'transactionComponent': it's already registered for bean name 'transactionComponent'

followed by tons of other exceptions.

I realized that e.g. application-context.xml is in the alfresco-jcr-tck.war and also in the conf\alfresco directory that probably causes some naming clashes.

Any ideas how to get the build correctly deployed?


Thanks
Joe

ananius
Champ in-the-making
Champ in-the-making
Somehow starting the app server I get:
org.springframework.beans.factory.BeanDefinitionStoreException: Cannot register alias 'TransactionService' for bean name 'transactionComponent': it's already registered for bean name 'transactionComponent'

followed by tons of other exceptions.

Hey Joe,

I think I had the same problem also, but got over it by commenting out the following line in jcr-context.xml:

<import resource="classpath:alfresco/application-context.xml" />

jcr-context.xml was imported in jcr-rmi-context.xml, which was imported in application-context.xml, so there was somekind of Spring circular import issue. Otherwise I did some things a bit different than you, but hope this helps. If you solve the transaction thing please let me know.

rdanner
Champ in-the-making
Champ in-the-making
Somehow starting the app server I get:
org.springframework.beans.factory.BeanDefinitionStoreException: Cannot register alias 'TransactionService' for bean name 'transactionComponent': it's already registered for bean name 'transactionComponent'

followed by tons of other exceptions.

Hey Joe,

I think I had the same problem also, but got over it by commenting out the following line in jcr-context.xml:

<import resource="classpath:alfresco/application-context.xml" />

jcr-context.xml was imported in jcr-rmi-context.xml, which was imported in application-context.xml, so there was somekind of Spring circular import issue. Otherwise I did some things a bit different than you, but hope this helps. If you solve the transaction thing please let me know.


Yes there was a bug there in the configuration file.  The reference to the JCR-Context.xml and jcr-rmi-context.xml need to go in application-context.xml

the reference to application-context.xml should not appear in either file

fraser_crichton
Champ in-the-making
Champ in-the-making
Hi, Russ,

I'm trying to get RMI access as well. I was trying to get to your download (http://www.posit-group.org/cache/jcr-rmi-alfresco.zip) but the link's broken, any chance you could make it available somewhere else?

Cheers,

Fraser