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

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

I will check on the Alfresco wiki for implementing my own datastructure.  So you think that I can get my application to run on top of Alfresco using the same code as jackrabbit, if only I implement the correct datamodel, bootstrap configuration and dictionary service?

Thanks!
Steven

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

I will check on the Alfresco wiki for implementing my own datastructure.  So you think that I can get my application to run on top of Alfresco using the same code as jackrabbit, if only I implement the correct datamodel, bootstrap configuration and dictionary service?

Thanks!
Steven

I dont know if it will notify you – i editied my last post… figured i was leaving you hanging.  Yes it sounds like the out of the box model alfresco is using for the web client is not where you are going.  I could be misundertanding. 

Understand that the web client will not work if you change the model. And unless you work within the model your content will not show up in the webclient.  If you are looking for pure infrastructure from Alfresco then these configuration files are your clay for the shaping.

davidc
Star Contributor
Star Contributor
Hi,

You'll be able to execute the same client code as JackRabbit, but as Russ has pointed out, an Alfresco content model will need to be defined, to give some structure to the nodes.  Alfresco doesn't allow unstructured nodes through its JCR api it this time.

rdanner
Champ in-the-making
Champ in-the-making
I can help him out with that.  Maybe he can share his paper with us once its submitted. 

Lst night i dropped the jcr track war file into tomcat and it blew up.  the model, jcr-context.xml and a library or two were missing. 

Is this happening for you guys?  I am on a jet for 2 hours tonight… i cn fix it if it needs fixing.

davidc
Star Contributor
Star Contributor
The jcr support is not in the standard bundle.  It has to retrieved from the nightly build or built from svn.

rdanner
Champ in-the-making
Champ in-the-making
The jcr support is not in the standard bundle.  It has to retrieved from the nightly build or built from svn.

Sorry about that maybe I am not paying attention (making assumptions).  what is the afresco-jrc-trk.war file meant for?

davidc
Star Contributor
Star Contributor
No, I'm sorry - I made an assumption you were using the standard war file.  You're right, the alfresco-jcr-tck.war does have all jcr implementation bundled.  It's specifically for deploying into the JCR TCK test application, but there's no reason you can't use it stand-alone.

rdanner
Champ in-the-making
Champ in-the-making
No, I'm sorry - I made an assumption you were using the standard war file.  You're right, the alfresco-jcr-tck.war does have all jcr implementation bundled.  It's specifically for deploying into the JCR TCK test application, but there's no reason you can't use it stand-alone.

Ok understood.  It explodes when you deploy it.  Its looking for spring components that are not there and then classes in libraries that are not there.  You have to copy them in from the third party area and the jcr project

Thats not happing for you?

s0110655
Champ in-the-making
Champ in-the-making
Hi guys,

I followed your conversations and noticed your suggestion to deploy the alfresco-jcr-tck.war file since it already contains the necessary jcr implementations. I tried to do this and I got some errors, but after some modifications I got it up and running.  Here are the steps that I did to make it work:

1. place the alfresco-jcr-tck.war file in the webapps folder of tomcat
2. place the following .jars in the webapps\alfresco-jcr-tck\WEB-INF\lib folder:
* sprong-mock.jar (builded from the source code from the nightly builds)
* mysql-connector-java-3.1.12-bin.jar (available in the 3rd party folder)
* jcr-1.0.jar
3. place the jcr-context.xml file in the webapps\alfresco-jcr-tck\WEB-INF\classes\alfresco folder
4. place the jcrModel.xml file in the webapps\alfresco-jcr-tck\WEB-INF\classes\alfresco\model folder
5. In the patch-services-context.xml file located in the webapps\alfresco-jcr-tck\WEB-INF\classes\alfresco\patch folder I uncommented the following bean id's:
* patch.emailTemplatesFolder
* patch.emailTemplatesContent
==> I did this because I got errors that the patches could not be applied and I assume that I don't need these beans in order to get my project running

When I go to the Tomcat Web Application Manager with my browser, I see /alfresco-jcr-tck in the list of applications and it says 'true' in the running column so I guess that's a good sign…

Although alfresco is running, I still receive errors when starting up Tomcat.  Here is a printout of my stdout_20060401.log file:

12:28:45,031 ERROR [myfaces.util.LocaleUtils] Locale name null or empty, ignoring
12:29:02,859 INFO  [admin.patch.PatchExecuter] Checking for patches to apply …
12:29:02,937 INFO  [admin.patch.PatchExecuter] No patches were required.
12:29:03,593 INFO  [service.descriptor.DescriptorService] Alfresco JVM - v1.5.0_04-b05; maximum heap size 63,563MB
12:29:03,593 WARN  [service.descriptor.DescriptorService] Alfresco JVM - WARNING - maximum heap size 63,563MB is less than recommended 512MB
12:29:03,593 INFO  [service.descriptor.DescriptorService] Alfresco started (Community Network): Current version 1.3.0 (dev) schema 11 - Installed version 1.2.0 schema 6
12:29:03,609 ERROR [[Catalina].[localhost].[/alfresco-jcr-tck]] Servlet /alfresco-jcr-tck threw load() exception
java.lang.ClassNotFoundException: com.day.crx.jndi.provider.MemoryInitialContextFactory
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1332)
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
   at java.lang.ClassLoader.loadClassInternal(Unknown Source)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Unknown Source)
   at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
   at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
   at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
   at javax.naming.InitialContext.init(Unknown Source)
   at javax.naming.InitialContext.<init>(Unknown Source)
   at org.alfresco.jcr.tck.RepositoryStartupServlet.init(RepositoryStartupServlet.java:68)
   at javax.servlet.GenericServlet.init(GenericServlet.java:211)
   at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1091)
   at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:925)
   at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3857)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4118)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:788)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:677)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:473)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1102)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
   at org.apache.catalina.core.StandardService.start(StandardService.java:450)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
01.04.2006 12:29:04 *INFO * [Thread-1] RepositoryStartupServlet: RepositoryStartupServlet initializing… (RepositoryStartupServlet.java, line 84)
01.04.2006 12:29:04 *INFO * [Thread-1] RepositoryStartupServlet:   repository-home = C:\WINDOWS\system32\jackrabbit\repository (RepositoryStartupServlet.java, line 153)
01.04.2006 12:29:04 *INFO * [Thread-1] RepositoryStartupServlet:   repository-config = /WEB-INF/repository/repository.xml (RepositoryStartupServlet.java, line 161)
01.04.2006 12:29:04 *INFO * [Thread-1] RepositoryStartupServlet:   repository-name = jackrabbit.repository (RepositoryStartupServlet.java, line 178)
01.04.2006 12:29:05 *INFO * [Thread-1] LocalFileSystem: LocalFileSystem initialized at path C:\WINDOWS\system32\jackrabbit\repository\repository (LocalFileSystem.java, line 165)
01.04.2006 12:29:05 *INFO * [Thread-1] LocalFileSystem: LocalFileSystem initialized at path C:\WINDOWS\system32\jackrabbit\repository\workspaces\default\index (LocalFileSystem.java, line 165)
01.04.2006 12:29:06 *INFO * [Thread-1] NodeTypeRegistry: no custom node type definitions found (NodeTypeRegistry.java, line 1509)
01.04.2006 12:29:06 *INFO * [Thread-1] LocalFileSystem: LocalFileSystem initialized at path C:\WINDOWS\system32\jackrabbit\repository\version\blobs (LocalFileSystem.java, line 165)
01.04.2006 12:29:07 *INFO * [Thread-1] LocalFileSystem: LocalFileSystem initialized at path C:\WINDOWS\system32\jackrabbit\repository\workspaces\default\blobs (LocalFileSystem.java, line 165)
01.04.2006 12:29:08 *INFO * [Thread-1] RepositoryStartupServlet:   adding property to JNDI environment: java.naming.provider.url=http://www.apache.org/jackrabbit (RepositoryStartupServlet.java, line 219)
01.04.2006 12:29:08 *INFO * [Thread-1] RepositoryStartupServlet:   adding property to JNDI environment: java.naming.factory.initial=org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory (RepositoryStartupServlet.java, line 219)
01.04.2006 12:29:08 *INFO * [Thread-1] RepositoryStartupServlet: Repository bound to JNDI with name: jackrabbit.repository (RepositoryStartupServlet.java, line 228)
01.04.2006 12:29:08 *INFO * [Thread-1] RepositoryStartupServlet: Repository bound via RMI with name: //:1099/jackrabbit.repository (RepositoryStartupServlet.java, line 289)
01.04.2006 12:29:08 *INFO * [Thread-1] RepositoryStartupServlet: RepositoryStartupServlet initialized. (RepositoryStartupServlet.java, line 88)
01.04.2006 12:29:08 *INFO * [Thread-1] RepositoryAccessServlet: RepositoryAccessServlet initializing… (RepositoryAccessServlet.java, line 76)
01.04.2006 12:29:08 *INFO * [Thread-1] RepositoryAccessServlet:   adding property to JNDI environment: java.naming.provider.url=http://www.apache.org/jackrabbit (RepositoryAccessServlet.java, line 137)
01.04.2006 12:29:08 *INFO * [Thread-1] RepositoryAccessServlet:   adding property to JNDI environment: java.naming.factory.initial=org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory (RepositoryAccessServlet.java, line 137)
01.04.2006 12:29:08 *INFO * [Thread-1] RepositoryAccessServlet: Acquired repository via JNDI. (RepositoryAccessServlet.java, line 159)
01.04.2006 12:29:08 *INFO * [Thread-1] RepositoryAccessServlet: Jackrabbit v1.0-dev (RepositoryAccessServlet.java, line 103)
01.04.2006 12:29:08 *INFO * [Thread-1] RepositoryAccessServlet: RepositoryAccessServlet initialized. (RepositoryAccessServlet.java, line 105)
01.04.2006 12:29:08 *INFO * [Thread-1] SimpleWebdavServlet: resource-path-prefix = '/repository' (SimpleWebdavServlet.java, line 170)
01.04.2006 12:29:08 *INFO * [Thread-1] SimpleWebdavServlet: chain-catalog = '[org.apache.commons.chain.impl.CatalogBase: import-resource, export-collection, import-collection, export-resource]' (SimpleWebdavServlet.java, line 181)
01.04.2006 12:29:08 *INFO * [Thread-1] SimpleWebdavServlet: WWW-Authenticate header = 'Basic Realm=Jackrabbit Webdav Server' (SimpleWebdavServlet.java, line 187)

Any ideas on this?

The next step after starting the service without errors is to access the alfresco-jcr-tck.war through my java application.  I'll keep you guys up to date with my problems and maybe you could help my out then?

Thanks for your support and help!
Steven

rdanner
Champ in-the-making
Champ in-the-making
check the source out from svn … the jar file is missing from the distro from what i can tell. build the head.



svn co svn://www.alfresco.org/alfresco/HEAD

You will still need to copy jcr config in to web-client.
build and deploy the webclient jar.  I didnt try the tck with head

Also
Drop your database tables and kill your file system store (alf_data) its probably in the bin of tomcat

Alfresco will recreate the tables