cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with a new Action

drbaz
Champ in-the-making
Champ in-the-making
I have added a new Action but as soon as I re-launch Alfresco i get the following error :

16:22:59,997 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name '' defined in class path resource [alfresco/action-services-context.xml]: Bean class [org.alfresco.repo.action.evaluator.TextPropertyValueComparator] not found; nested exception is java.lang.ClassNotFoundException: org.alfresco.repo.action.evaluator.TextPropertyValueComparator
java.lang.ClassNotFoundException: org.alfresco.repo.action.evaluator.TextPropertyValueComparator
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1332)

My new action mimics the delivered "Mail" action.
The relvant part of the action-services-context.xml is
<bean id="myAction" class="org.alfresco.repo.action.executer.myActionExecuter" parent="action-executer">

        <property name="mailService">

            <ref bean="mailService"></ref>

        </property>

    </bean>

Any suggestions ?
4 REPLIES 4

rwetherall
Confirmed Champ
Confirmed Champ
Hi Barrie,

From what I can see things should be ok.

The error doesn't look very helpful (its complaining about a not being able to find a class that is part of the open product) is there more to the stack trace?

If you remove your section of config do you still get the error?

Thanks,
Roy

drbaz
Champ in-the-making
Champ in-the-making
Removing my "bean" from the action-services-context.xml has no effect and th error remains, so I have investigated a bit further.

As I said before, I have added my own action to the V1.1 source code.

The error log states that the class org.alfresco.repo.action.evaluator.TextPropertyValueComparator
cannot be found.

This true, as in V1.1 the class is org.alfresco.repo.action.evaluator.compare.TextPropertyValueComparator

drbaz
Champ in-the-making
Champ in-the-making
Please can someone shed some light on the above problem

Thanks

rwetherall
Confirmed Champ
Confirmed Champ
Hi,

The comparator classes have been moved into the sub-package 'compare' in 1.1.

I have checked action-services-context.xml in the 1.1 code line and it reflects this change.  So I guess you are seeing some sort of merge problem from 1.0 to 1.1.

Ensure that your action-services-context.xml reads as follows …


<bean id="compare-property-value" class="org.alfresco.repo.action.evaluator.ComparePropertyValueEvaluator" parent="action-condition-evaluator">
        <property name="nodeService">
            <ref bean="nodeService" />
        </property>
        <property name="contentService">
            <ref bean="contentService" />
        </property>
        <property name="dictionaryService">
            <ref bean="dictionaryService" />
        </property>
        <property name="propertyValueComparators">
            <list>
               <bean class="org.alfresco.repo.action.evaluator.compare.TextPropertyValueComparator"/>
               <bean class="org.alfresco.repo.action.evaluator.compare.NumericPropertyValueComparator"/>
               <bean class="org.alfresco.repo.action.evaluator.compare.DatePropertyValueComparator"/>
            </list>
        </property>
    </bean>

Hope this helps,
Roy