Embedded Elasticsearch on shutdown: java.lang.IllegalArgumentException: Illegal shift value, must be 0..63


(Doru Sular) #1

Hello everybody,
I am using elasticsearch embedded in my web application. I start the node
via ContextListener method contextInitialized and I call node.stop() in
contextDestroyed method of my ServletContextListener implementation.

However, the following message appear in the logs:

Apr 07, 2014 5:39:38 PM org.apache.catalina.loader.WebappClassLoader

checkThreadLocalMapForLeaks
java.lang.IllegalArgumentException: Illegal shift value, must be 0..63
at
org.apache.lucene.util.NumericUtils.longToPrefixCoded(NumericUtils.java:114)
at
org.apache.lucene.analysis.NumericTokenStream$NumericTermAttributeImpl.reflectWith(NumericTokenStream.java:199)
at
org.apache.lucene.util.AttributeSource.reflectAsString(AttributeSource.java:430)
at
org.apache.catalina.loader.WebappClassLoader.checkThreadLocalMapForLeaks(WebappClassLoader.java:2521)
at
org.apache.catalina.loader.WebappClassLoader.clearReferences(WebappClassLoader.java:1996)
at
org.apache.catalina.loader.WebappLoader.stopInternal(WebappLoader.java:662)
at
org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5616)
at
org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1575)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.lang.Thread.run(Unknown Source)

I am using elasticsearch version 1.0.1.

Do you have any idea how I can shutdown ES in a friendly way?
Thank you very much

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/2fa44b2d-9da6-4e77-89ac-6e03682240d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Jörg Prante) #2

It seems you are not using a client but a data node?

You can not expect a data node in a web app context with an index works,
because in this case for example, your Tomcat wants to use an index
setting/mapping for an internal leakage check, which is doomed to fail.

Jörg

On Mon, Apr 7, 2014 at 5:47 PM, Doru Sular doru.sular@gmail.com wrote:

Hello everybody,
I am using elasticsearch embedded in my web application. I start the node
via ContextListener method contextInitialized and I call node.stop() in
contextDestroyed method of my ServletContextListener implementation.

However, the following message appear in the logs:

Apr 07, 2014 5:39:38 PM org.apache.catalina.loader.WebappClassLoader

checkThreadLocalMapForLeaks
java.lang.IllegalArgumentException: Illegal shift value, must be 0..63
at
org.apache.lucene.util.NumericUtils.longToPrefixCoded(NumericUtils.java:114)
at
org.apache.lucene.analysis.NumericTokenStream$NumericTermAttributeImpl.reflectWith(NumericTokenStream.java:199)
at
org.apache.lucene.util.AttributeSource.reflectAsString(AttributeSource.java:430)
at
org.apache.catalina.loader.WebappClassLoader.checkThreadLocalMapForLeaks(WebappClassLoader.java:2521)
at
org.apache.catalina.loader.WebappClassLoader.clearReferences(WebappClassLoader.java:1996)
at
org.apache.catalina.loader.WebappLoader.stopInternal(WebappLoader.java:662)
at
org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5616)
at
org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1575)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.lang.Thread.run(Unknown Source)

I am using elasticsearch version 1.0.1.

Do you have any idea how I can shutdown ES in a friendly way?
Thank you very much

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/2fa44b2d-9da6-4e77-89ac-6e03682240d1%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/2fa44b2d-9da6-4e77-89ac-6e03682240d1%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEeFW2YdHKX7ks6fuKYubR2C%3D4c5xpB-5c6NgenkWpr%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(Alex Roytman) #3

I am not sure it can be done with context listeners particularity when shutting down tomcat. I do not believe it will wait for listeners to complete - they are fired asynchronously and tomcat exits without waiting but I am not positive of that. I was going to test it but have not had a chance

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/32e14429-d24a-42c6-9045-9682087c2170%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Jörg Prante) #4

FIY using TransportClient in Wildfly context listeners work like a charm,
when close() method on client is called in contextDestroyed().

Jörg

On Tue, Apr 8, 2014 at 3:40 AM, AlexR roytmana@gmail.com wrote:

I am not sure it can be done with context listeners particularity when
shutting down tomcat. I do not believe it will wait for listeners to
complete - they are fired asynchronously and tomcat exits without waiting
but I am not positive of that. I was going to test it but have not had a
chance

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/32e14429-d24a-42c6-9045-9682087c2170%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHMeYFpMnjZ%3D7q0TL-h3f19DmnBBDao20Lz4A%2BhuWu1bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(Doru Sular) #5

Of course it waits for listeners to complete.

On Tuesday, April 8, 2014 3:40:20 AM UTC+2, AlexR wrote:

I am not sure it can be done with context listeners particularity when
shutting down tomcat. I do not believe it will wait for listeners to
complete - they are fired asynchronously and tomcat exits without waiting
but I am not positive of that. I was going to test it but have not had a
chance

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/e2c2aac2-cd1d-4ac4-9741-60b6f512a0c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Doru Sular) #6

Hi Jörg,
I am using an elasticsearch node embedded in my webapplication. Before my
web app is unloaded from tomcat I am stopping the node. Is there a way to
check that the node was completly stop or even to check if a node was
started programatically ?
Thank you very much.
Doru

On Monday, April 7, 2014 7:26:31 PM UTC+2, Jörg Prante wrote:

It seems you are not using a client but a data node?

You can not expect a data node in a web app context with an index works,
because in this case for example, your Tomcat wants to use an index
setting/mapping for an internal leakage check, which is doomed to fail.

Jörg

On Mon, Apr 7, 2014 at 5:47 PM, Doru Sular <doru....@gmail.com<javascript:>

wrote:

Hello everybody,
I am using elasticsearch embedded in my web application. I start the node
via ContextListener method contextInitialized and I call node.stop() in
contextDestroyed method of my ServletContextListener implementation.

However, the following message appear in the logs:

Apr 07, 2014 5:39:38 PM org.apache.catalina.loader.WebappClassLoader

checkThreadLocalMapForLeaks
java.lang.IllegalArgumentException: Illegal shift value, must be 0..63
at
org.apache.lucene.util.NumericUtils.longToPrefixCoded(NumericUtils.java:114)
at
org.apache.lucene.analysis.NumericTokenStream$NumericTermAttributeImpl.reflectWith(NumericTokenStream.java:199)
at
org.apache.lucene.util.AttributeSource.reflectAsString(AttributeSource.java:430)
at
org.apache.catalina.loader.WebappClassLoader.checkThreadLocalMapForLeaks(WebappClassLoader.java:2521)
at
org.apache.catalina.loader.WebappClassLoader.clearReferences(WebappClassLoader.java:1996)
at
org.apache.catalina.loader.WebappLoader.stopInternal(WebappLoader.java:662)
at
org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5616)
at
org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1575)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.lang.Thread.run(Unknown Source)

I am using elasticsearch version 1.0.1.

Do you have any idea how I can shutdown ES in a friendly way?
Thank you very much

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/2fa44b2d-9da6-4e77-89ac-6e03682240d1%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/2fa44b2d-9da6-4e77-89ac-6e03682240d1%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/25d13fe0-116e-4481-9a52-28b159af6a27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #7