<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Why run Context.getCommandContex cause NullPointerException in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/why-run-context-getcommandcontex-cause-nullpointerexception/m-p/55438#M33309</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;and i try to run codes:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;System.out.println(Context.getCommandContext());&lt;BR /&gt;&lt;/CODE&gt;&lt;SPAN&gt;result: null&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;who can help me ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Nov 2011 01:32:41 GMT</pubDate>
    <dc:creator>kafeitu</dc:creator>
    <dc:date>2011-11-17T01:32:41Z</dc:date>
    <item>
      <title>Why run Context.getCommandContex cause NullPointerException</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/why-run-context-getcommandcontex-cause-nullpointerexception/m-p/55436#M33307</link>
      <description>these codes in method of Struts2 ActionTaskQuery taskQuery = taskService.createTaskQuery().processDefinitionKey("leave").taskCandidateUser(UserUtil.getCurrentUserId());List&amp;lt;Task&amp;gt; tasks = taskQuery.listPage(0, 10);for (Task task : tasks) {&amp;nbsp;&amp;nbsp;&amp;nbsp;TaskEntity taskEntity = (TaskEntity) task;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.o</description>
      <pubDate>Wed, 16 Nov 2011 14:55:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/why-run-context-getcommandcontex-cause-nullpointerexception/m-p/55436#M33307</guid>
      <dc:creator>kafeitu</dc:creator>
      <dc:date>2011-11-16T14:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why run Context.getCommandContex cause NullPointerException</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/why-run-context-getcommandcontex-cause-nullpointerexception/m-p/55437#M33308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;in module activiti-spring, I modify class CustomTaskAssignmentTest method testSetAssigneeThroughSpringService:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;@Deployment&lt;BR /&gt;&amp;nbsp; public void testSetAssigneeThroughSpringService() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; runtimeService.startProcessInstanceByKey("assigneeThroughSpringService", CollectionUtil.singletonMap("emp", "fozzie"));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Task singleResult = taskService.createTaskQuery().taskAssignee("Kermit The Frog").singleResult();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TaskEntity te = (TaskEntity)singleResult;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(te.getIdentityLinks());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; assertEquals(1, taskService.createTaskQuery().taskAssignee("Kermit The Frog").count());&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&lt;/CODE&gt;&lt;SPAN&gt;expcetion traces:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;java.lang.NullPointerException&lt;BR /&gt; at org.activiti.engine.impl.persistence.entity.TaskEntity.getIdentityLinks(TaskEntity.java:340)&lt;BR /&gt; at org.activiti.spring.test.taskassignment.CustomTaskAssignmentTest.testSetAssigneeThroughSpringService(CustomTaskAssignmentTest.java:34)&lt;BR /&gt; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)&lt;BR /&gt; at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)&lt;BR /&gt; at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)&lt;BR /&gt; at java.lang.reflect.Method.invoke(Method.java:597)&lt;BR /&gt; at junit.framework.TestCase.runTest(TestCase.java:168)&lt;BR /&gt; at org.activiti.engine.impl.test.PvmTestCase.runTest(PvmTestCase.java:75)&lt;BR /&gt; at junit.framework.TestCase.runBare(TestCase.java:134)&lt;BR /&gt; at org.activiti.engine.impl.test.AbstractActivitiTestCase.runBare(AbstractActivitiTestCase.java:89)&lt;BR /&gt; at org.activiti.spring.impl.test.SpringActivitiTestCase.runBare(SpringActivitiTestCase.java:51)&lt;BR /&gt; at junit.framework.TestResult$1.protect(TestResult.java:110)&lt;BR /&gt; at junit.framework.TestResult.runProtected(TestResult.java:128)&lt;BR /&gt; at junit.framework.TestResult.run(TestResult.java:113)&lt;BR /&gt; at junit.framework.TestCase.run(TestCase.java:124)&lt;BR /&gt; at junit.framework.TestSuite.runTest(TestSuite.java:232)&lt;BR /&gt; at junit.framework.TestSuite.run(TestSuite.java:227)&lt;BR /&gt; at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)&lt;BR /&gt; at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)&lt;BR /&gt; at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)&lt;BR /&gt; at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)&lt;BR /&gt; at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)&lt;BR /&gt; at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)&lt;BR /&gt; at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 15:30:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/why-run-context-getcommandcontex-cause-nullpointerexception/m-p/55437#M33308</guid>
      <dc:creator>kafeitu</dc:creator>
      <dc:date>2011-11-16T15:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Why run Context.getCommandContex cause NullPointerException</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/why-run-context-getcommandcontex-cause-nullpointerexception/m-p/55438#M33309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;and i try to run codes:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;System.out.println(Context.getCommandContext());&lt;BR /&gt;&lt;/CODE&gt;&lt;SPAN&gt;result: null&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;who can help me ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 01:32:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/why-run-context-getcommandcontex-cause-nullpointerexception/m-p/55438#M33309</guid>
      <dc:creator>kafeitu</dc:creator>
      <dc:date>2011-11-17T01:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: Why run Context.getCommandContex cause NullPointerException</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/why-run-context-getcommandcontex-cause-nullpointerexception/m-p/55439#M33310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you provide a unit test project, so I can reproduce the error message?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 09:32:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/why-run-context-getcommandcontex-cause-nullpointerexception/m-p/55439#M33310</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2011-11-17T09:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Why run Context.getCommandContex cause NullPointerException</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/why-run-context-getcommandcontex-cause-nullpointerexception/m-p/55440#M33311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Can you provide a unit test project, so I can reproduce the error message?&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;I used "activiti-spring-example" moudle of activiti, Test class &lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://connect.hyland.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;rg.activiti.spring.test.taskassignment.CustomTaskAssignmentTest&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;please override method testSetAssigneeThroughSpringService&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;@Deployment&lt;BR /&gt; public void testSetAssigneeThroughSpringService() {&lt;BR /&gt;&amp;nbsp; runtimeService.startProcessInstanceByKey("assigneeThroughSpringService",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CollectionUtil.singletonMap("emp", "fozzie"));&lt;BR /&gt;&amp;nbsp; Task singleResult = taskService.createTaskQuery().taskAssignee("Kermit The Frog").singleResult();&lt;BR /&gt;&amp;nbsp; System.out.println(Context.getCommandContext());&lt;BR /&gt;&amp;nbsp; TaskEntity te = (TaskEntity) singleResult;&lt;BR /&gt;&amp;nbsp; System.out.println(te.getIdentityLinks());&lt;BR /&gt;&amp;nbsp; assertEquals(1, taskService.createTaskQuery().taskAssignee("Kermit The Frog").count());&lt;BR /&gt; }&lt;BR /&gt;&lt;/CODE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 12:44:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/why-run-context-getcommandcontex-cause-nullpointerexception/m-p/55440#M33311</guid>
      <dc:creator>kafeitu</dc:creator>
      <dc:date>2011-11-17T12:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: Why run Context.getCommandContex cause NullPointerException</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/why-run-context-getcommandcontex-cause-nullpointerexception/m-p/55441#M33312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I see. the task assignee is kermit, not Kermit the frog.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 13:09:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/why-run-context-getcommandcontex-cause-nullpointerexception/m-p/55441#M33312</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2011-11-17T13:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why run Context.getCommandContex cause NullPointerException</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/why-run-context-getcommandcontex-cause-nullpointerexception/m-p/55442#M33313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I see. the task assignee is kermit, not Kermit the frog.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;You may have misunderstood what I mean.&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;assertEquals(1, taskService.createTaskQuery().taskAssignee("Kermit The Frog").count());&lt;BR /&gt;&lt;/CODE&gt;&lt;SPAN&gt;you can test the new unit test that i upgraded: &lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;@Deployment&lt;BR /&gt; public void testSetAssigneeThroughSpringService() {&lt;BR /&gt;&amp;nbsp; runtimeService.startProcessInstanceByKey("assigneeThroughSpringService",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CollectionUtil.singletonMap("emp", "fozzie"));&lt;BR /&gt;&amp;nbsp; Task singleResult = taskService.createTaskQuery().taskAssignee("Kermit The Frog").singleResult();&lt;BR /&gt;&amp;nbsp; TaskEntity te = (TaskEntity) singleResult;&lt;BR /&gt;&amp;nbsp; assertNotNull(te);&lt;BR /&gt;&amp;nbsp; assertNotNull(Context.getCommandContext());&lt;BR /&gt;&amp;nbsp; System.out.println(te.getIdentityLinks());&lt;BR /&gt;&amp;nbsp; assertEquals(1, taskService.createTaskQuery().taskAssignee("Kermit The Frog").count());&lt;BR /&gt; }&lt;BR /&gt;&lt;/CODE&gt;&lt;SPAN&gt;A failure to execute when assertNotNull(Context.getCommandContext());&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 13:20:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/why-run-context-getcommandcontex-cause-nullpointerexception/m-p/55442#M33313</guid>
      <dc:creator>kafeitu</dc:creator>
      <dc:date>2011-11-17T13:20:18Z</dc:date>
    </item>
  </channel>
</rss>

