08-07-2014 02:10 PM
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'ContentService' is defined
<bean id="webscript.com.someco.azm.handin.get" class="com.someco.azm.ActionHandIn" parent="webscript">
<property name="contentService">
<ref bean="ContentService"/>
</property>
<property name="nodeService">
<ref bean="NodeService"/>
</property>
<property name="personService">
<ref bean="PersonService"/>
</property>
</bean>
package com.someco.azm;
import java.io.IOException;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.service.cmr.repository.ContentService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.security.PersonService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.extensions.webscripts.AbstractWebScript;
import org.springframework.extensions.webscripts.WebScriptRequest;
import org.springframework.extensions.webscripts.WebScriptResponse;
public class ActionHandIn extends AbstractWebScript {
private static Log logger = LogFactory.getLog(ActionHandIn.class);
private ContentService contentService;
private NodeService nodeService;
private PersonService personService;
public void setContentService(ContentService contentService) {
this.contentService = contentService;
}
public void setNodeService(NodeService nodeService) {
this.nodeService = nodeService;
}
public void setPersonService(PersonService personService) {
this.personService = personService;
}
@Override
public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException {
if (logger.isInfoEnabled())
logger.info("### INFO ###");
if (logger.isDebugEnabled())
logger.debug("### Debug ###");
if (logger.isErrorEnabled())
logger.error("### Error ###");
}
protected void moveContent(final NodeRef contentRef, final NodeRef targetRef) {
AuthenticationUtil.runAs(new RunAsWork<String>() {
@SuppressWarnings("synthetic-access")
public String doWork() throws Exception {
// move content to target folder
nodeService.moveNode(contentRef, targetRef, ContentModel.ASSOC_CONTAINS, ContentModel.ASSOC_CHILDREN);
if (logger.isDebugEnabled())
logger.debug("Move set");
return "";
}
},
"admin");
}
}
NoClassDefFoundError com.someco.azm.ActionHandIn$RunAsWork
08-08-2014 10:00 AM
08-13-2014 02:54 AM
08-13-2014 04:12 AM
com.someco.azm.ActionHandIn.class
file and com.someco.azm.ActionHandIn$RunAsWork.class
file?08-08-2014 10:06 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.