Menu

Class not found exception

Help
gurucharan
2009-04-10
2012-09-22
  • gurucharan

    gurucharan - 2009-04-10

    Hi,

    I am using cmudict.0.6d dictionary to convert english words in wave file to text using WavFile.demo. I have made required changes in the config.xml file, but I am getting following error

    Loading Recognizer as defined in 'jar:file:/C:/sphinx4-1.0beta2-src/sphinx4-1.0b
    eta2/bin/WavFile.jar!/edu/cmu/sphinx/demo/wavfile/config.xml'...

    class not found !java.lang.ClassNotFoundException: edu.cmu.sphinx.model.acoustic
    .WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.Model
    Exception in thread "main" Property Exception component:'flatLinguist' property:
    'acousticModel' - mandatory property is not set!
    edu.cmu.sphinx.util.props.InternalConfigurationException
    at edu.cmu.sphinx.util.props.PropertySheet.getComponent(PropertySheet.ja
    va:283)
    at edu.cmu.sphinx.linguist.flat.FlatLinguist.setupAcousticModel(FlatLing
    uist.java:220)
    at edu.cmu.sphinx.linguist.flat.FlatLinguist.newProperties(FlatLinguist.
    java:184)
    at edu.cmu.sphinx.util.props.PropertySheet.getOwner(PropertySheet.java:4
    21)
    at edu.cmu.sphinx.util.props.PropertySheet.getComponent(PropertySheet.ja
    va:271)
    at edu.cmu.sphinx.decoder.search.SimpleBreadthFirstSearchManager.newProp
    erties(SimpleBreadthFirstSearchManager.java:139)
    at edu.cmu.sphinx.util.props.PropertySheet.getOwner(PropertySheet.java:4
    21)
    at edu.cmu.sphinx.util.props.PropertySheet.getComponent(PropertySheet.ja
    va:271)
    at edu.cmu.sphinx.decoder.AbstractDecoder.newProperties(AbstractDecoder.
    java:52)
    at edu.cmu.sphinx.decoder.Decoder.newProperties(Decoder.java:31)
    at edu.cmu.sphinx.util.props.PropertySheet.getOwner(PropertySheet.java:4
    21)
    at edu.cmu.sphinx.util.props.PropertySheet.getComponent(PropertySheet.ja
    va:271)
    at edu.cmu.sphinx.recognizer.Recognizer.newProperties(Recognizer.java:78
    )
    at edu.cmu.sphinx.util.props.PropertySheet.getOwner(PropertySheet.java:4
    21)
    at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationMa
    nager.java:163)
    at edu.cmu.sphinx.demo.wavfile.WavFile.main(WavFile.java:45)

    This is part of my config.xml file

    <!-- ******************************************************** -->
    <!-- The linguist  configuration                              -->
    <!-- ******************************************************** -->
    
    <component name="flatLinguist"       type="edu.cmu.sphinx.linguist.flat.FlatLinguist">
        <property name="logMath" value="logMath"/>
        <property name="grammar" value="jsgfGrammar"/>
    

    <property name="acousticModel" value="acousticModelWSJ"/>
    <property name="wordInsertionProbability" value="${wordInsertionProbability}"/>
    <property name="silenceInsertionProbability" value="${silenceInsertionProbability}"/>
    <property name="languageWeight" value="${languageWeight}"/>
    <property name="unitManager" value="unitManager"/>
    </component>

    &lt;!-- ******************************************************** --&gt;
    &lt;!-- The Grammar  configuration                               --&gt;
    &lt;!-- ******************************************************** --&gt;
    
    &lt;component name=&quot;jsgfGrammar&quot; type=&quot;edu.cmu.sphinx.jsapi.JSGFGrammar&quot;&gt;
    

    <property name="dictionary" value="dictionaryWSJ"/>
    <property name="grammarLocation"
    value="resource:/edu.cmu.sphinx.demo.wavfile.WavFile!/edu/cmu/sphinx/demo/wavfile/"/>
    <property name="grammarName" value="digits"/>
    <property name="logMath" value="logMath"/>
    </component>

    &lt;!-- ******************************************************** --&gt;
    &lt;!-- The Dictionary configuration                            --&gt;
    &lt;!-- ******************************************************** --&gt;
    

    <component name="dictionaryWSJ"
    type="edu.cmu.sphinx.linguist.dictionary.FullDictionary">
    <property name="dictionaryPath"
    value="resource:/edu.cmu.sphinx.model.acoustic.WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz!/edu/cmu/sphinx/model/acoustic/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/dict/cmudict.0.6d"/>
    <property name="fillerPath"
    value="resource:/edu.cmu.sphinx.model.acoustic.WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.Model!/edu/cmu/sphinx/model/acoustic/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/dict/fillerdict"/>
    <property name="addSilEndingPronunciation" value="false"/>
    <property name="unitManager" value="unitManager"/>
    </component>

    &lt;!-- ******************************************************** --&gt;
    &lt;!-- The acoustic model configuration                         --&gt;
    &lt;!-- ******************************************************** --&gt;
    

    <component name="acousticModelWSJ"
    type="edu.cmu.sphinx.model.acoustic.WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.Model">
    <property name="loader" value="sphinx3LoaderWSJ"/>
    <property name="unitManager" value="unitManager"/>
    </component>

    <component name="sphinx3LoaderWSJ"
    type="edu.cmu.sphinx.model.acoustic.WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.ModelLoader">
    <property name="logMath" value="logMath"/>
    <property name="unitManager" value="unitManager"/>
    </component>

    Please help me to debug this error.

    Thanks,
    Gurucharan

     
    • gurucharan

      gurucharan - 2009-04-11

      The problem was solved. Thanks Nickolay for the information and solution.

      ~ Gurucharan

       
    • Nickolay V. Shmyrev

      > Please help me to debug this error.

      There is nothing to debug here. You just need to understand what is the "classpath" in Java and where classes are searched.

      http://en.wikipedia.org/wiki/Classpath_(Java)

      In particular you forgot to change Manifest.in and was lazy enough to neither search the forum no google for the problem.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.