Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > beanshell interpreter

Thread Tools

beanshell interpreter

Posts: n/a
Hello All,

I am trying to use the beanshell interpreter and JConsole in my

I have a problem when I start the interpreter in a new thread.

//JConsole bshConsole = new JConsole();
// Interpreter interpreter = new Interpreter(bshConsole);
// interpreter.set("taApp", this);
// Thread thread = new Thread(interpreter,"BeanShell");
// thread.setDaemon(true);
// thread.start();

Sometimes my scripts generate a ConcurrentModificationException. I
think I know why, my main application is redrawing the objects from
paintComponent() when the bsh script is trying to modify one of the

I can run the scripts as shown in the code below that does not use the

interp = new Interpreter();
interp.set("taApp", taApp );
interp.source( scriptDir +
System.getProperty("file.separator") +
} catch ( TargetError e1 ) {

I have no experience with threads and didn't plan on using threads but
It looks like you have to use a thread as shown above to get the
interpreter started in the JConsole. I hope I am wrong, but I
wanted to ask you if I have any other options? Looking for advice?

Thanks in advance,
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
beanshell interpreter thread timinganalyzer Java 0 09-10-2008 01:18 PM
What can BeanShell do for Remote Debugging? vnssoftware Java 0 02-04-2004 10:33 PM
BeanShell Interpreter ImportCommands() Problems Michael Pitoniak Java 1 12-20-2003 07:25 PM
Beanshell - assignment operator not working? Wolfgang Groiss Java 0 11-19-2003 03:56 PM
[BEANSHELL] Extends SOl Java 0 07-19-2003 06:12 PM