From: Tim Plessers <tplessers@ti...> - 2004-03-03 13:51:25
I'm using beanshell inside a java application.
The java application has a run-button which loads up an Interpreter and calls
(with interpreter.source()) a script.
The script contains a public class definition and some methods and variables.
When the script finishes, I want to run it again, it loads up a new
Interpreter, but the previous class definitions and variables still exist in
the new interpreter. Probably because of the global namespace. I can clear
the methods and variables with interpreter.getNameSpace().clear(), but the
class definition remains. So when I try to run the script the second time, I
get a InvocationTargetException stating a duplicate class definition.
How can I make sure that all class definitions, etc are gone?
I also fiddled with namespace.classLoaderChanged(),
bshclassmanager.reloadAllClasses(), without success.
All comments greatly appreciated,
Get latest updates about Open Source Projects, Conferences and News.