vosk-api
vosk-api copied to clipboard
java.lang.NoClassDefFoundError: Could not initialize class org.vosk.LibVosk
@timestamp":"2022-07-08T16:43:53.467+08:00","@version":"1","message":"Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.vosk.LibVosk] with root cause","logger_name":"org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[dispatcherServlet]","thread_name":"http-nio-8888-exec-2","level":"ERROR","level_value":40000,"stack_trace":"java.lang.NoClassDefFoundError: Could not initialize class org.vosk.LibVosk\n\tat org.vosk.Model.<init>(Model.java:11)\n
同一份代码,同一个model,不同的环境就出问题了,正常环境为:centos7 存在问题的环境为:Rocky OSV6.0.42
pom信息
<dependency>
<groupId>com.alphacephei</groupId>
<artifactId>vosk</artifactId>
<version>0.3.32</version>
</dependency>
Rocky OSV6.0.42
http://www.linx-info.com/#/support/software
这种奇奇怪怪的操作系统真的很令人头疼
You can probably try precompiled libvosk.so with C example on that OS first. It might be that you have to compile libvosk yourself. Like GLIBC are missing or something like that. Just run ldd libvosk.so
first.