[ 
http://jira.magnolia-cms.com/browse/MAGNOLIA-4373?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Federico Grilli updated MAGNOLIA-4373:
--------------------------------------

    Description: 
This has been noticed when testing the demo activation job coming with the 
scheduler module after upgrading the latter to Magnolia 4.5. Here is the error
{code}
2012-04-16 16:32:00,001 INFO  info.magnolia.module.scheduler.CommandJob         
: Starting job [demo]...
2012-04-16 16:32:00,004 ERROR 
olia.module.admininterface.commands.VersionCommand: can't version
java.lang.NullPointerException
        at 
info.magnolia.context.AbstractContext.getJCRSession(AbstractContext.java:134)
        at info.magnolia.context.MgnlContext.getJCRSession(MgnlContext.java:511)
        at 
info.magnolia.module.admininterface.commands.BaseRepositoryCommand.getNode(BaseRepositoryCommand.java:65)
        at 
info.magnolia.module.admininterface.commands.VersionCommand.execute(VersionCommand.java:75)
        at 
info.magnolia.commands.MgnlCommand.executePooledOrSynchronized(MgnlCommand.java:174)
        at info.magnolia.commands.MgnlCommand.execute(MgnlCommand.java:161)
        at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
        at info.magnolia.module.scheduler.CommandJob.execute(CommandJob.java:93)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:223)
        at 
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
{code}

The problem can be traced back to 
{{info.magnolia.module.admininterface.commands.BaseRepositoryCommand.getNode(Context)}}
  line #65 where the call to 
info.magnolia.cms.security.PermissionUtil.isGranted(Session, String, String) 
would get as a first param the current JCR session set in MgnlContext. Now, 
{{info.magnolia.module.scheduler.CommandJob}} s set the ctx as a 
{{info.magnolia.context.SimpleContext.SimpleContext}} whose repository strategy 
is not set by default, hence the NPE. 

  was:
This has been noticed when testing the demo activation job coming with the 
scheduler module after upgrading the latter to Magnolia 4.5. Here is the error
{code}
2012-04-16 16:32:00,001 INFO  info.magnolia.module.scheduler.CommandJob         
: Starting job [demo]...
2012-04-16 16:32:00,004 ERROR 
olia.module.admininterface.commands.VersionCommand: can't version
java.lang.NullPointerException
        at 
info.magnolia.context.AbstractContext.getJCRSession(AbstractContext.java:134)
        at info.magnolia.context.MgnlContext.getJCRSession(MgnlContext.java:511)
        at 
info.magnolia.module.admininterface.commands.BaseRepositoryCommand.getNode(BaseRepositoryCommand.java:65)
        at 
info.magnolia.module.admininterface.commands.VersionCommand.execute(VersionCommand.java:75)
        at 
info.magnolia.commands.MgnlCommand.executePooledOrSynchronized(MgnlCommand.java:174)
        at info.magnolia.commands.MgnlCommand.execute(MgnlCommand.java:161)
        at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
        at info.magnolia.module.scheduler.CommandJob.execute(CommandJob.java:93)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:223)
        at 
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
{code}

The problem can be traced back to 
{{info.magnolia.module.admininterface.commands.BaseRepositoryCommand.getNode(Context)}}
  line #65 where the call to 
info.magnolia.cms.security.PermissionUtil.isGranted(Session, String, String) 
would get as a first param the current JCR session set in MgnlContext. Now, 
{{info.magnolia.module.scheduler.CommandJob}}s set the ctx as a 
{{info.magnolia.context.SimpleContext.SimpleContext}} whose repository strategy 
is not set by default, hence the NPE. 


> NPE when running scheduled job
> ------------------------------
>
>                 Key: MAGNOLIA-4373
>                 URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-4373
>             Project: Magnolia
>          Issue Type: Bug
>      Security Level: Public
>          Components: admininterface
>    Affects Versions: 4.5.1
>            Reporter: Federico Grilli
>            Assignee: Federico Grilli
>            Priority: Critical
>             Fix For: 4.5.3
>
>
> This has been noticed when testing the demo activation job coming with the 
> scheduler module after upgrading the latter to Magnolia 4.5. Here is the error
> {code}
> 2012-04-16 16:32:00,001 INFO  info.magnolia.module.scheduler.CommandJob       
>   : Starting job [demo]...
> 2012-04-16 16:32:00,004 ERROR 
> olia.module.admininterface.commands.VersionCommand: can't version
> java.lang.NullPointerException
>       at 
> info.magnolia.context.AbstractContext.getJCRSession(AbstractContext.java:134)
>       at info.magnolia.context.MgnlContext.getJCRSession(MgnlContext.java:511)
>       at 
> info.magnolia.module.admininterface.commands.BaseRepositoryCommand.getNode(BaseRepositoryCommand.java:65)
>       at 
> info.magnolia.module.admininterface.commands.VersionCommand.execute(VersionCommand.java:75)
>       at 
> info.magnolia.commands.MgnlCommand.executePooledOrSynchronized(MgnlCommand.java:174)
>       at info.magnolia.commands.MgnlCommand.execute(MgnlCommand.java:161)
>       at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
>       at info.magnolia.module.scheduler.CommandJob.execute(CommandJob.java:93)
>       at org.quartz.core.JobRunShell.run(JobRunShell.java:223)
>       at 
> org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
> {code}
> The problem can be traced back to 
> {{info.magnolia.module.admininterface.commands.BaseRepositoryCommand.getNode(Context)}}
>   line #65 where the call to 
> info.magnolia.cms.security.PermissionUtil.isGranted(Session, String, String) 
> would get as a first param the current JCR session set in MgnlContext. Now, 
> {{info.magnolia.module.scheduler.CommandJob}} s set the ctx as a 
> {{info.magnolia.context.SimpleContext.SimpleContext}} whose repository 
> strategy is not set by default, hence the NPE. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


----------------------------------------------------------------
For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to