You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by tejashp <te...@softwebsolutions.com> on 2010/04/08 07:27:39 UTC

Cant Invoke a Service from Quartz Job in groovy

Hi,

I am trying to access a service class,e.g. MyService from the Quartz Job
class. I have also written "def myService" in MyNotificationJob i.e. Quartz
Job class and it is having following method

public void execute(JobExecutionContext context) throws
JobExecutionException 

Now I want to access xyz method of MyService and written the following
statement in the above method.

myService.xyz()

but it throws the following error:

java.lang.NullPointerException: Cannot invoke method xyz() on null object
        at
org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:77)
        at
org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:743)
        at
org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:720)
        at
org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:17)
        at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:43)
        at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
        at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)




Please help me out to access a service from my quartz job...... Thanks in
advance.....

-- 
View this message in context: http://n4.nabble.com/Cant-Invoke-a-Service-from-Quartz-Job-in-groovy-tp1756043p1756043.html
Sent from the OFBiz - Dev mailing list archive at Nabble.com.

Re: Cant Invoke a Service from Quartz Job in groovy

Posted by Jacques Le Roux <ja...@les7arts.com>.
Please use rather user ML for such questions, see why here :
http://cwiki.apache.org/confluence/display/OFBADMIN/Mailing+Lists#MailingLists-DesignanddevelopmentList:dev@ofbiz.apache.org

Thanks

Jacques

From: "tejashp" <te...@softwebsolutions.com>
> 
> Hi,
> 
> I am trying to access a service class,e.g. MyService from the Quartz Job
> class. I have also written "def myService" in MyNotificationJob i.e. Quartz
> Job class and it is having following method
> 
> public void execute(JobExecutionContext context) throws
> JobExecutionException 
> 
> Now I want to access xyz method of MyService and written the following
> statement in the above method.
> 
> myService.xyz()
> 
> but it throws the following error:
> 
> java.lang.NullPointerException: Cannot invoke method xyz() on null object
>        at
> org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:77)
>        at
> org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:743)
>        at
> org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:720)
>        at
> org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:17)
>        at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:43)
>        at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
>        at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
>        at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
>        at
> org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
> 
> 
> 
> 
> Please help me out to access a service from my quartz job...... Thanks in
> advance.....
> 
> -- 
> View this message in context: http://n4.nabble.com/Cant-Invoke-a-Service-from-Quartz-Job-in-groovy-tp1756043p1756043.html
> Sent from the OFBiz - Dev mailing list archive at Nabble.com.
>