cancel
Showing results for 
Search instead for 
Did you mean: 

ApplicationModel NoClassDefFoundError

simon
Champ in-the-making
Champ in-the-making
Alfresco,

I'm trying to implement my own bean that looks very similar as the SimpleWorkflow one. It should move a document when the action is triggered.

Here is a part of the code:

final NodeRef docNodeRef = new NodeRef(Repository.getStoreRef(), id);
NodeRef newParent = (NodeRef)nodeService.getProperty(docNodeRef, ApplicationModel.PROP_APPROVE_FOLDER);
nodeService.moveNode(docNodeRef,
      newParent,
      ContentModel.ASSOC_CONTAINS,
      nodeService.getPrimaryParent(docNodeRef).getQName());

The ContentModel seems to work fine but the ApplicationModel gives an error:

javax.faces.el.EvaluationException: Exception while invoking expression #{MyBean.approve}
caused by: java.lang.NoClassDefFoundError: org/alfresco/model/ApplicationModel

Any idea why? I imported the org.alfresco.model.ApplicationModel but should I register this in the faces-config as well (some Spring related issue maybe)? The ContentModel isn't and that doesn't break…

The error seems to indicate there is something missing but I suppose something as important as the ApplicationModel should be there, no?

Thanks!
1 REPLY 1

simon
Champ in-the-making
Champ in-the-making
It's solved…

For future reference: the code above is only valid for 2.x environments, older Alfresco systems, like our 1.4.3 Enterprise one need this:

NodeRef newParent = (NodeRef)nodeService.getProperty(docNodeRef, ContentModel.PROP_APPROVE_FOLDER);

Alfresco moved the ApplicationModel out of the ContentModel with 2.x.