Exception occured on calling Context.exit() method.

44 views
Skip to first unread message

banesh banna

unread,
Jul 18, 2019, 7:12:14 AM7/18/19
to mozilla-rhino
Hi All,
     Below exception was observed when iam trying to call Context.exit() method.

              java.lang.IllegalStateException: Calling Context.exit without previous Context.enter
    at org.mozilla.javascript.Context.exit(Context.java:480)
    at com.imi.rhino.Thread1.run(Thread1.java:25)



Execution Process:
                      Calling  Context.enter() in one thread  and Calling Context.exit() in one more thread.
                      In this scenario iam getting above error.
           Please give a suggestion to avoid this error.

Thanks in advance.

Merten Schumann

unread,
Jul 19, 2019, 1:26:00 AM7/19/19
to mozill...@googlegroups.com

Hello,

 

see https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/Scopes_and_Contexts

So you should/must play the Context.enter()/exit() game PER Rhino usage PER thread, works just nice ...

 

Gruesse

   Merten

 

 

From: mozill...@googlegroups.com <mozill...@googlegroups.com> On Behalf Of banesh banna
Sent: Donnerstag, 18. Juli 2019 13:12
To: mozilla-rhino <mozill...@googlegroups.com>
Subject: [mozilla-rhino] Exception occured on calling Context.exit() method.

 

*** External email: Verify sender before opening attachments or links ***

 

--
You received this message because you are subscribed to the Google Groups "mozilla-rhino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mozilla-rhin...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mozilla-rhino/458c40ab-c05e-4f53-a8c3-90229a69c77d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

banesh banna

unread,
Jul 26, 2019, 1:52:59 AM7/26/19
to mozilla-rhino

Context object is per thread. if we are calling Context.enter() but i fogot call Context.exit() but i closed my thread.
What will be the impact if we are not calling exit() method.

Thanks in advance.

On Friday, July 19, 2019 at 10:56:00 AM UTC+5:30, Merten Schumann wrote:

Hello,

 

see https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/Scopes_and_Contexts

So you should/must play the Context.enter()/exit() game PER Rhino usage PER thread, works just nice ...

 

Gruesse

   Merten

 

 

From: mozill...@googlegroups.com <mozill...@googlegroups.com> On Behalf Of banesh banna
Sent: Donnerstag, 18. Juli 2019 13:12
To: mozilla-rhino <mozill...@googlegroups.com>
Subject: [mozilla-rhino] Exception occured on calling Context.exit() method.

 

*** External email: Verify sender before opening attachments or links ***

 

Hi All,

     Below exception was observed when iam trying to call Context.exit() method.

 

              java.lang.IllegalStateException: Calling Context.exit without previous Context.enter
    at org.mozilla.javascript.Context.exit(Context.java:480)
    at com.imi.rhino.Thread1.run(Thread1.java:25)

 

 

 

Execution Process:

                      Calling  Context.enter() in one thread  and Calling Context.exit() in one more thread.

                      In this scenario iam getting above error.

           Please give a suggestion to avoid this error.

 

Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "mozilla-rhino" group.

To unsubscribe from this group and stop receiving emails from it, send an email to mozill...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages