我用狮身人面像和cloudgarden创建了一个项目,但是当我运行rpoject时,它从狮身人面像部分给出了错误,如下所示
Exception in thread "Thread-20" java.lang.SecurityException: class "edu.cmu.sphinx.util.props.ConfigurationManagerUtils"'s signer information does not match signer information of other classes in the same package
at java.lang.ClassLoader.checkCerts(ClassLoader.java:898)
at java.lang.ClassLoader.preDefineClass(ClassLoader.java:668)
at java.lang.ClassLoader.defineClass(ClassLoader.java:761)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at edu.cmu.sphinx.api.Context.<init>(Context.java:59)
at edu.cmu.sphinx.api.Context.<init>(Context.java:45)
at edu.cmu.sphinx.api.AbstractSpeechRecognizer.<init>(AbstractSpeechRecognizer.java:44)
at edu.cmu.sphinx.api.LiveSpeechRecognizer.<init>(LiveSpeechRecognizer.java:34)
at hbsn.HBSN.Sphinx(HBSN.java:275)
at hbsn.HBSN$2.run(HBSN.java:205)
这是狮身人面像的代码
public static Configuration configuration;
public static LiveSpeechRecognizer recognize;
public static SpeechResult result;
public static String Sphinx_Result;
public static void Sphinx() throws InterruptedException{
try {
configuration = new edu.cmu.sphinx.api.Configuration();
configuration.setAcousticModelPath("resource:/edu/cmu/sphinx/models/en-us/en-us");
configuration.setDictionaryPath("file:C:/HBSN/Dictioanary-1000.dic");
configuration.setLanguageModelPath("file:C:/HBSN/Language Model-1000.lm");
configuration.setUseGrammar(false);
recognize = new LiveSpeechRecognizer(configuration);
recognize.startRecognition(true);
while ((result = recognize.getResult()) != null) {
Sphinx_Result = result.getHypothesis();
}
recognize.stopRecognition();
} catch (IOException e) {
main.Error("Error In Sphinx", " sphinx speech recognition unit not working");
}
}
使用的API是
sphinx4-core-1.0.0.jar
sphinx4-data-1.0.0.jar
我该如何解决这个问题。
最佳答案
您正在尝试使用受损的罐子。您可以从官方网站上获得最新的罐子。他们应该具有版本5prealpha,而不是1.0.0。
关于java - sphinx4 jars的安全异常,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/46706340/