You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by "Reto Bachmann-Gmür (JIRA)" <ji...@apache.org> on 2012/08/31 16:53:07 UTC

[jira] [Resolved] (STANBOL-728) NEREngineCore catches security exception and rethrow them wrapped in an EngineException

     [ https://issues.apache.org/jira/browse/STANBOL-728?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reto Bachmann-Gmür resolved STANBOL-728.
----------------------------------------

    Resolution: Fixed
      Assignee: Reto Bachmann-Gmür

The exception is no longer caught in the NEREngine and the EventJobManager rethrows SecurityExceptions causing jobs to fail.
It seems highly questionable that perissions to read this files should be granted to the user, it would probably be better the file access is done in a privileged code section (see http://docs.oracle.com/javase/1.4.2/docs/guide/security/doprivileged.html on how to do this), but this is out of the scope of this issue.
                
> NEREngineCore catches security exception and rethrow them wrapped in an EngineException
> ---------------------------------------------------------------------------------------
>
>                 Key: STANBOL-728
>                 URL: https://issues.apache.org/jira/browse/STANBOL-728
>             Project: Stanbol
>          Issue Type: Bug
>            Reporter: Reto Bachmann-Gmür
>            Assignee: Reto Bachmann-Gmür
>
> NEREngineCore seems to catch SecurityException, SecurityException should not be catched as to allow the AuthenticatingFilter to handle them.
> org.apache.stanbol.enhancer.servicesapi.EngineException: 'NEREngineCore' failed to process content item 'urn:content-item-sha1-2aae6c35c94fcfb415dbe95f408b9ce91ee846ed' with type 'text/plain': java.security.AccessControlException: access denied (java.io.FilePermission /home/reto/projects/apache/stanbol/launchers/full/target/stanbol/datafiles/en-ner-organization.bin read)
> 	at org.apache.stanbol.enhancer.engines.opennlp.impl.NEREngineCore.computeEnhancements(NEREngineCore.java:181)
> 	at org.apache.stanbol.enhancer.engines.opennlp.impl.NamedEntityExtractionEnhancementEngine.computeEnhancements(NamedEntityExtractionEnhancementEngine.java:164)
> 	at org.apache.stanbol.enhancer.jobmanager.event.impl.EnhancementJobHandler.processEvent(EnhancementJobHandler.java:259)
> 	at org.apache.stanbol.enhancer.jobmanager.event.impl.EnhancementJobHandler.handleEvent(EnhancementJobHandler.java:181)
> 	at org.apache.felix.eventadmin.impl.tasks.HandlerTaskImpl.execute(HandlerTaskImpl.java:88)
> 	at org.apache.felix.eventadmin.impl.tasks.SyncDeliverTasks.execute(SyncDeliverTasks.java:221)
> 	at org.apache.felix.eventadmin.impl.tasks.AsyncDeliverTasks$TaskExecuter.run(AsyncDeliverTasks.java:110)
> 	at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Thread.java:679)
> Caused by: java.security.AccessControlException: access denied (java.io.FilePermission /home/reto/projects/apache/stanbol/launchers/full/target/stanbol/datafiles/en-ner-organization.bin read)
> 	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:393)
> 	at java.security.AccessController.checkPermission(AccessController.java:553)
> 	at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
> 	at java.lang.SecurityManager.checkRead(SecurityManager.java:888)
> 	at java.io.File.exists(File.java:748)
> 	at org.apache.stanbol.commons.stanboltools.datafileprovider.impl.MainDataFileProvider.getDataFile(MainDataFileProvider.java:274)
> 	at org.apache.stanbol.commons.stanboltools.datafileprovider.impl.MainDataFileProvider.getInputStream(MainDataFileProvider.java:156)
> 	at org.apache.stanbol.commons.opennlp.OpenNLP.lookupModelStream(OpenNLP.java:541)
> 	at org.apache.stanbol.commons.opennlp.OpenNLP.initModel(OpenNLP.java:478)
> 	at org.apache.stanbol.commons.opennlp.OpenNLP.initModel(OpenNLP.java:436)
> 	at org.apache.stanbol.commons.opennlp.OpenNLP.getNameModel(OpenNLP.java:140)
> 	at org.apache.stanbol.enhancer.engines.opennlp.impl.NEREngineCore.computeEnhancements(NEREngineCore.java:173)
> 	... 8 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira