Skip to content

RuntimeError: Unable to start Tika server. #428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mg64ve opened this issue Apr 5, 2025 · 5 comments
Open

RuntimeError: Unable to start Tika server. #428

mg64ve opened this issue Apr 5, 2025 · 5 comments
Assignees
Labels
Milestone

Comments

@mg64ve
Copy link

mg64ve commented Apr 5, 2025

Hi just installed a virtual environment and used pip to install tika.
If I try to run the following code:

#!/usr/bin/env python
import tika
from tika import config
print(config.getParsers())
print(config.getMimeTypes())
print(config.getDetectors())

I am getting:

(myenv) [marco@dellg5 905775388]$ python3
Python 3.13.1 (main, Dec  4 2024, 18:05:56) [GCC 14.2.1 20240910] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> #!/usr/bin/env python
... import tika
... from tika import config
... print(config.getParsers())
... print(config.getMimeTypes())
... print(config.getDetectors())
... 
2025-04-05 16:21:32,257 [MainThread  ] [WARNI]  Failed to see startup log message; retrying...
2025-04-05 16:21:37,257 [MainThread  ] [WARNI]  Failed to see startup log message; retrying...
2025-04-05 16:21:42,258 [MainThread  ] [WARNI]  Failed to see startup log message; retrying...
2025-04-05 16:21:47,258 [MainThread  ] [ERROR]  Tika startup log message not received after 3 tries.
2025-04-05 16:21:47,259 [MainThread  ] [ERROR]  Failed to receive startup confirmation from startServer.
Traceback (most recent call last):
  File "<python-input-0>", line 4, in <module>
    print(config.getParsers())
          ~~~~~~~~~~~~~~~~~^^
  File "/home/marco/myenv/lib/python3.13/site-packages/tika/config.py", line 22, in getParsers
    return getConfig('parsers')[1]
           ~~~~~~~~~^^^^^^^^^^^
  File "/home/marco/myenv/lib/python3.13/site-packages/tika/tika.py", line 503, in getConfig
    status, response = callServer('get', serverEndpoint, service, None, {'Accept': responseMimeType}, verbose, tikaServerJar, requestOptions=requestOptions)
                       ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marco/myenv/lib/python3.13/site-packages/tika/tika.py", line 532, in callServer
    serverEndpoint = checkTikaServer(scheme, serverHost, port, tikaServerJar, classpath, config_path)
  File "/home/marco/myenv/lib/python3.13/site-packages/tika/tika.py", line 602, in checkTikaServer
    raise RuntimeError("Unable to start Tika server.")
RuntimeError: Unable to start Tika server.

JAVA 8 is available in the path.

@chrismattmann
Copy link
Owner

can you show that Tika Server is running in the background? What is the result of ps aux | grep java after you run config.getParsers()?

Also what is in /tmp/*tika*log? any errors?

@chrismattmann chrismattmann self-assigned this Apr 6, 2025
@chrismattmann chrismattmann added this to the tika-next milestone Apr 6, 2025
@mg64ve
Copy link
Author

mg64ve commented Apr 7, 2025

Hi @chrismattmann, the result is the following:

$ ps -aux | grep -i java
marco      14986  0.0  0.0   6468  3952 pts/1    S+   10:03   0:00 grep --colour=auto -i java

yes, there is an error in tika-server.log:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/tika/server/core/TikaServerCli has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:621)

My java version is:

$ java -version
openjdk version "1.8.0_442"
OpenJDK Runtime Environment (build 1.8.0_442-b06)
OpenJDK 64-Bit Server VM (build 25.442-b06, mixed mode)

@TOZXII
Copy link

TOZXII commented Apr 14, 2025

try to run it with java 11

@chrismattmann
Copy link
Owner

Yes, please try to run it with java 11 as @TOZXII stated.

@mg64ve
Copy link
Author

mg64ve commented Apr 17, 2025

@TOZXII @chrismattmann with Java 11 it works. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants