AnsweredAssumed Answered

BeanCreation Exception: RuntimeExecutableContentTransformer

Question asked by jsauer on Jan 6, 2010
Latest reply on Mar 5, 2010 by mycroes
Hi,
just want to register a simple RuntimeExecutableContentTransformerWorker based transformer. Does not work whatever I do. After lots of research here, the Wiki and other places no success so far.

Environment: Alfresco 3.2.r2 on Windows XP SP3

As my code did not work, I tried the code from the wiki.

classpath:alfresco/extension/my-runtime-exec-transformers-context.xml

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="transformer.Tidy.XHTML" class="org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker" parent="baseContentTransformer">
      <property name="mimetypeService">
         <ref bean="mimetypeService" />
      </property>
      <property name="checkCommand">
         <bean class="org.alfresco.util.exec.RuntimeExec">
            <property name="commandMap">
                <map>
                    <entry key=".*">
                        <value>tidy -help</value>
                    </entry>
                </map>
            </property>
            <property name="errorCodes">
               <value>2</value>
            </property>
         </bean>
      </property>
      <property name="transformCommand">
         <bean class="org.alfresco.util.exec.RuntimeExec">
            <property name="commandMap">
                <map>
                    <entry key="Linux">
                        <value>tidy -asxhtml -o '${target}' '${source}'</value>
                    </entry>
                    <entry key="Windows.*">
                        <value>tidy -asxhtml -o "${target}" "${source}"</value>
                    </entry>
                </map>
            </property>
            <property name="errorCodes">
               <value>2</value>
            </property>
         </bean>
      </property>
      <property name="explicitTransformations">
         <list>
            <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails" >
                <property name="sourceMimetype"><value>text/html</value></property>
                <property name="targetMimetype"><value>application/xhtml+xml</value></property>
            </bean>
         </list>
      </property>
   </bean>
</beans>

Error Message:

21:35:14,546 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transformer.Tidy.XHTML' defined in file [D:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension\my-runtime-exec-transformers-context.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'registry' of bean class [org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker]: Bean property 'registry' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'registry' of bean class [org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker]: Bean property 'registry' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
   at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:793)
   at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:645)
   at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78)
   at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:59)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1127)


The code in the wiki does not use:

      <property name="mimetypeService">
         <ref bean="mimetypeService" />
      </property>
I looked it up at imagemagick-transform-context.xml as I thought it might be missing as some 'registry' seems to be the problem.

Any ideas?

Thanks
Jörg
PS: why will the bean never be processed if I place it under a subdirectory of extension, e.g. classpath:alfresco/extension/mytransformers/my-runtime-exec-transformers-context.xml ?

Outcomes