Embedded ElasticSearch Java

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Embedded ElasticSearch Java

samCougars
All,

I'm trying to use ElasticSearch on the backend to do search within my data.
I'm using elasticsearch-0.18.5 jar in my libraries. I have lucene-cide-3.5.0.jar as well since I was trying lucene before.

But I'm getting an error while creating a code. Here is a sample of my code and the error I get:

      Node node = NodeBuilder.nodeBuilder().node(); // Gives me an exception error after this line
      Client client = node.client();

Exception:
java.lang.NoSuchMethodError: org.apache.log4j.Logger.isTraceEnabled()Z
        at org.elasticsearch.common.logging.log4j.Log4jESLogger.isTraceEnabled(Log4jESLogger.java:57)
        at org.elasticsearch.common.logging.support.AbstractESLogger.trace(AbstractESLogger.java:48)
        at org.elasticsearch.monitor.MonitorModule.configure(MonitorModule.java:86)
        at org.elasticsearch.common.inject.AbstractModule.configure(AbstractModule.java:59)
        at org.elasticsearch.common.inject.spi.Elements$RecordingBinder.install(Elements.java:210)
        at org.elasticsearch.common.inject.spi.Elements.getElements(Elements.java:91)
        at org.elasticsearch.common.inject.InjectorShell$Builder.build(InjectorShell.java:142)
        at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:103)
        at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:93)
        at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:70)
        at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)
        at org.elasticsearch.node.internal.InternalNode.<init>(InternalNode.java:148)
        at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)
        at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)

Any suggestions?
Reply | Threaded
Open this post in threaded view
|

Re: Embedded ElasticSearch Java

Pavel Penchev

You have to match the slf4j and the log4j version loaded in your classloader. Looks like the log4j you are using is too old for the slf4j version that ES brings.

Pavel


On  1.12.2011 19:52, samCougars wrote:
All,

I'm trying to use ElasticSearch on the backend to do search within my data. 
I'm using elasticsearch-0.18.5 jar in my libraries. I have
lucene-cide-3.5.0.jar as well since I was trying lucene before.

But I'm getting an error while creating a code. Here is a sample of my code
and the error I get:

      Node node = NodeBuilder.nodeBuilder().node(); // Gives me an exception
error after this line
      Client client = node.client();

Exception:
java.lang.NoSuchMethodError: org.apache.log4j.Logger.isTraceEnabled()Z
	at
org.elasticsearch.common.logging.log4j.Log4jESLogger.isTraceEnabled(Log4jESLogger.java:57)
	at
org.elasticsearch.common.logging.support.AbstractESLogger.trace(AbstractESLogger.java:48)
	at org.elasticsearch.monitor.MonitorModule.configure(MonitorModule.java:86)
	at
org.elasticsearch.common.inject.AbstractModule.configure(AbstractModule.java:59)
	at
org.elasticsearch.common.inject.spi.Elements$RecordingBinder.install(Elements.java:210)
	at
org.elasticsearch.common.inject.spi.Elements.getElements(Elements.java:91)
	at
org.elasticsearch.common.inject.InjectorShell$Builder.build(InjectorShell.java:142)
	at
org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:103)
	at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:93)
	at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:70)
	at
org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)
	at
org.elasticsearch.node.internal.InternalNode.<init>(InternalNode.java:148)
	at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)
	at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)

Any suggestions?

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Embedded-ElasticSearch-Java-tp3552322p3552322.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Embedded ElasticSearch Java

kimchy
Administrator
ES does not come with slf4j, I think the problem is just an old log4j jar.

On Fri, Dec 2, 2011 at 12:37 PM, Pavel Penchev <[hidden email]> wrote:

You have to match the slf4j and the log4j version loaded in your classloader. Looks like the log4j you are using is too old for the slf4j version that ES brings.

Pavel


On  1.12.2011 19:52, samCougars wrote:
All,

I'm trying to use ElasticSearch on the backend to do search within my data. 
I'm using elasticsearch-0.18.5 jar in my libraries. I have
lucene-cide-3.5.0.jar as well since I was trying lucene before.

But I'm getting an error while creating a code. Here is a sample of my code
and the error I get:

      Node node = NodeBuilder.nodeBuilder().node(); // Gives me an exception
error after this line
      Client client = node.client();

Exception:
java.lang.NoSuchMethodError: org.apache.log4j.Logger.isTraceEnabled()Z
	at
org.elasticsearch.common.logging.log4j.Log4jESLogger.isTraceEnabled(Log4jESLogger.java:57)
	at
org.elasticsearch.common.logging.support.AbstractESLogger.trace(AbstractESLogger.java:48)
	at org.elasticsearch.monitor.MonitorModule.configure(MonitorModule.java:86)
	at
org.elasticsearch.common.inject.AbstractModule.configure(AbstractModule.java:59)
	at
org.elasticsearch.common.inject.spi.Elements$RecordingBinder.install(Elements.java:210)
	at
org.elasticsearch.common.inject.spi.Elements.getElements(Elements.java:91)
	at
org.elasticsearch.common.inject.InjectorShell$Builder.build(InjectorShell.java:142)
	at
org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:103)
	at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:93)
	at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:70)
	at
org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)
	at
org.elasticsearch.node.internal.InternalNode.<init>(InternalNode.java:148)
	at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)
	at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)

Any suggestions?

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Embedded-ElasticSearch-Java-tp3552322p3552322.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.