Pages

Monday, May 19, 2014

Error creating bean with name 'XXX' defined in class path resource [XXX/context/service-context.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Class {XXX}XXX has not been defined in the data dictionary

I got the above error while adding custom behavior related to custom aspect using AMP (Alfresco Module Package) with Alfresco Maven SDK.

This is how I resolved that:

Each module requires a module context file (module-context.xml). This loads the Spring configuration for the module. 

Custom content models can be bootstrapped into the repository via Spring configuration added to the module context file.

You need to either import your custom-model-context.xml here or directly define the bean configuration for the custom model here as given below. 

  

References:

Module context file:http://docs.alfresco.com/4.2/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Fconcepts%2Fdev-extensions-modules-module-context.html

Adding module data:
http://docs.alfresco.com/4.2/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Fconcepts%2Fdev-extensions-modules-custom-model.html


1 comment: