cancel
Showing results for 
Search instead for 
Did you mean: 

JCR vs. JCR-RMI

carnby
Champ in-the-making
Champ in-the-making
I've read the wiki and forums, but it's still a little unclear to me when RMI is required to access the repository…
We are planning on using Liferay portal in combination with Alfresco CMS. If they are both running on the same Tomcat / JBoss server, do the liferay portlets have to connect to the repository through JCR-RMI or can they communicate directly with the JCR?

If anyone out there is using the Liferay/Alfresco combination I'd be interested in hearing how you went about it…

Thanks
14 REPLIES 14

carnby
Champ in-the-making
Champ in-the-making
*crickets chirping*


Anyways, I've been trying to run FirstFoundationClient and FirstJCRClient with little success… The error I get is:

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serverConnector' defined in class path resource [alfresco/core-services-context.xml]: Initialization of bean failed; nested exception is java.io.IOException: Cannot bind to URL [rmi://localhost:50500/alfresco/jmxrmi]: javax.naming.NameAlreadyBoundException: alfresco/jmxrmi [Root exception is java.rmi.AlreadyBoundException: alfresco/jmxrmi]
java.io.IOException: Cannot bind to URL [rmi://localhost:50500/alfresco/jmxrmi]: javax.naming.NameAlreadyBoundException: alfresco/jmxrmi [Root exception is java.rmi.AlreadyBoundException: alfresco/jmxrmi]
   at javax.management.remote.rmi.RMIConnectorServer.newIOException(RMIConnectorServer.java:814)
   at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:431)
   at org.springframework.jmx.support.ConnectorServerFactoryBean.afterPropertiesSet(ConnectorServerFactoryBean.java:183)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1059)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
   at


Is it because it's using the wrong port? Any help would be much appreciated! I'm running Alfresco on JBoss, running the client through Eclipse…

ariyer
Champ in-the-making
Champ in-the-making
I'm stuck at the very same spot.  :? The one thing I'm doing different is not using Liferay. So, it's seems not to be a portal/database config issue, if that's any help.

I've tried with alfresco (tomcat) running and when it is shutdown. No difference really. So, it's prolly not tomcat config either. Did I forget to tweak Spring. Don't recall any instructions for that!!!

Where do I go from here :?:

rdanner
Champ in-the-making
Champ in-the-making
I've read the wiki and forums, but it's still a little unclear to me when RMI is required to access the repository…
We are planning on using Liferay portal in combination with Alfresco CMS. If they are both running on the same Tomcat / JBoss server, do the liferay portlets have to connect to the repository through JCR-RMI or can they communicate directly with the JCR?

If anyone out there is using the Liferay/Alfresco combination I'd be interested in hearing how you went about it…

Thanks


Sorry I have not responded to this – because I am very busy at the moment working on a Liferay/Alfresco deployment

You can do either.  JCR-RMI would be used if you don’t have access to an in-process repository.  By In-Process I mean that it’s in the same JVM (not the necessarily the same web app or class loader.)  Each of our nodes has a local repository under it which allows us to access the content via JCR (with a hint of Alfresco Foundation calls for fast searches) with local calls.  We export the JCR implementation in to JNDI and then pick it up with applications deployed in to the portal.  These local repositories are fed by a central Alfresco instance that has a much wider scope (enterprise content management vs content delivery.) 

Are you trying to link your own applications to the Alfresco JCR or Liferay’s?

Very to have missed this thread… I’ve been a little to busy to be active in the forums lately which is really drag’n me down.

rdanner
Champ in-the-making
Champ in-the-making
I'm stuck at the very same spot.  :? The one thing I'm doing different is not using Liferay. So, it's seems not to be a portal/database config issue, if that's any help.

I've tried with alfresco (tomcat) running and when it is shutdown. No difference really. So, it's prolly not tomcat config either. Did I forget to tweak Spring. Don't recall any instructions for that!!!

Where do I go from here :?:

Let me start off my saying i don't experience with the sample you guys are working with or time to check it out so I am going to ask some questions an maybe shoot from the hip.  If it helps… great.  If not, sorry about that.

Are you running Alfresco AND the sample?

If I had to take a guess, The sample probably loads the repository embedded in the sample application.  That would lead to two applications trying to attach to the same port and you would have a problem.

rdanner
Champ in-the-making
Champ in-the-making
I'm stuck at the very same spot.  :? The one thing I'm doing different is not using Liferay. So, it's seems not to be a portal/database config issue, if that's any help.

I've tried with alfresco (tomcat) running and when it is shutdown. No difference really. So, it's prolly not tomcat config either. Did I forget to tweak Spring. Don't recall any instructions for that!!!

Where do I go from here :?:

Let me start off my saying i don't experience with the sample you guys are working with or time to check it out so I am going to ask some questions an maybe shoot from the hip.  If it helps… great.  If not, sorry about that.

Are you running Alfresco AND the sample?

If I had to take a guess, The sample probably loads the repository embedded in the sample application.  That would lead to two applications trying to attach to the same port and you would have a problem.

ariyer
Champ in-the-making
Champ in-the-making
I've tried with alfresco (tomcat) running and when it is shutdown. No difference really. So, it's prolly not tomcat config either. Did I forget to tweak Spring. Don't recall any instructions for that!!!
Are you running Alfresco AND the sample?

If I had to take a guess, The sample probably loads the repository embedded in the sample application.  That would lead to two applications trying to attach to the same port and you would have a problem.
Thanks, I thought so too. But this is something else.
I removed the entries for "serverConnector" in the core-services-context.xml and started tomcat. The server startup didn't show the exception. (Yes, this exception occured on server startup too!)
Now, I shutdown tomcat (Alfresco) and ran the example. No change, the exception still occurs.
Meaning, the example is loading the bean using springframework with another reference.
Now, where's that and what does it need to get running? :roll:

carnby
Champ in-the-making
Champ in-the-making
Sorry I have not responded to this – because I am very busy at the moment working on a Liferay/Alfresco deployment

You can do either.  JCR-RMI would be used if you don’t have access to an in-process repository.  By In-Process I mean that it’s in the same JVM (not the necessarily the same web app or class loader.)  Each of our nodes has a local repository under it which allows us to access the content via JCR (with a hint of Alfresco Foundation calls for fast searches) with local calls.  We export the JCR implementation in to JNDI and then pick it up with applications deployed in to the portal.  These local repositories are fed by a central Alfresco instance that has a much wider scope (enterprise content management vs content delivery.) 

Are you trying to link your own applications to the Alfresco JCR or Liferay’s?

Very to have missed this thread… I’ve been a little to busy to be active in the forums lately which is really drag’n me down.
Thanks for the reply!
What I'm trying to do is simply accessing the data stored in Alfresco's JCR from portlets in Liferay… Liferay and Alfresco will be running on the same server. I'm not at all familiar with JNDI so I'm gonna read up on that.
I just want to make sure I'm going about this the right way. I get the impression that the Alfresco/Liferay combination is widely used, but I can't seem to find much code/help/documentation on tying the two together…
Right now I'm trying to write a portlet that just accesses the repository and gets the first node, but the compiler has a problem with the NodeService class;

    [javac]     25. import org.alfresco.service.cmr.repository.NodeService;
    [javac]                                                    ^———^
    [javac] *** Semantic Error: The class file "NodeService.class" in … has an invalid format (bad string annotation constant).

rdanner
Champ in-the-making
Champ in-the-making
Sorry I have not responded to this – because I am very busy at the moment working on a Liferay/Alfresco deployment

You can do either.  JCR-RMI would be used if you don’t have access to an in-process repository.  By In-Process I mean that it’s in the same JVM (not the necessarily the same web app or class loader.)  Each of our nodes has a local repository under it which allows us to access the content via JCR (with a hint of Alfresco Foundation calls for fast searches) with local calls.  We export the JCR implementation in to JNDI and then pick it up with applications deployed in to the portal.  These local repositories are fed by a central Alfresco instance that has a much wider scope (enterprise content management vs content delivery.) 

Are you trying to link your own applications to the Alfresco JCR or Liferay’s?

Very to have missed this thread… I’ve been a little to busy to be active in the forums lately which is really drag’n me down.
Thanks for the reply!
What I'm trying to do is simply accessing the data stored in Alfresco's JCR from portlets in Liferay… Liferay and Alfresco will be running on the same server. I'm not at all familiar with JNDI so I'm gonna read up on that.
I just want to make sure I'm going about this the right way. I get the impression that the Alfresco/Liferay combination is widely used, but I can't seem to find much code/help/documentation on tying the two together…
Right now I'm trying to write a portlet that just accesses the repository and gets the first node, but the compiler has a problem with the NodeService class;

    [javac]     25. import org.alfresco.service.cmr.repository.NodeService;
    [javac]                                                    ^———^
    [javac] *** Semantic Error: The class file "NodeService.class" in … has an invalid format (bad string annotation constant).



That error is related to the version of your java compiler.

Alfresco and Liferay are beginning to become widely used together.  It's a combination many people are finding useful.   Alfresco comes as a Liferay Portlet.  This lets you handle Content Workflow inside a portal (not delivery)  There are also a few portlets in Liferay now available (Luis Sala and Mike Young) that allow you to access content from Liferay via web services (not JCR.)

Have a look at this:
http://issues.alfresco.com/browse/AR-1131

It is by no means an ideal solution but it works with alfresco's current packaging.

devg
Champ in-the-making
Champ in-the-making
Hi,

Good to know that you can use either JCR or JCR-RMI. Now can anyone tell me how not to use RMI and not to try to connect to that port?

My JCR application worked fine with alfresco 2.0, now under 2.1 , it is trying to bind to 50500 and giving an error. I don't want it to bind to that port and I want it to work just like it did in 2.0.

Any help is appreciated.

Thanks
You can do either.  JCR-RMI would be used if you don�t have access to an in-process repository.  By In-Process I mean that it�s in the same JVM (not the necessarily the same web app or class loader.)  Each of our nodes has a local repository under it which allows us to access the content via JCR (with a hint of Alfresco Foundation calls for fast searches) with local calls.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.