cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble accessing Alfresco repository

s0110655
Champ in-the-making
Champ in-the-making
Hello,

I want to follow the Introducing_the_Alfresco_Java_Content_Repository_API tutorial but I got stuck on the following line of code:

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

This is the stacktrace that is printed out:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
   at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:127)
   at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:159)
   at org.springframework.context.support.AbstractRefreshableApplicationContext.<init>(AbstractRefreshableApplicationContext.java:66)
   at org.springframework.context.support.AbstractXmlApplicationContext.<init>(AbstractXmlApplicationContext.java:49)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:65)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:56)
   at Remote_Test.main(Remote_Test.java:49)

Can anyone tell what's going wrong here and which path I should enter for retrieving my jcr-context.xml file?

Thank you,
Steven
2 REPLIES 2

davidc
Star Contributor
Star Contributor
The error stack implies you do not have the appropriate dependent .jar files in your classpath.  In the downloadable source bundle, there are eclipse projects (in particular 3rdParty) which demonstrate the jars required.

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

I added all the jars to my project and it works… I have some new errors now but I will try to solve them myself first. If I get stuck again I will post a new topic.

Thanks a lot for the tip!