AnsweredAssumed Answered

Service Registry Implementation??? Not Found in Spring

Question asked by felipe on Mar 31, 2006
Latest reply on Jul 30, 2006 by seshu
I've tried a simple example in order to connect to the Alfresco's Repository.

ApplicationContext context = new ClassPathXmlApplicationContext("ws/bean.xml");
// Retrieve Repository
Repository repository = (Repository)context.getBean("JCR.Repository");

I've a structure like this (package ws) with a spring config file bean.xml
<bean id="JCR.Repository" class="org.alfresco.jcr.repository.RepositoryImpl" init-method="init">
  <property name="serviceRegistry">
    <ref bean="ServiceRegistry"/>
  <property name="defaultWorkspace">

The error is :
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'JCR.Repository' defined in class path resource [ws/bean.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Service Registry has not been specified.
java.lang.IllegalStateException: Service Registry has not been specified.
   at org.alfresco.jcr.repository.RepositoryImpl.init(
   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 ws.Simple.main(

The problem is: <ref bean="ServiceRegistry"/> ???
Where is the implementation of the interface(if there is one) that is referenced by this spring bean?
and if there isn't

How can I do?

Thanks for your reply.