在Solr日志中,我看到错误-
@Override
public void onPermissionRequest(PermissionRequest request) {
String[] resources = request.getResources();
for (int i = 0; i < resources.length; i++) {
if (PermissionRequest.RESOURCE_PROTECTED_MEDIA_ID.equals(resources[i])) {
request.grant(resources);
return;
}
}
super.onPermissionRequest(request);
}
我正在尝试添加标志java.lang.UnsupportedOperationException: Serialization support for
org.apache.commons.collections.functors.InvokerTransformer is disabled for
security reasons. To enable it set system property
'org.apache.commons.collections.enableUnsafeSerialization' to 'true',
but you must ensure that your application does not de-serialize
objects from untrusted sources.
,但这无济于事。
如何正确启用此属性? (我无法访问solrconfig.xml)
答案 0 :(得分:1)
您可以将其添加到SOLR_OPTS
环境变量中,或将其直接传递到启动脚本:
bin/solr start -Dorg.apache.commons.collections.enableUnsafeSerialization=true
根据Configuring solrconfig.xml docs:
通常,可以使用标准-Dproperty = value语法通过bin / solr脚本传递要设置的任何Java系统属性。另外,您可以将公共系统属性添加到Solr包含文件(bin / solr.in.sh或bin / solr.in.cmd)中定义的SOLR_OPTS环境变量中。