Pregunta

Estoy escribiendo una pequeña aplicación Java y teniendo algunos problemas con log4j que parece ser causada por varias bibliotecas independientes, tratando de utilizar simultáneamente:

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.log4j.Logger.info(Ljava/lang/String;)V
    at twitter4j.internal.logging.Log4JLogger.info(Log4JLogger.java:85)
    at twitter4j.internal.logging.Logger.<clinit>(Logger.java:72)
    at twitter4j.http.BasicAuthorization.<clinit>(BasicAuthorization.java:43)
    at twitter4j.http.AuthorizationFactory.getBasicAuthorizationInstance(AuthorizationFactory.java:66)
    at twitter4j.TwitterStreamFactory.getInstance(TwitterStreamFactory.java:121)
    at org.voltdb.twitter.drivers.Collect.main(Collect.java:13)

Las dos bibliotecas que estoy usando son Twitter4J y VoltDB . Ambos son en forma de frascos. Si uso ya sea de forma aislada, que no se ejecutan en este problema; ambos trabajan muy bien por su cuenta.

Sería aceptable para desactivar el componente log4j de cualquiera de biblioteca si esta fijado el problema.

¿Fue útil?

Solución 2

I came across a reply to a Twitter4J logging problem that shows how to disable logging:

-Dtwitter4j.loggerFactory=twitter4j.internal.logging.StdOutLoggerFactory

Adding this property made the exception disappear.

Otros consejos

Are you sure you're using the right version of log4j as required by both libraries? Your error message seems to indicate in incorrect log4j version IMO.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top