indexOf() fails when called from setInterval.
----------------------------------------------
Key: MASHUP-630
URL: http://wso2.org/jira/browse/MASHUP-630
Project: WSO2 Mashup Server
Issue Type: Bug
Reporter: Jonathan Marsh
Assigned To: Channa Gunawardena
Priority: Critical
The enclosed service checks the low temperature periodically and sends freeze
alerts to subscribers by IM. (The subscription mechanism isn't completed yet -
add your own IM address into getSubscriptions to test.) The "sendAlertsNow"
operation completes successfully, but when this same function is invoked
through setInterval, an exception occurs. When removing the .indexOf method on
line 119, no exception occurs.
Log follows.
INFO [2008-02-02 09:02:57,947] XML parsed in 3ms.
INFO [2008-02-02 09:02:57,960] VarDefProcessor starts processing...
INFO [2008-02-02 09:02:57,961] HttpProcessor starts processing...
INFO [2008-02-02 09:02:58,334] Downloaded: http://www.weather.gov/forecasts/xm
l/sample_products/browser_interface/ndfdBrowserClientByDay.php?&lat=38.9234&lon=
-121.07&format=12+hourly&startDate=2008-02-02&numDays=1, mime type = text/xml, l
ength = 3959B.
INFO [2008-02-02 09:02:58,336] HttpProcessor processor executed in 375ms.
INFO [2008-02-02 09:02:58,336] VarDefProcessor processor executed in 376ms.
INFO [2008-02-02 09:02:58,337] Configuration executed in 377ms.
ERROR [2008-02-02 09:02:58,340] Job DEFAULT.224BA45AE2A9F67B831201971779111 thr
ew an unhandled Exception:
java.lang.RuntimeException: No Context associated with current Thread
at org.mozilla.javascript.Context.getContext(Context.java:2277)
at org.mozilla.javascript.ScriptableObject.getDefaultValue(ScriptableObj
ect.java:736)
at org.mozilla.javascript.ScriptableObject.getDefaultValue(ScriptableObj
ect.java:677)
at org.mozilla.javascript.ScriptRuntime.toString(ScriptRuntime.java:707)
at org.mozilla.javascript.NativeString.execIdCall(NativeString.java:216)
at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:12
7)
at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66)
at org.mozilla.javascript.gen.c249._c8(jonathan-freezeAlert:119)
at org.mozilla.javascript.gen.c249.call(jonathan-freezeAlert)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:
97)
at org.mozilla.javascript.gen.c249._c4(jonathan-freezeAlert:37)
at org.mozilla.javascript.gen.c249.call(jonathan-freezeAlert)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:3
93)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:283
4)
at org.mozilla.javascript.gen.c249.call(jonathan-freezeAlert)
at org.wso2.mashup.hostobjects.system.FunctionSchedulingJob.execute(Func
tionSchedulingJob.java:46)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.j
ava:520)
ERROR [2008-02-02 09:02:58,348] Job (DEFAULT.224BA45AE2A9F67B831201971779111 th
rew an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exc
eption: java.lang.RuntimeException: No Context associated with current Thread]
at org.quartz.core.JobRunShell.run(JobRunShell.java:214)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.j
ava:520)
* Nested Exception (Underlying Cause) ---------------
java.lang.RuntimeException: No Context associated with current Thread
at org.mozilla.javascript.Context.getContext(Context.java:2277)
at org.mozilla.javascript.ScriptableObject.getDefaultValue(ScriptableObj
ect.java:736)
at org.mozilla.javascript.ScriptableObject.getDefaultValue(ScriptableObj
ect.java:677)
at org.mozilla.javascript.ScriptRuntime.toString(ScriptRuntime.java:707)
at org.mozilla.javascript.NativeString.execIdCall(NativeString.java:216)
at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:12
7)
at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66)
at org.mozilla.javascript.gen.c249._c8(jonathan-freezeAlert:119)
at org.mozilla.javascript.gen.c249.call(jonathan-freezeAlert)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:
97)
at org.mozilla.javascript.gen.c249._c4(jonathan-freezeAlert:37)
at org.mozilla.javascript.gen.c249.call(jonathan-freezeAlert)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:3
93)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:283
4)
at org.mozilla.javascript.gen.c249.call(jonathan-freezeAlert)
at org.wso2.mashup.hostobjects.system.FunctionSchedulingJob.execute(Func
tionSchedulingJob.java:46)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.j
ava:520)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://wso2.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev