Aaron Madlon-Kay created LUCENE-7135:
----------------------------------------
Summary: Constants check for JRE bitness causes SecurityException
under WebStart
Key: LUCENE-7135
URL: https://issues.apache.org/jira/browse/LUCENE-7135
Project: Lucene - Core
Issue Type: Bug
Components: core/other
Affects Versions: 5.5
Environment: OS X 10.11.4, Java 1.8.0_77-b03 (under WebStart)
Reporter: Aaron Madlon-Kay
I have an app that I deploy via WebStart that uses Lucene 5.2.1 (we are locked
to 5.2.1 because that's what [LanguageTool|https://languagetool.org/] uses).
When running under the WebStart security manager, there are two locations where
exceptions are thrown and prevent pretty much all Lucene classes from
initializing.
# In {{RamUsageEstimator}}, fixed by LUCENE-6923
# In {{Constants}}, caused by the call
{{System.getProperty("sun.arch.data.model")}} (stack trace below).
{code}
Error: Caused by: java.security.AccessControlException: access denied
("java.lang.RuntimePermission" "accessDeclaredMembers")
Error: at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
Error: at
java.security.AccessController.checkPermission(AccessController.java:884)
Error: at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
Error: at com.sun.javaws.security.JavaWebStartSecurity.checkPermission(Unknown
Source)
Error: at java.lang.Class.checkMemberAccess(Class.java:2348)
Error: at java.lang.Class.getDeclaredFields(Class.java:1915)
Error: at
org.apache.lucene.util.RamUsageEstimator.shallowSizeOfInstance(RamUsageEstimator.java:293)
Error: at
org.apache.lucene.util.RamUsageEstimator.<clinit>(RamUsageEstimator.java:190)
Error: ... 33 more
{code}
The latter is still present in the latest version. My patch illustrates one
solution that appears to be working for us.
(This patch, together with a backport of the fix to LUCENE-6923, seems to fix
the issue for our purposes.)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]