I'm getting this error when compiling Apache Tika the latest version on debian. Any help will be appreciated.
I've downloaded the latest version from tika.apache.org/download.html. Installed maven with aptitude. I use debian. And also have installed sun-java6-jdk. Set JAVA_HOME variable. Then I just go to base tika folder and run "mvn clean install". More interesting is that I could install a few days ago it on another debian server without any problems.
Running org.apache.tika.fork.ForkParserTest
java.lang.ClassNotFoundException: Unable to find class org.apache.tika.metadata.Metadata
at org.apache.tika.fork.ClassLoaderProxy.findClass(ClassLoaderProxy.java:117)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.reflect.Method.getType(libgcj.so.90)
at java.lang.reflect.Method.getParameterTypes(libgcj.so.90)
at org.apache.tika.fork.ForkServer.call(ForkServer.java:130)
at org.apache.tika.fork.ForkServer.processRequests(ForkServer.java:116)
at org.apache.tika.fork.ForkServer.main(ForkServer.java:64)
java.lang.ClassNotFoundException: Unable to find class org.apache.tika.metadata.Metadata
at org.apache.tika.fork.ClassLoaderProxy.findClass(ClassLoaderProxy.java:117)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.reflect.Method.getType(libgcj.so.90)
at java.lang.reflect.Method.getParameterTypes(libgcj.so.90)
at org.apache.tika.fork.ForkServer.call(ForkServer.java:130)
at org.apache.tika.fork.ForkServer.processRequests(ForkServer.java:116)
at org.apache.tika.fork.ForkServer.main(ForkServer.java:64)
java.lang.ClassNotFoundException: Unable to find class org.apache.tika.metadata.Metadata
at org.apache.tika.fork.ClassLoaderProxy.findClass(ClassLoaderProxy.java:117)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.reflect.Method.getType(libgcj.so.90)
at java.lang.reflect.Method.getParameterTypes(libgcj.so.90)
at org.apache.tika.fork.ForkServer.call(ForkServer.java:130)
at org.apache.tika.fork.ForkServer.processRequests(ForkServer.java:116)
at org.apache.tika.fork.ForkServer.main(ForkServer.java:64)
java.lang.ClassNotFoundException: Unable to find class org.apache.tika.metadata.Metadata
at org.apache.tika.fork.ClassLoaderProxy.findClass(ClassLoaderProxy.java:117)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.reflect.Method.getType(libgcj.so.90)
at java.lang.reflect.Method.getParameterTypes(libgcj.so.90)
at org.apache.tika.fork.ForkServer.call(ForkServer.java:130)
at org.apache.tika.fork.ForkServer.processRequests(ForkServer.java:116)
at org.apache.tika.fork.ForkServer.main(ForkServer.java:64)
java.lang.ClassNotFoundException: Unable to find class org.apache.tika.metadata.Metadata
at org.apache.tika.fork.ClassLoaderProxy.findClass(ClassLoaderProxy.java:117)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.reflect.Method.getType(libgcj.so.90)
at java.lang.reflect.Method.getParameterTypes(libgcj.so.90)
at org.apache.tika.fork.ForkServer.call(ForkServer.java:130)
at org.apache.tika.fork.ForkServer.processRequests(ForkServer.java:116)
at org.apache.tika.fork.ForkServer.main(ForkServer.java:64)
java.lang.ClassNotFoundException: Unable to find class org.apache.tika.metadata.Metadata
at org.apache.tika.fork.ClassLoaderProxy.findClass(ClassLoaderProxy.java:117)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.reflect.Method.getType(libgcj.so.90)
at java.lang.reflect.Method.getParameterTypes(libgcj.so.90)
at org.apache.tika.fork.ForkServer.call(ForkServer.java:130)
at org.apache.tika.fork.ForkServer.processRequests(ForkServer.java:116)
at org.apache.tika.fork.ForkServer.main(ForkServer.java:64)
java.lang.ClassNotFoundException: Unable to find class org.apache.tika.metadata.Metadata
at org.apache.tika.fork.ClassLoaderProxy.findClass(ClassLoaderProxy.java:117)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.开发者_StackOverflowlang.reflect.Method.getType(libgcj.so.90)
at java.lang.reflect.Method.getParameterTypes(libgcj.so.90)
at org.apache.tika.fork.ForkServer.call(ForkServer.java:130)
at org.apache.tika.fork.ForkServer.processRequests(ForkServer.java:116)
at org.apache.tika.fork.ForkServer.main(ForkServer.java:64)
java.lang.ClassNotFoundException: Unable to find class org.apache.tika.metadata.Metadata
at org.apache.tika.fork.ClassLoaderProxy.findClass(ClassLoaderProxy.java:117)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.reflect.Method.getType(libgcj.so.90)
at java.lang.reflect.Method.getParameterTypes(libgcj.so.90)
at org.apache.tika.fork.ForkServer.call(ForkServer.java:130)
at org.apache.tika.fork.ForkServer.processRequests(ForkServer.java:116)
at org.apache.tika.fork.ForkServer.main(ForkServer.java:64)
java.lang.ClassNotFoundException: Unable to find class org.apache.tika.metadata.Metadata
at org.apache.tika.fork.ClassLoaderProxy.findClass(ClassLoaderProxy.java:117)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.reflect.Method.getType(libgcj.so.90)
at java.lang.reflect.Method.getParameterTypes(libgcj.so.90)
at org.apache.tika.fork.ForkServer.call(ForkServer.java:130)
at org.apache.tika.fork.ForkServer.processRequests(ForkServer.java:116)
at org.apache.tika.fork.ForkServer.main(ForkServer.java:64)
java.lang.ClassNotFoundException: Unable to find class org.apache.tika.metadata.Metadata
at org.apache.tika.fork.ClassLoaderProxy.findClass(ClassLoaderProxy.java:117)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.reflect.Method.getType(libgcj.so.90)
at java.lang.reflect.Method.getParameterTypes(libgcj.so.90)
at org.apache.tika.fork.ForkServer.call(ForkServer.java:130)
at org.apache.tika.fork.ForkServer.processRequests(ForkServer.java:116)
at org.apache.tika.fork.ForkServer.main(ForkServer.java:64)
java.lang.ClassNotFoundException: Unable to find class org.apache.tika.metadata.Metadata
at org.apache.tika.fork.ClassLoaderProxy.findClass(ClassLoaderProxy.java:117)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.reflect.Method.getType(libgcj.so.90)
at java.lang.reflect.Method.getParameterTypes(libgcj.so.90)
at org.apache.tika.fork.ForkServer.call(ForkServer.java:130)
at org.apache.tika.fork.ForkServer.processRequests(ForkServer.java:116)
at org.apache.tika.fork.ForkServer.main(ForkServer.java:64)
org.apache.tika.exception.TikaException: Failed to communicate with a forked parser process. The process has most likely crashed due to some error like running out of memory. A new process will be started for the next parsing request.
at org.apache.tika.fork.ForkParser.parse(ForkParser.java:120)
at org.apache.tika.fork.ForkParserTest$1.run(ForkParserTest.java:80)
Caused by: java.io.IOException: Lost connection to a forked server process
at org.apache.tika.fork.ForkClient.waitForResponse(ForkClient.java:169)
at org.apache.tika.fork.ForkClient.sendObject(ForkClient.java:137)
at org.apache.tika.fork.ForkClient.call(ForkClient.java:108)
at org.apache.tika.fork.ForkParser.parse(ForkParser.java:117)
... 1 more
org.apache.tika.exception.TikaException: Failed to communicate with a forked parser process. The process has most likely crashed due to some error like running out of memory. A new process will be started for the next parsing request.
at org.apache.tika.fork.ForkParser.parse(ForkParser.java:120)
at org.apache.tika.fork.ForkParserTest$1.run(ForkParserTest.java:80)
Caused by: java.io.IOException: Lost connection to a forked server process
at org.apache.tika.fork.ForkClient.waitForResponse(ForkClient.java:169)
at org.apache.tika.fork.ForkClient.sendObject(ForkClient.java:137)
at org.apache.tika.fork.ForkClient.call(ForkClient.java:108)
at org.apache.tika.fork.ForkParser.parse(ForkParser.java:117)
... 1 more
org.apache.tika.exception.TikaException: Failed to communicate with a forked parser process. The process has most likely crashed due to some error like running out of memory. A new process will be started for the next parsing request.
at org.apache.tika.fork.ForkParser.parse(ForkParser.java:120)
at org.apache.tika.fork.ForkParserTest$1.run(ForkParserTest.java:80)
Caused by: java.io.IOException: Lost connection to a forked server process
at org.apache.tika.fork.ForkClient.waitForResponse(ForkClient.java:169)
at org.apache.tika.fork.ForkClient.sendObject(ForkClient.java:137)
at org.apache.tika.fork.ForkClient.call(ForkClient.java:108)
at org.apache.tika.fork.ForkParser.parse(ForkParser.java:117)
... 1 more
org.apache.tika.exception.TikaException: Failed to communicate with a forked parser process. The process has most likely crashed due to some error like running out of memory. A new process will be started for the next parsing request.
at org.apache.tika.fork.ForkParser.parse(ForkParser.java:120)
at org.apache.tika.fork.ForkParserTest$1.run(ForkParserTest.java:80)
Caused by: java.io.IOException: Lost connection to a forked server process
at org.apache.tika.fork.ForkClient.waitForResponse(ForkClient.java:169)
at org.apache.tika.fork.ForkClient.sendObject(ForkClient.java:137)
at org.apache.tika.fork.ForkClient.call(ForkClient.java:108)
at org.apache.tika.fork.ForkParser.parse(ForkParser.java:117)
... 1 more
org.apache.tika.exception.TikaException: Failed to communicate with a forked parser process. The process has most likely crashed due to some error like running out of memory. A new process will be started for the next parsing request.
at org.apache.tika.fork.ForkParser.parse(ForkParser.java:120)
at org.apache.tika.fork.ForkParserTest$1.run(ForkParserTest.java:80)
Caused by: java.io.IOException: Lost connection to a forked server process
at org.apache.tika.fork.ForkClient.waitForResponse(ForkClient.java:169)
at org.apache.tika.fork.ForkClient.sendObject(ForkClient.java:137)
at org.apache.tika.fork.ForkClient.call(ForkClient.java:108)
at org.apache.tika.fork.ForkParser.parse(ForkParser.java:117)
... 1 more
org.apache.tika.exception.TikaException: Failed to communicate with a forked parser process. The process has most likely crashed due to some error like running out of memory. A new process will be started for the next parsing request.
at org.apache.tika.fork.ForkParser.parse(ForkParser.java:120)
at org.apache.tika.fork.ForkParserTest$1.run(ForkParserTest.java:80)
Caused by: java.io.IOException: Lost connection to a forked server process
at org.apache.tika.fork.ForkClient.waitForResponse(ForkClient.java:169)
at org.apache.tika.fork.ForkClient.sendObject(ForkClient.java:137)
at org.apache.tika.fork.ForkClient.call(ForkClient.java:108)
at org.apache.tika.fork.ForkParser.parse(ForkParser.java:117)
... 1 more
org.apache.tika.exception.TikaException: Failed to communicate with a forked parser process. The process has most likely crashed due to some error like running out of memory. A new process will be started for the next parsing request.
at org.apache.tika.fork.ForkParser.parse(ForkParser.java:120)
at org.apache.tika.fork.ForkParserTest$1.run(ForkParserTest.java:80)
Caused by: java.io.IOException: Lost connection to a forked server process
at org.apache.tika.fork.ForkClient.waitForResponse(ForkClient.java:169)
at org.apache.tika.fork.ForkClient.sendObject(ForkClient.java:137)
at org.apache.tika.fork.ForkClient.call(ForkClient.java:108)
at org.apache.tika.fork.ForkParser.parse(ForkParser.java:117)
... 1 more
org.apache.tika.exception.TikaException: Failed to communicate with a forked parser process. The process has most likely crashed due to some error like running out of memory. A new process will be started for the next parsing request.
at org.apache.tika.fork.ForkParser.parse(ForkParser.java:120)
at org.apache.tika.fork.ForkParserTest$1.run(ForkParserTest.java:80)
Caused by: java.io.IOException: Lost connection to a forked server process
at org.apache.tika.fork.ForkClient.waitForResponse(ForkClient.java:169)
at org.apache.tika.fork.ForkClient.sendObject(ForkClient.java:137)
at org.apache.tika.fork.ForkClient.call(ForkClient.java:108)
at org.apache.tika.fork.ForkParser.parse(ForkParser.java:117)
... 1 more
org.apache.tika.exception.TikaException: Failed to communicate with a forked parser process. The process has most likely crashed due to some error like running out of memory. A new process will be started for the next parsing request.
at org.apache.tika.fork.ForkParser.parse(ForkParser.java:120)
at org.apache.tika.fork.ForkParserTest$1.run(ForkParserTest.java:80)
Caused by: java.io.IOException: Lost connection to a forked server process
at org.apache.tika.fork.ForkClient.waitForResponse(ForkClient.java:169)
at org.apache.tika.fork.ForkClient.sendObject(ForkClient.java:137)
at org.apache.tika.fork.ForkClient.call(ForkClient.java:108)
at org.apache.tika.fork.ForkParser.parse(ForkParser.java:117)
... 1 more
java.lang.ClassNotFoundException: Unable to find class org.apache.tika.metadata.Metadata
at org.apache.tika.fork.ClassLoaderProxy.findClass(ClassLoaderProxy.java:117)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.reflect.Method.getType(libgcj.so.90)
at java.lang.reflect.Method.getParameterTypes(libgcj.so.90)
at org.apache.tika.fork.ForkServer.call(ForkServer.java:130)
at org.apache.tika.fork.ForkServer.processRequests(ForkServer.java:116)
at org.apache.tika.fork.ForkServer.main(ForkServer.java:64)
org.apache.tika.exception.TikaException: Failed to communicate with a forked parser process. The process has most likely crashed due to some error like running out of memory. A new process will be started for the next parsing request.
at org.apache.tika.fork.ForkParser.parse(ForkParser.java:120)
at org.apache.tika.fork.ForkParserTest$1.run(ForkParserTest.java:80)
Caused by: java.io.IOException: Lost connection to a forked server process
at org.apache.tika.fork.ForkClient.waitForResponse(ForkClient.java:169)
at org.apache.tika.fork.ForkClient.sendObject(ForkClient.java:137)
at org.apache.tika.fork.ForkClient.call(ForkClient.java:108)
at org.apache.tika.fork.ForkParser.parse(ForkParser.java:117)
... 1 more
Tests run: 3, Failures: 1, Errors: 2, Skipped: 0, Time elapsed: 1.621 sec <<< FAILURE!
Running org.apache.tika.metadata.TestMetadata
Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.016 sec
Running org.apache.tika.mime.MediaTypeTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.012 sec
Running org.apache.tika.detect.TextDetectorTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec
Running org.apache.tika.TikaTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.157 sec
Running org.apache.tika.detect.TypeDetectorTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec
Running org.apache.tika.sax.SafeContentHandlerTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 sec
Running org.apache.tika.sax.BodyContentHandlerTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec
Running org.apache.tika.mime.MimeDetectionTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.631 sec
Running org.apache.tika.language.LanguageProfileTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec
Running org.apache.tika.language.LanguageIdentifierTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.949 sec
Running org.apache.tika.TestRereadableInputStream
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 sec
Running org.apache.tika.language.ProfilingWriterTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec
Results :
Failed tests:
testParallelParsing(org.apache.tika.fork.ForkParserTest)
Tests in error:
testHelloWorld(org.apache.tika.fork.ForkParserTest)
testSerialParsing(org.apache.tika.fork.ForkParserTest)
Tests run: 83, Failures: 1, Errors: 2, Skipped: 0
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
Based on your stack trace, I don't think you're using the Sun JDK. Instead, I think you're using GCJ (the GNU Java stuff) - if you look in the stacktrace you'll see references to libgcj.so which is the giveaway.
I think therefore that what you need to do is use update-alternatives to pick the Sunk JDK / JRE instead of the GNU GCJ one. After that, Tika ought to compile fine.
Try:
update-alternatives --list java
update-alternatives --list javac
update-alternatives --display java
update-alternatives --display javac
The to pick you can use
update-alternatives --config java
update-alternatives --config javac
(You might also want to update jar, jarsigner and a few others too)
精彩评论