1
votes

I am trying to figure out where to place a share bean in the extension path. I have tried placing it in the following directories:

1) tomcat/shared/classes/
2) tomcat/shared/classes/alfresco/
3) tomcat/shared/classes/alfresco/web-extension

The bean has been declared in the custom-slingshot-application-context.xml along with some localized resources (the .properties files <== They get picked up). Some additional info. It's a share side bean because I can drop the package into the src directory of the expanded war file in the IDE and run share and it'll work.

Update This is the custom-slingshot-application-context.xml content:

<beans>
    <!-- Override WebScript Messages - add slingshot application messages -->
    <bean id="webscripts.resources" class="org.springframework.extensions.surf.util.ResourceBundleBootstrapComponent">
        <property name="resourceBundles">
            <list>
                <value>webscripts.messages.webscripts</value>
                <value>alfresco.web-extension.messages.common</value>
                <value>alfresco.web-extension.messages.slingshot</value>
                <value>alfresco.web-extension.messages.profPerson</value>
            </list>
        </property>
    </bean>

    <bean id="webframework.factory.user.profPerson" class="com.test.ext.profUserFactory" parent="webframework.factory.base" />

</beans>
1
Are you making sure you're doing this in the Tomcat instance that is running Share? And have you ensured that that Tomcat is configured to use shared classpath? - Gagravarr
Yes. Everything else extended works for the most part - Dark Star1
alfresco/web-extension/custom-slingshot-application-context.xml under the tomcat shared/classes/ directory should be all you need, provided your tomcat is configured to use that directory - Gagravarr
Well whenever I put the bean directory in there, I still get a bean not found exception. - Dark Star1
Try adding a syntax error to the file. If tomcat is seeing it, you'll get an exception at application startup. If not, then tomcat doesn't think that file is on the classpath! - Gagravarr

1 Answers

2
votes

It seems you're using Tomcat, but as @Gagravarr mentions unless you are using the Tomcat supplied by the Alfresco installers, then the shared/classes directory is not enabled out of the box.

In Tomcat6/7, you need to add the following line to your conf/catalina.properties file (or modify it if it is already defined)

shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar 

More information is available on the Install Tomcat6 wiki page.