f_koenig
Returning Observer

Beanshell Console crashes / freezes on large script

Jump to solution

Hey there,

is there any known limit for a beanshell script executed via Beanshell console?

I'm currently developing a large script for migrating data inside a project. When the script gets too large both the Beanshell console window and the Sitearchitect window freeze. I have to kill the process via the task manager to close the windows.

Is this a known problem? Has anybody an idea how to mitigate this problem?

Thanks.

Best regards
Fabian

0 Kudos
1 Solution

Accepted Solutions
hoebbel
Crownpeak employee

Hello Fabian,

In addition to what my predecessors have said (and what they are right about, of course)
It is a known problem that the beanshell console has problems with executing very many lines at once. The problem can be circumvented by executing only a few lines (about 4 lines) at a time or by simply using a script instead of the Beanshell console. By using the visibility settings there you can make sure that it is only executed by a certain group or a single user if the project is used by multiple users.

Note: The console is only intended for trying something out quickly. But not for developing scripts 😉

Best regards
Holger

View solution in original post

3 Replies
Hendrik
New Responder

Hi,

my first thought was that you might want to reconsider your chosen approach of implementing the migration, as you already stated out might the beanshell not the ideal approch to perform computationally intensive actions due to memory consumption and threading (Swing EDT). I would use an executable class in an schedule task on the server which also allows remote debugging via an IDE of your choice..
Just my two cents 😉


Br, Hendrik

0 Kudos
bIT_sosswald
Returning Responder

Hi Fabian,

i agree with @Hendrik.

Personally i would never use the BeanShell console for more then single line commands or something else.

I like to use a small Spring Boot application which connects to the FirstSpirit Server using the isolated-runtime-jar. This way I have the full power of Java and Spring Boot and do not have to deal with module installations etc.

I have done a lot of migration stuff inside of FirstSpirit using this approach.

Greetings
Sandro

0 Kudos
hoebbel
Crownpeak employee

Hello Fabian,

In addition to what my predecessors have said (and what they are right about, of course)
It is a known problem that the beanshell console has problems with executing very many lines at once. The problem can be circumvented by executing only a few lines (about 4 lines) at a time or by simply using a script instead of the Beanshell console. By using the visibility settings there you can make sure that it is only executed by a certain group or a single user if the project is used by multiple users.

Note: The console is only intended for trying something out quickly. But not for developing scripts 😉

Best regards
Holger