java.lang.ArrayIndexOutOfBoundsException when adding new application scoped variable

127 views
Skip to first unread message

Marcel Dix

unread,
Nov 13, 2015, 3:48:55 PM11/13/15
to Lucee
Hi folks,

I get a java.lang.ArrayIndexOutOfBoundsException when I add a new application variable.

Message  
18
Cause java.lang.ArrayIndexOutOfBoundsException
The stacktrace highlights the new application variable.

I have a list of application variables that I set depending on what environment the application is running.
 
When a "reset=true" is added to the url I do a applicationStop() in the onRequestStart, so I can set the variables again. This works fine when I change a variable, but when I add a new one I get this error. Also using StructClear does not work.

However when I restart Lucee, it just works fine. Obviously Lucee holds an array of application variables that does not seem to get resized to the right index (in this case index 18).

In ACF this works fine though.

I appreciate your ideas on how I could fix this without restarting Lucee.

Marcel Dix

Paul Klinkenberg

unread,
Nov 14, 2015, 3:40:36 PM11/14/15
to lu...@googlegroups.com
Hi Marcel, old colleague,

The simplest thing you could do to fix this, is not using applicationStop, but doing structClear(application).
Still, that might mess up other concurrent requests, which rely on variables in the application scope. But it should fix your problem.

Kind regards,

Paul Klinkenberg


--
Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/4e095c52-926f-4418-a469-9bc54f3d7922%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marcel Dix

unread,
Nov 14, 2015, 7:06:11 PM11/14/15
to Lucee
Hey Paul,

Good to hear from you!

Structclear was also my first bet (see 1# post). That does not work though.
I'll be experimenting a bit more to see why. It's pretty old code that I'm trying to migrate. Must be something odd.

Cheers Marcel

Marcel Dix

unread,
Nov 15, 2015, 2:40:22 PM11/15/15
to Lucee
Found it.

The initialisation of application variables was done at two places: onRequest (when flushing) and onApplicationStart. Removed the last one.
Reply all
Reply to author
Forward
0 new messages