iotashan / cfsolrlib

ColdFusion library for advanced Solr integration
MIT License
30 stars 16 forks source link

Magic match pattern is null when attempting to start Tika #16

Open tomchiverton opened 8 years ago

tomchiverton commented 8 years ago
APPLICATION.tika = APPLICATION.javaloader.create("org.apache.tika.Tika").init();

is throwing

lucee.runtime.exp.NativeException: Magic match pattern is null
    at org.apache.tika.detect.MagicDetector.(MagicDetector.java:281)
    at org.apache.tika.detect.MagicDetector.parse(MagicDetector.java:63)
    at org.apache.tika.mime.MagicMatch.getDetector(MagicMatch.java:54)
    at org.apache.tika.mime.MagicMatch.size(MagicMatch.java:71)
    at org.apache.tika.mime.Magic.size(Magic.java:55)
    at org.apache.tika.mime.Magic.compareTo(Magic.java:65)
    at org.apache.tika.mime.Magic.compareTo(Magic.java:25)
    at java.util.ComparableTimSort.binarySort(ComparableTimSort.java:262)
    at java.util.ComparableTimSort.sort(ComparableTimSort.java:207)
    at java.util.Arrays.sort(Arrays.java:1312)
    at java.util.Arrays.sort(Arrays.java:1506)
    at java.util.ArrayList.sort(ArrayList.java:1454)
    at java.util.Collections.sort(Collections.java:141)
    at org.apache.tika.mime.MimeTypes.init(MimeTypes.java:393)
    at org.apache.tika.mime.MimeTypesFactory.create(MimeTypesFactory.java:66)
    at org.apache.tika.mime.MimeTypesFactory.create(MimeTypesFactory.java:93)
    at org.apache.tika.mime.MimeTypesFactory.create(MimeTypesFactory.java:149)
    at org.apache.tika.mime.MimeTypes.getDefaultMimeTypes(MimeTypes.java:479)
    at org.apache.tika.config.TikaConfig.getDefaultMimeTypes(TikaConfig.java:60)
    at org.apache.tika.config.TikaConfig.(TikaConfig.java:169)
    at org.apache.tika.config.TikaConfig.getDefaultConfig(TikaConfig.java:268)
    at org.apache.tika.Tika.(Tika.java:93)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at lucee.runtime.reflection.pairs.ConstructorInstance.invoke(ConstructorInstance.java:52)

Lucee 5.x, Java 1.8.x, 64 bit Amazon Linux

tomchiverton commented 8 years ago

Under Lucee 4.x on the same server it starts fine.

gilmoart commented 5 years ago

I am having the same issue after applying CF Update 12. How did you resolve this issue?

gvegas005 commented 4 years ago

I am having the same issue after applying CF Update 12. How did you resolve this issue?

@gilmoart Having a similar issue. Did you ever resolve?

gilmoart commented 4 years ago

I switched from Tika1.2 to Tika.1.18. This version allow our application to start but that had other issues with duplicate functions that exist in other jar files and over time the server would stop working. Moving to any other version above 1.18 didn't work either so we are currently stuck on 1.18. I haven't yet determined what the issue is with Tika but I work on when I have time. There is a ColdFusion Update 13 available that I haven't tried yet.

On December 3, 2019 at 9:09 AM gvegas005 notifications@github.com wrote:

    > > 
    I am having the same issue after applying CF Update 12. How did you resolve this issue?

> 

@gilmoart https://github.com/gilmoart Having a similar issue. Did you ever resolve?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/iotashan/cfsolrlib/issues/16?email_source=notifications&email_token=ANOACASYOS3GBVPD7SAYJTDQWZSDJA5CNFSM4B67UREKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFZPZOY#issuecomment-561183931 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ANOACAUCIENH5BKBUPDPAUTQWZSDJANCNFSM4B67UREA .
gvegas005 commented 4 years ago

@gilmoart I tried 13 and had the same issues as I did with 12. Thanks for the information. Gives me something to look into.

samihoda commented 4 years ago

Did anyone ever resolve this issue? I also get this:

/app/cfsolrlib/Application.cfc: line 23

21: APPLICATION.javaloader = createObject("component", "javaloader.JavaLoader").init(loadpaths=paths, loadColdFusionClassPath=true);
22: // setup tika
23: APPLICATION.tika = APPLICATION.javaloader.create("org.apache.tika.Tika").init();
24:
25: return true;
  lucee.runtime.exp.NativeException: Provider for class javax.xml.parsers.SAXParserFactory cannot be created  at java.xml/javax.xml.parsers.FactoryFinder.findServiceProvider(FactoryFinder.java:305)  at java.xml/javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:261)  at java.xml/javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:147)  at org.apache.tika.mime.MimeTypesReader.read(MimeTypesReader.java:112)  at org.apache.tika.mime.MimeTypesFactory.create(MimeTypesFactory.java:64)  at org.apache.tika.mime.MimeTypesFactory.create(MimeTypesFactory.java:93)  at org.apache.tika.mime.MimeTypesFactory.create(MimeTypesFactory.java:149)  at org.apache.tika.mime.MimeTypes.getDefaultMimeTypes(MimeTypes.java:479)  at org.apache.tika.config.TikaConfig.getDefaultMimeTypes(TikaConfig.java:60)  at org.apache.tika.config.TikaConfig.(TikaConfig.java:169)  at org.apache.tika.config.TikaConfig.getDefaultConfig(TikaConfig.java:268)  at org.apache.tika.Tika.(Tika.java:93)  at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)  at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)  at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)  at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)  at lucee.runtime.reflection.pairs.ConstructorInstance.invoke(ConstructorInstance.java:53)  at lucee.runtime.reflection.Reflector.callConstructor(Reflector.java:835)  at lucee.runtime.java.JavaObject.init(JavaObject.java:326)  at lucee.runtime.java.JavaObject.call(JavaObject.java:251)  at lucee.runtime.java.JavaObject.call(JavaObject.java:287)
gilmoart commented 4 years ago

If you are using Java 1.8.x, try Java 11.x.