cancel
Showing results for 
Search instead for 
Did you mean: 

ClassNotFoundException: org.alfresco.web.evaluator.BaseEvaluator

alex_lu
Champ in-the-making
Champ in-the-making
Hello,

I'm experiencing a strange problem. I've created a custom evaluator and deployed the jar to <TOMCAT_HOME>/shared/lib. However, I got ClassNotFoundExceptionSmiley Surprisedrg.alfresco.web.evaluator.BaseEvaluator when I started Alfresco. I removed extension of BasedEvaluator from the custom evaluator and deployed again, I got ClassNotFoundException: org.json.simple.JSONObject.

However it works fine when I deploy the jar to <TOMCAT_HOME>webapps/share/WEB_INF/lib. It seems shared/lib/*.jar gets initialized before loading all other jars.

I tried enterprise 4.0.2 and enterprise 4.1.3. Both produced the same error.

Does anyone know why? Is this a bug?

Many thanks
1 REPLY 1

afaust
Legendary Innovator
Legendary Innovator
Hello,

this is not a bug - this is a result of an inproper placement of the JAR and classloading mechanics. You can't but a JAR that has a direct dependency on an Alfresco class on the shared/lib/*.jar path since the shared-classloader does not have access to the webapp-specific classloader of Alfresco to load the dependant class BaseEvaluator. Such a JAR can only be put in the WEB-INF/lib of Alfresco.

Regards
Axel