Nullpointer exception

Help
2008-05-15
2013-04-29
  • java_eidolon
    java_eidolon
    2008-05-15

    Hello, I am getting below errors by just simply run the code:

    Can anyone give a hand?

    Thanks

    Exception in thread "main" java.lang.ExceptionInInitializerError
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at net.didion.jwnl.util.factory.Element.install(Element.java:31)
        at net.didion.jwnl.JWNL.initialize(JWNL.java:169)
        at jia.research.MergeFile.main(MergeFile.java:24)
    Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: java.lang.NullPointerException (Caused by java.lang.NullPointerException) (Caused by org.apache.commons.logging.LogConfigurationException: java.lang.NullPointerException (Caused by java.lang.NullPointerException))
        at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
        at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
        at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
        at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
        at net.didion.jwnl.util.MessageLog.<init>(MessageLog.java:11)
        at net.didion.jwnl.dictionary.Dictionary.<clinit>(Dictionary.java:24)
        ... 5 more
    Caused by: org.apache.commons.logging.LogConfigurationException: java.lang.NullPointerException (Caused by java.lang.NullPointerException)
        at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:397)
        at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
        ... 10 more
    Code snippet:
    try{   
       
            JWNL.initialize(new FileInputStream("D:\\test\\file_properties.xml"));
            Dictionary wordnet = Dictionary.getInstance();
           
            IndexWord word = wordnet.getIndexWord(POS.VERB,"run");
           
            Synset[] senses = word.getSenses();
            for (int i = 0; i < senses.length; i++) {
               System.out.println(word + ": " + senses[i].getGloss());
            }

        }catch (Exception e){//Catch exception if any
              System.err.println("Error: " + e.getMessage());
        }