cancel
Showing results for 
Search instead for 
Did you mean: 

Problem using Alfresco in Embedded way

alestudent
Champ in-the-making
Champ in-the-making
Hi,

i try to use alfresco in the embedded way.
First of all i look at FirstFoundationClient in sdk; i see that it use alfresco embedded sdk project to work; i start it and it work correctly also obtaining at the starting point the application context object from application-context.xml file.
So i try the same operations but not including alfrescoEmbedded sdk project in my library. So i try to obtain ApplicationContext object but i have the following exception:
——————————————————————————————————————————————–
EXCEPTION:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'luceneFullTextSearchIndexer' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'indexerAndSearcherFactory' while setting bean property 'indexerAndSearcherFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'indexerAndSearcherFactory' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'admLuceneIndexerAndSearcherFactory' while setting bean property 'defaultBinding'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'admLuceneIndexerAndSearcherFactory' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'mlAwareNodeService' while setting bean property 'nodeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mlAwareNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'dbNodeService' while setting bean property 'defaultBinding'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'dbNodeServiceImpl' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbNodeServiceImpl' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'dictionaryService' while setting bean property 'dictionaryService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dictionaryBootstrap' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'dictionaryDAO' while setting bean property 'dictionaryDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dictionaryDAO' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'namespaceDAO' while setting constructor argument with index 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'namespaceDAO' defined in class path resource [alfresco/core-services-context.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'tenantService' of bean class [org.alfresco.repo.dictionary.NamespaceDAOImpl]: Bean property 'tenantService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'indexerAndSearcherFactory' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'admLuceneIndexerAndSearcherFactory' while setting bean property 'defaultBinding'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'admLuceneIndexerAndSearcherFactory' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'mlAwareNodeService' while setting bean property 'nodeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mlAwareNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'dbNodeService' while setting bean property 'defaultBinding'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'dbNodeServiceImpl' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbNodeServiceImpl' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'dictionaryService' while setting bean property 'dictionaryService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dictionaryBootstrap' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'dictionaryDAO' while setting bean property 'dictionaryDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dictionaryDAO' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'namespaceDAO' while setting constructor argument with index 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'namespaceDAO' defined in class path resource [alfresco/core-services-context.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'tenantService' of bean class [org.alfresco.repo.dictionary.NamespaceDAOImpl]: Bean property 'tenantService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'admLuceneIndexerAndSearcherFactory' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'mlAwareNodeService' while setting bean property 'nodeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mlAwareNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'dbNodeService' while setting bean property 'defaultBinding'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'dbNodeServiceImpl' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbNodeServiceImpl' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'dictionaryService' while setting bean property 'dictionaryService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dictionaryBootstrap' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'dictionaryDAO' while setting bean property 'dictionaryDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dictionaryDAO' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'namespaceDAO' while setting constructor argument with index 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'namespaceDAO' defined in class path resource [alfresco/core-services-context.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'tenantService' of bean class [org.alfresco.repo.dictionary.NamespaceDAOImpl]: Bean property 'tenantService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mlAwareNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'dbNodeService' while setting bean property 'defaultBinding'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'dbNodeServiceImpl' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbNodeServiceImpl' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'dictionaryService' while setting bean property 'dictionaryService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dictionaryBootstrap' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'dictionaryDAO' while setting bean property 'dictionaryDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dictionaryDAO' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'namespaceDAO' while setting constructor argument with index 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'namespaceDAO' defined in class path resource [alfresco/core-services-context.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'tenantService' of bean class [org.alfresco.repo.dictionary.NamespaceDAOImpl]: Bean property 'tenantService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbNodeService' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'dbNodeServiceImpl' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbNodeServiceImpl' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'dictionaryService' while setting bean property 'dictionaryService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dictionaryBootstrap' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'dictionaryDAO' while setting bean property 'dictionaryDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dictionaryDAO' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'namespaceDAO' while setting constructor argument with index 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'namespaceDAO' defined in class path resource [alfresco/core-services-context.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'tenantService' of bean class [org.alfresco.repo.dictionary.NamespaceDAOImpl]: Bean property 'tenantService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbNodeServiceImpl' defined in class path resource [alfresco/node-services-context.xml]: Cannot resolve reference to bean 'dictionaryService' while setting bean property 'dictionaryService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dictionaryBootstrap' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'dictionaryDAO' while setting bean property 'dictionaryDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dictionaryDAO' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'namespaceDAO' while setting constructor argument with index 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'namespaceDAO' defined in class path resource [alfresco/core-services-context.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'tenantService' of bean class [org.alfresco.repo.dictionary.NamespaceDAOImpl]: Bean property 'tenantService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dictionaryBootstrap' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'dictionaryDAO' while setting bean property 'dictionaryDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dictionaryDAO' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'namespaceDAO' while setting constructor argument with index 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'namespaceDAO' defined in class path resource [alfresco/core-services-context.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'tenantService' of bean class [org.alfresco.repo.dictionary.NamespaceDAOImpl]: Bean property 'tenantService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dictionaryDAO' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'namespaceDAO' while setting constructor argument with index 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'namespaceDAO' defined in class path resource [alfresco/core-services-context.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'tenantService' of bean class [org.alfresco.repo.dictionary.NamespaceDAOImpl]: Bean property 'tenantService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'namespaceDAO' defined in class path resource [alfresco/core-services-context.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'tenantService' of bean class [org.alfresco.repo.dictionary.NamespaceDAOImpl]: Bean property 'tenantService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'tenantService' of bean class [org.alfresco.repo.dictionary.NamespaceDAOImpl]: Bean property 'tenantService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
   at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:748)
   at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:606)
   at org.springframework.beans.AbstractPropertyAccessor.setPropertyValue(AbstractPropertyAccessor.java:49)
   at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:74)
   at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:57)
   at org.springframework.beans.factory.support.AbstractBeanFactory.applyPropertyValues(AbstractBeanFactory.java:840)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1026)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:809)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:245)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:124)
   at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:316)
   at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:91)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:745)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:683)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:388)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:245)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:124)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1019)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:809)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:341)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:245)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:124)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1019)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:809)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:245)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:124)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1019)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:809)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:245)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:124)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1019)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:809)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:245)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:124)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1019)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:809)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:245)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:124)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1019)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:809)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:245)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:124)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1019)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:809)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
   at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:642)
   at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:419)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:328)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:68)
   at it.saga.egov.esi.cms.utility.TestEmbedded.main(TestEmbedded.java:22)

END EXCEPTION
—————————————————————————————————————————————————
I'm using alfresco community 2.1.0 tomcat boundled; when i invoke the method "ApplicationContext ctx = new ClassPathXmlApplicationContext("alfresco/application-context.xml")", i tried to set also the absolute path to application-context.xml file that in my case is "C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/application-context.xml" AND IN THIS CASE I OBTAIN A FileNotFoundException.

I'VE READ IN OTHER TOPICS THAT USING WEBAPPS LIKE TOMCAT THE METHOD ApplicationContext ctx = new ClassPathXmlApplicationContext("alfresco/application-context.xml") DOESN'T WORK CORRECTLY ALSO USING ABSOLUTE PATH AS I DID.

CAN SOMEONE HELP ME TO RESOLVE THIS PROBLEM?
5 REPLIES 5

pmonks
Star Contributor
Star Contributor
It's preferable to use org.alfresco.util.ApplicationContextHelper.getApplicationContext() (http://dev.alfresco.com/resource/docs/java/repository/org/alfresco/util/ApplicationContextHelper.htm...) to obtain the Alfresco app context in an embedded context, since it hides a lot of those low level details about where Alfresco bean definitions can reside and how they can be (safely) overridden.

Cheers,
Peter

alestudent
Champ in-the-making
Champ in-the-making
Hi Peter,
i followed what you told me, and now i have this exception:

org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [alfresco/application-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [alfresco/application-context.xml] cannot be opened because it does not exist
Caused by: java.io.FileNotFoundException: class path resource [alfresco/application-context.xml] cannot be opened because it does not exist

———————————————————————————————————————————————
MY CODE IS VERY SIMPLE, I POSTED IT BELOW:

public class TestEmbedded {
   
   public static void main (String[] args)
   {
      EsiCmsUtility obj1 = new EsiCmsUtility();
      //AbstractLoginResult alr;
      try{
         
         ApplicationContext ac = ApplicationContextHelper.getApplicationContext(); <–HERE I HAVE THE EXCEPTION
         //System.out.println("Context obtained");
         //alr = obj1.login("admin", "admin");
      
      }catch(Exception err)
      {
         err.printStackTrace();
      }   
   }

}

———————————————————————————————————————————–
CAN YOU HELP ME PLEASE?

pmonks
Star Contributor
Star Contributor
This suggests that the classpath of the program is incomplete, since the main application-context.xml file is part of the Alfresco repository package (which contains the core repository functionality).

I'd suggest taking a look at how the "SDK FirstFoundationClient" Eclipse project is configured, and then configure your project the same way.  The FirstFoundationClient is a fully worked, functional example of how to develop against an embedded Alfresco repository.  More details on how to obtain this sample and configure your Eclipse environment to support building / running it are available at http://wiki.alfresco.com/wiki/Alfresco_SVN_Development_Environment#Eclipse_Projects.

Cheers,
Peter

alestudent
Champ in-the-making
Champ in-the-making
Hi Peter,
i have imported all references to jar files and other useful files following alfresco embedded sdk project, and now i have the exception posted below:

java.lang.NullPointerException
   at org.alfresco.util.RuntimeSystemPropertiesSetter.postProcessBeanFactory(RuntimeSystemPropertiesSetter.java:68)
   at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:414)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:328)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
   at org.alfresco.util.ApplicationContextHelper.getApplicationContext(ApplicationContextHelper.java:55)
   at it.saga.egov.esi.cms.utility.TestEmbedded.main(TestEmbedded.java:19)
————————————————————————————————————————————————–

I READ SOME TOPICS AND I SEE THAT PROBABLY IT IS A PROBLEM WITH "alfresco-jmxrmi.access" AND "alfresco-jmxrmi.password" FILES.
WHAT I CAN DO NOW? CAN YOU SUGGEST ME SOMETHING?
THANKS IN ADVANCE
ALESSIO

alestudent
Champ in-the-making
Champ in-the-making
Hi,
I Have solved the problem! it was only because i used wrong jar file!

Using jar file given with sdk ( all alfresco jars, config jars and all dependences given in alfresco embedded sdk project) the problem is solved.
Now i can obtain the applicationContext. And now i try to implement some methods on alfresco embedded.