Using Groovy Swing Builder
This seems not to be possible with the current security policy.
The builder capability requires to introspect the methods of the Swing components. Any Swing Builder invocation fails with:
[font=”Courier New”]access denied (java.lang.RuntimePermission accessDeclaredMembers)[/font]
I did try to modify the permissions in the policy file in the .subx_configuration directory but it seems that Quantrix resets those on start up.
Is it your intention to prevent use of Swing Builder? Is there a way to change the policy file as a workaround in the short-term?
Thanks
To follow up on this issue, it seems the problem with Swing Builder is related to the way Groovy’s class loader operates. Specifically, it does not inherit the security policy that Quantrix uses, so even though our policy actually grants the correct permissions to (hypothetically) allow this to work, they do not take effect for the Swing Builder classes which end up being loaded by Groovy. Since Groovy is running in the context of a security manager due to Quantrix, this causes a problem. The fix for this is potentially involved, but we will try to look into it for an upcoming release.
Simon – Not sure about modifying the policy file, but Swing Builder seems like a reasonable application and we are willing to look into some other ways of allowing it to work. I’ll have to look further into this and follow up with you next week to let you know the outcome.
Dominik – I can relate to your situation, but unfortunately our hands are tied on this one. Allowing the execution of arbitrary libraries from the system folder would be a major security liability, so that isn’t something we’re able to change. Sorry about that.
Ben
Hi Simon,
Hi Quantrix developers,
Simon, thank you for bringing up this issue. I have a similar issues when I try to use lp_solve within Quantrix: [url:2boiowrd]http://lpsolve.sourceforge.net/5.5/[/url:2boiowrd]
To access lp_solve from Quantrix you have to add this file to the ScriptingLibs folder:
lpsolve55j.jar
Installation of lp_solve:
1) Copy the lp_solve dynamic libraries from the archives lp_solve_5.5_dev.(zip or tar.gz) and lp_solve_5.5_exe.(zip or tar.gz) to a standard library directory for your target platform.
2) On Windows, a typical place would be WINDOWS or WINDOWSSYSTEM32.
3) Unzip the Java wrapper distribution file to new directory of your choice.
On Windows, copy the wrapper stub library lpsolve55j.dll to the directory that already contains lpsolve55.dll.
When I run the test script (see the attached file “lpsolve.model”) the I get this message:
“Error running script: access denied (java.lang.RuntimePermission loadLibrary.lpsolve55j”
Like Simon, I tried to change the permission settings in Quantrix but I wasn’t successful either.
I fully understand that the security has a high priority. That’s very important. But it would be great if we could use external libraries like lp_solve or optimJ (another freely available solver API). This willallow us to add solver capabilities to Quantrix.
The attached zip file contains:
– lpsolve.model (including a sample Groovy script -> click the button on the Canvas)
– lpsolve55j.jar
– lpsolve55.dll
– lpsolve55j.dll
All the best,
Dominik