07-06-2011 07:40 AM
14:22:57,158 INFO [alfresco.config.JndiPropertyPlaceholderConfigurer] Loading
properties file from class path resource [alfresco/alfresco-shared.properties]
14:23:44,886 ERROR [web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find clas
s [org.alfresco.sample.CustomActionExecuter] for bean with name 'custom-action'
defined in URL [jar:file:/D:/servers/alfresco-community-tomcat-3.2/tomcat/webapp
s/alfresco/WEB-INF/lib/custom-action.jar!/alfresco/extension/custom-action-conte
xt.xml]; nested exception is java.lang.ClassNotFoundException: org.alfresco.samp
le.CustomActionExecuter
Caused by: java.lang.ClassNotFoundException: org.alfresco.sample.CustomActionExe
cuter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1233)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:229)
at org.springframework.beans.factory.support.AbstractBeanDefinition.reso
lveBeanClass(AbstractBeanDefinition.java:327)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolve
BeanClass(AbstractBeanFactory.java:1073)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.
preInstantiateSingletons(DefaultListableBeanFactory.java:283)
at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:352)
at org.springframework.web.context.ContextLoader.createWebApplicationCon
text(ContextLoader.java:246)
at org.springframework.web.context.ContextLoader.initWebApplicationConte
xt(ContextLoader.java:189)
at org.springframework.web.context.ContextLoaderListener.contextInitiali
zed(ContextLoaderListener.java:49)
at org.alfresco.web.app.ContextLoaderListener.contextInitialized(Context
LoaderListener.java:69)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
t.java:3843)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
342)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:77
1)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.ja
va:627)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.j
ava:553)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488
)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443
)
at org.apache.catalina.core.StandardService.start(StandardService.java:5
16)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710
)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Jul 6, 2011 2:23:44 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Jul 6, 2011 2:23:44 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/alfresco] startup failed due to previous errors
<?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="custom-action" class="org.alfresco.sample.CustomActionExecuter" parent="action-executer" >
<property name="nodeService">
<ref bean="nodeService" />
</property>
</bean>
<bean id="custom-action-messages" class="org.alfresco.i18n.ResourceBundleBootstrapComponent">
<property name="resourceBundles">
<list>
<value>org.alfresco.sample.custom-action-messages</value>
</list>
</property>
</bean>
</beans>
package org.alfresco.sample;
import java.util.List;
import org.alfresco.repo.action.executer.ActionExecuterAbstractBase;
import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.action.ParameterDefinition;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
public class CustomActionExecutor extends ActionExecuterAbstractBase {
public static final String NAME = "custom-action";
private NodeService nodeService;
public void setNodeService(NodeService nodeService){
this.nodeService = nodeService;
}
public CustomActionExecutor(){
System.out.println("Class EXIST!!!!!!!!!!");
}
@Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) {
// TODO Auto-generated method stub
if (this.nodeService.exists(actionedUponNodeRef) == true){
System.out.println("Custom Action executed: node exist");
}
else{
System.out.println("Custom Action executed: node NOT exist");
}
}
@Override
protected void addParameterDefinitions(List<ParameterDefinition> paramList) {
// TODO Auto-generated method stub
}
}
custom-action.title=Add tags to item
custom-action.description=This action adds tags to the matched item
07-06-2011 08:57 AM
07-07-2011 03:28 AM
08-05-2011 09:12 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.