apache / lucene

Apache Lucene open-source search software
https://lucene.apache.org/
Apache License 2.0
2.67k stars 1.03k forks source link

Constants.java generates AccessControl Exception in unsigned applet [LUCENE-4205] #5277

Open asfimport opened 12 years ago

asfimport commented 12 years ago

Using Lucene (i.e. writing a Document to a RAMDirectory) in an unsigned applet causes an AccessControlException because Constants.java is attempting to read a System property that is not allowed.

Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "sun.arch.data.model" "read") at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPropertyAccess(Unknown Source) at java.lang.System.getProperty(Unknown Source) at org.apache.lucene.util.Constants.<clinit>(Constants.java:84)

on line 84: final String x = System.getProperty("sun.arch.data.model");

We have tested setting the String x to the property value for "java.vm.name" and find that works for us...


Migrated from LUCENE-4205 by Stuart Rose, updated Jul 10 2012 Environment:

unsigned applet
asfimport commented 12 years ago

Dawid Weiss (@dweiss) (migrated from JIRA)

This is ram usage estimator. I guess the question is do we support running with security manager on?

asfimport commented 12 years ago

Robert Muir (@rmuir) (migrated from JIRA)

we dont if we dont test for it.

asfimport commented 12 years ago

Dawid Weiss (@dweiss) (migrated from JIRA)

Stuart – did any historical lucene version work for you with security manager enabled (in a sandbox)?