AnsweredAssumed Answered

NodeService - java.lang.NullPointerException

Question asked by mstransky on May 20, 2010
Latest reply on May 21, 2010 by mstransky
Hello I have problem with NodeService
I am trineg for specific reason convert manualy Text File to PDF with specific definition using iText, But I am stuck on nodeservice(I believe)
Can Anyone Help me please???

This is my part of code..

public class TXT2PDFActionExecuter extends ActionExecuterAbstractBase{

private NodeService nodeService;
public void setNodeService(NodeService nodService)
    {
       this.nodeService = nodService;
    }
….
QName PROP_QNAME_MY_PROPERTY = QName.createQName("custom.model", "title");
System.out.println("QNAME>" + PROP_QNAME_MY_PROPERTY.toString());
System.out.println("actionedUponNodeRef>" + actionedUponNodeRef.toString());
System.out.println("getin title node>" + this.nodeService.toString());
NodeRef titleValue = (NodeRef)this.nodeService.getProperty(actionedUponNodeRef, PROP_QNAME_MY_PROPERTY);

My problem is that on line : System.out.println("getin title node>" + this.nodeService.toString()); I get

….
actionedUponNodeRef>workspace://SpacesStore/44266631-7e4e-4df6-8b44-96e8538aafb9
[b]java.lang.NullPointerException[/b]
        at com.atolcd.repo.action.executer.TXT2PDFActionExecuter.executeImpl(TXT2PDFActionExecuter.java:159)
        at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:133)
        at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:726)
        at org.alfresco.repo.action.executer.CompositeActionExecuter.executeImpl(CompositeActionExecuter.java:66)
        at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:133)
        at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:726)
        at org.alfresco.repo.action.ActionServiceImpl.executeActionImpl(ActionServiceImpl.java:658)
        at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:526)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
        at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:34)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:43)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:279)
        at org.alfresco.repo.audit.AuditMethodInterceptor.proceedWithAudit(AuditMethodInterceptor.java:228)
        at org.alfresco.repo.audit.AuditMethodInterceptor.proceed(AuditMethodInterceptor.java:195)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:140)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at $Proxy39.executeAction(Unknown Source)

Outcomes