[ https://issues.apache.org/jira/browse/TIKA-1700?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14650640#comment-14650640 ]
Hudson commented on TIKA-1700: ------------------------------ SUCCESS: Integrated in tika-trunk-jdk1.7 #809 (See [https://builds.apache.org/job/tika-trunk-jdk1.7/809/]) Patch from Bob Paulin from TIKA-1700 - Allow setting the Service Loader dynamic flag and load error handler from the tika config xml (nick: http://svn.apache.org/viewvc/tika/trunk/?view=rev&rev=1693773) * /tika/trunk/tika-core/src/main/java/org/apache/tika/config/ServiceLoader.java * /tika/trunk/tika-core/src/main/java/org/apache/tika/config/TikaConfig.java * /tika/trunk/tika-core/src/test/java/org/apache/tika/config/DummyParser.java * /tika/trunk/tika-core/src/test/java/org/apache/tika/config/TikaConfigTest.java * /tika/trunk/tika-core/src/test/resources/org/apache/tika/config/TIKA-1700-dynamic.xml TIKA-1700 Add TikaConfig constructors that take a ServiceLoader, and add a unit test that shows we (now) use the LoadErrorHandler on that properly for reporting problems with listed class names (nick: http://svn.apache.org/viewvc/tika/trunk/?view=rev&rev=1693759) * /tika/trunk/tika-core/src/main/java/org/apache/tika/config/ServiceLoader.java * /tika/trunk/tika-core/src/main/java/org/apache/tika/config/TikaConfig.java * /tika/trunk/tika-core/src/test/java/org/apache/tika/config/AbstractTikaConfigTest.java * /tika/trunk/tika-core/src/test/java/org/apache/tika/config/TikaConfigTest.java * /tika/trunk/tika-core/src/test/resources/org/apache/tika/config/TIKA-1700-unknown-parser.xml Move AbstractTikaConfigTest to Core, and use that to shorten TikaConfigTest TIKA-1700 (nick: http://svn.apache.org/viewvc/tika/trunk/?view=rev&rev=1693753) * /tika/trunk/tika-core/src/test/java/org/apache/tika/config/AbstractTikaConfigTest.java * /tika/trunk/tika-core/src/test/java/org/apache/tika/config/TikaConfigTest.java * /tika/trunk/tika-parsers/src/test/java/org/apache/tika/config/AbstractTikaConfigTest.java > tika-config.xml does not provide a way to set ServiceLoader to dynamic > ---------------------------------------------------------------------- > > Key: TIKA-1700 > URL: https://issues.apache.org/jira/browse/TIKA-1700 > Project: Tika > Issue Type: Bug > Components: core > Affects Versions: 1.7, 1.8, 1.9, 1.10 > Environment: OSGi > Reporter: Bob Paulin > Fix For: 1.10 > > Attachments: TIKA-1700.patch, TIKA-1700A.patch, TIKA-1700B.patch > > > Currently if you create a TikaConfig from a file (ex tika-config.xml). There > is no way to specify that you want to use a ServiceLoader with dynamic set. > Prior to tika 1.7 this was not an issue since the during the tika-config.xml > parse Tika would instantiate parsers using the default constructor which in > turn would instantiate a new ServiceLoader. The default ServiceLoader > constructor sets dynamic to true which allows dynamic loading of parsers. > Changes to TikaConfig now cause the tika-config.xml parse to call a > constructor which passes the ServiceLoader to be passed as a parameter. This > ServiceLoader is always constructed with a Classloader which will cause > dynamic to always be set to false. This breaks Tika in OSGi environments > which depend on dynamic being set to true (for example Apache Sling). > I'm proposing adding an xml attribute to the parser element to instantiate > the parser with dynamic set to true. This allows users of tika-config.xml to > determine how they want parsers loaded. -- This message was sent by Atlassian JIRA (v6.3.4#6332)