cancel
Showing results for 
Search instead for 
Did you mean: 

error instance of ServiceRegistry

thibaut
Champ in-the-making
Champ in-the-making
Hello,

i'm trying to implement a web Service for Alfresco .

In oder to instantiate a new serviceregistry reference i do

ApplicationContext ctx = ApplicationContextHelper.getApplicationContext();

I have deployed my Web service and when I try call the remote methoden this error occured

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'workflowScheduler' defined in class path resource [alfresco/bootstrap-context.xml]: Cannot resolve reference to bean 'jbpm_template' while setting bean property 'JBPMTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jbpm_template' defined in class path resource [alfresco/workflow-context.xml]: Cannot resolve reference to bean 'jbpm_configuration' while setting constructor argument with index 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jbpm_configuration' defined in class path resource [alfresco/workflow-context.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: a beanFactoryReference already exists for key jbpm_configuration

I really don't understand .
Please help me !

Thanks
thibaut
3 REPLIES 3

derek
Star Contributor
Star Contributor
Hi,

You can only have one instance of the application context.  The method you are using instantiates a new singleton context for standalone applications.  However, if you are operating in the context of the web application, then one already exists.  That is the one you need to get hold of.

Are you running Alfresco within a standalone Java application or within the web application?  Do you know how to get the application context using Spring's ApplicationContextAware class?

Regards

teron_lsde
Champ in-the-making
Champ in-the-making
Do you know how to get the application context using Spring's ApplicationContextAware class?

Regards

I would like to know. Could you provide a code snipplet? Thank you very much.