cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Behavior

mtw999
Champ in-the-making
Champ in-the-making
Hi,

I created custom behavior (following ecmarchitect tutorial). When I start alfresco, I get an exception:

org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.mydev.alf.Rating] for bean with name 'ratingsbehaviour' defined in file [/home/alfrescodev/AlfrescoArtifacts/projecttemplate/config-share/alfresco/web-extension/custom-slingshot-miketrain-context.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/alfresco/repo/node/NodeServicePolicies$OnDeleteNodePolicy


why is org/alfresco/repo/node/NodeServicePolicies$OnDeleteNodePolicy not being found? Is this a classpath issue? I have included Repository project/jar in my project but oit made no difference.

MW
3 REPLIES 3

afaust
Legendary Innovator
Legendary Innovator
Hello,

where did you put your custom JAR that includes your compiled behavior / policy class? If you put it somewhere in /tomcat/shared/ or /tomcat/lib/ it will not work. If you have a compiled Java class that depends on some Alfresco Java classes, the JAR needs to be put in /tomcat/webapps/alfresco/WEB-INF/lib/ preferably by installing it via the AMP mechanism. This is due to the way classloader lookup dependencies.

Regards
Axel

mtw999
Champ in-the-making
Champ in-the-making
Thank you for the information. I'm running Jetty inside of Eclipse, so I'm not quite sure I need to put my custom jar/class with respect to it. I will try to figure this out.

Mike

mtw999
Champ in-the-making
Champ in-the-making
Solved my problem. My class was under share webapp, not alfresco. Dumb!

Thanks,

Mike