Domanda

I'm following a tutorial http://www.javacodegeeks.com/2012/03/twitter4j-and-esper-tracking-user.html. But when I'm trying to compile the project it gives me follwoing error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/antlr/runtime/RecognizerSharedState
    at com.espertech.esper.epl.generated.EsperEPL2GrammarLexer.<init>(EsperEPL2GrammarLexer.java:326)
    at com.espertech.esper.epl.parse.ParseHelper.parse(ParseHelper.java:99)
    at com.espertech.esper.core.EPAdministratorImpl.compileEPL(EPAdministratorImpl.java:299)
    at com.espertech.esper.core.EPAdministratorImpl.createEPLStmt(EPAdministratorImpl.java:142)
    at com.espertech.esper.core.EPAdministratorImpl.createEPL(EPAdministratorImpl.java:94)
    at com.twitter.message.TwitterTest.main(TwitterTest.java:39)
Caused by: java.lang.ClassNotFoundException: org.antlr.runtime.RecognizerSharedState
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 6 more

I have added the relevant jars esper-4.9.0.jar, antlr-3.0.1.jar, twitter4j-core-2.2.6.jar. Please help me in resolving errors as I have done lot of google but there is as such no solution found.

È stato utile?

Soluzione

antlr-runtime-3.2.jar is the right jar (remove antlr)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top