AnsweredAssumed Answered

Accessing Alfresco JCR: jcr-context.xml and alfresco-jcr.jar

Question asked by alexeyg on Feb 2, 2006
Latest reply on Apr 2, 2006 by peterm
Please tell me how I can access Alfresco from another Context in Tomcat. 

I use:
ApplicationContext context = new ClassPathXmlApplicationContext("classpath:org/alfresco/jcr-context.xml");

and get:

"java.io.FileNotFoundException: class path resource [org/alfresco/jcr-context.xml] cannot be opened because it does not exist"

Steps:

Downloaded and installed Alfresco-Tomcat bundle.

Set up and ran Alfresco.  All is good.

Created another webapp meant to use Alfresco JCR.

According to:
http://www.alfresco.org/mediawiki/index.php/Introducing_the_Alfresco_Java_Content_Repository_API

I did:
ApplicationContext context = new ClassPathXmlApplicationContext("classpath:org/alfresco/jcr-context.xml");
Repository repository = (Repository)context.getBean("JCR.Repository");

Resolved several ClassNotFound exeptions (had to drop jcr JAR into tomcat).

Now I get:

java.io.FileNotFoundException: class path resource [org/alfresco/jcr-context.xml] cannot be opened because it does not exist

Is this happening because Alfresco and myApp are in different Tomcat contexts? 

I searched everywhere for jcr-context.xml and indeed it is nowhere to be found (my app or Alfresco).  Neither is alcresco-jcr.jar.

thank you!

Outcomes