cancel
Showing results for 
Search instead for 
Did you mean: 

Behaviour

toze
Champ in-the-making
Champ in-the-making
Hi!

I have a behavior that its defined like this:

this.onUpdateProperties = new JavaBehaviour(this, "onUpdateProperties",   NotificationFrequency.TRANSACTION_COMMIT);
this.policyComponent.bindClassBehaviour(QName.createQName(nameSpace.ALFRESCO_URI, "onUpdateProperties"),
            ContentModel.PROP_NAME,   this.onUpdateProperties);

but it gives this error when starting server:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DocumentoBehavior' defined in class path resource [alfresco/module/sample/context/sample-service-context.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Class {http://www.alfresco.org/model/content/1.0}name has not been defined in the data dictionary

Can anyone help me with this?

Thanks
2 REPLIES 2

monicakumari
Star Contributor
Star Contributor

I also have the same issue. Can anyone help ?

afaust
Legendary Innovator
Legendary Innovator

The original poster simply made a mistake in their code. The call to bind the behaviour is incorrect. It should have been 

this.onUpdateProperties = new JavaBehaviour(this, "onUpdateProperties", NotificationFrequency.TRANSACTION_COMMIT);
this.policyComponent.bindClassBehaviour(OnUpdatePropertiesPolicy.QNAME, ContentModel.TYPE_CMOBJECT, this.onUpdateProperties);

You never bind on individual properties - you always bind on either the aspect or type of a node (the "class" of the node) - usually the one that defines the property.