10-22-2009 04:52 AM
10-22-2009 07:33 AM
10-24-2009 03:07 PM
10-26-2009 04:04 AM
package org.alfresco.sample;
import java.util.List;
import java.io.Serializable;
import java.util.Map;
import org.alfresco.model.*;
import org.alfresco.repo.action.ParameterDefinitionImpl;
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.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.bean.repository.Node;
public class SpaceOffreActionExecuter extends ActionExecuterAbstractBase
{
private NodeService nodeService;
/** The name of the action */
public static final String NAME = "spaceoffre-action";
@Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
{
if (this.nodeService.exists(actionedUponNodeRef) == false)
{
System.out.println("————erreur node ————————");
}
else
{
this.nodeService.setProperty(actionedUponNodeRef, SpaceOffreModel.PROP_CLIENT, (Serializable)"actionclient");
this.nodeService.setProperty(actionedUponNodeRef, SpaceOffreModel.PROP_BAILLEUR, (Serializable)"rrr");
}
}
}
public NodeService getNodeService() {
return nodeService;
}
public void setNodeService(NodeService nodeService) {
this.nodeService = nodeService;
}
}
08:19:52,218 User:admin ERROR [ui.common.Utils] Impossible d'excuter les Action
s cause de l'erreur : null
java.lang.NullPointerException
at org.alfresco.sample.SpaceOffreActionExecuter.executeImpl(SpaceOffreAc
tionExecuter.java:82)
at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(
ActionExecuterAbstractBase.java:127)
at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(Acti
onServiceImpl.java:592)
at org.alfresco.repo.action.ActionServiceImpl.executeActionImpl(ActionSe
rviceImpl.java:529)
at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServic
eImpl.java:391)
at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServic
eImpl.java:379)
at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServic
eImpl.java:600)
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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflecti
on(AopUtils.java:296)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJo
inpoint(ReflectiveMethodInvocation.java:177)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:144)
at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterc
eptor.invoke(AlwaysProceedMethodInterceptor.java:40)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:166)
at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethod
Interceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:166)
at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.j
ava:275)
at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInte
rceptor.java:69)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:166)
at org.springframework.transaction.interceptor.TransactionInterceptor.in
voke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:166)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynami
cAopProxy.java:204)
at $Proxy22.executeAction(Unknown Source)
at org.alfresco.web.bean.actions.RunActionWizard.finishImpl(RunActionWiz
ard.java:101)
at org.alfresco.web.bean.dialog.BaseDialogBean$1.execute(BaseDialogBean.
java:121)
at org.alfresco.web.bean.dialog.BaseDialogBean$1.execute(BaseDialogBean.
java:118)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransacti
on(RetryingTransactionHelper.java:320)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransacti
on(RetryingTransactionHelper.java:227)
at org.alfresco.web.bean.dialog.BaseDialogBean.finish(BaseDialogBean.jav
a:127)
at org.alfresco.web.bean.wizard.WizardManager.finish(WizardManager.java:
580)
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.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java
:132)
at org.apache.myfaces.application.ActionListenerImpl.processAction(Actio
nListenerImpl.java:61)
at javax.faces.component.UICommand.broadcast(UICommand.java:109)
at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:9
7)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1
71)
at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(Invoke
ApplicationExecutor.java:32)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl
.java:95)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java
:70)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(Authentica
tionFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ss(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
7)
at java.lang.Thread.run(Thread.java:619)
10-26-2009 05:44 AM
10-26-2009 05:46 AM
10-26-2009 05:58 AM
C'est peut-être un problème d'injection du nodeService dans la déclaration de ton action. Poste également le fichier XML qui décrit ton action.
at org.alfresco.sample.SpaceOffreActionExecuter.executeImpl(SpaceOffreAc
tionExecuter.java:82)
10-26-2009 06:10 AM
if (nodeService.exists(actionedUponNodeRef) == false)
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<!– Logger Action Bean –>
<bean id="spaceoffre-action" class="org.alfresco.sample.SpaceOffreActionExecuter" parent="action-executer"/>
<!– Load the Logger Action Messages –>
<bean id="spaceoffre-action-messages" class="org.alfresco.i18n.ResourceBundleBootstrapComponent">
<property name="resourceBundles">
<list>
<value>org.alfresco.sample.spaceoffre-action-messages</value>
</list>
</property>
</bean>
</beans>
package org.alfresco.sample;
import org.alfresco.service.namespace.QName;
public interface SpaceOffreModel {
static final String SPOFFRE_MODEL_URI = "package.model";
static final String SPOFFRE_MODEL_PREFIX = "erm";
static final QName TYPE_SPOFFRE = QName.createQName(SPOFFRE_MODEL_URI, "package");
static final QName PROP_DESEIGN = QName.createQName(SPOFFRE_MODEL_URI, "Design");
static final QName PROP_NOFFRE = QName.createQName(SPOFFRE_MODEL_URI, "NumOffre");
static final QName PROP_OBJET = QName.createQName(SPOFFRE_MODEL_URI, "Objet");
static final QName PROP_CLIENT = QName.createQName(SPOFFRE_MODEL_URI, "Client");
static final QName PROP_MODEOFFRE = QName.createQName(SPOFFRE_MODEL_URI, "ModeOffre");
static final QName PROP_PAYS = QName.createQName(SPOFFRE_MODEL_URI, "Pays");
static final QName PROP_MISSION = QName.createQName(SPOFFRE_MODEL_URI, "Mission");
static final QName PROP_SERVICE = QName.createQName(SPOFFRE_MODEL_URI, "Service");
static final QName PROP_SITUATION = QName.createQName(SPOFFRE_MODEL_URI, "Situation");
static final QName PROP_RO = QName.createQName(SPOFFRE_MODEL_URI, "RO");
static final QName PROP_PARTENAIRE = QName.createQName(SPOFFRE_MODEL_URI, "Partenaire");
static final QName PROP_BAILLEUR = QName.createQName(SPOFFRE_MODEL_URI, "Bailleur");
static final QName PROP_ETAT = QName.createQName(SPOFFRE_MODEL_URI, "Etat");
static final QName PROP_DATEENVOI = QName.createQName(SPOFFRE_MODEL_URI, "DateEnvoi");
static final QName PROP_QUALITE = QName.createQName(SPOFFRE_MODEL_URI, "Qualite");
static final QName PROP_CODESOC = QName.createQName(SPOFFRE_MODEL_URI, "CodeSociete");
}
10-26-2009 06:17 AM
C'est peut-être un problème d'injection du nodeService dans la déclaration de ton action. Poste également le fichier XML qui décrit ton action.
Christophe
10-26-2009 06:20 AM
<bean id="spaceoffre-action" class="org.alfresco.sample.SpaceOffreActionExecuter" parent="action-executer">
<property name="nodeService">
<ref bean="nodeService"/>
</property>
</bean>
Le fait de rajouter les lignes property, permet d'injecter le nodeService dans ton action (attention à bien déclarer tes getter/setter pour les différents services).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.