Security exception with sphinx4 jars

时间:2017-10-12 09:42:30

标签: java cmusphinx

I created a project with sphinx & cloudgarden.But when i run the rpoject it gives an error from the sphinx part as below

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)

and this is the code for sphinx

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");

    }  


}

used APIs are

  • sphinx4-core-1.0.0.jar

  • sphinx4-data-1.0.0.jar

How can i resolve this issue.

1 个答案:

答案 0 :(得分:0)

您正在尝试使用受感染的罐子。您可以从官方网站获取最新的罐子。它们应该有版本5prealpha,而不是1.0.0。