# Getting NULL\_POINTER\_EXCEPTION with URI Search

**URL:** <https://discuss.elastic.co/t/getting-null-pointer-exception-with-uri-search/71993>\
**Category:** Elasticsearch\
**Created:** [January 18, 2017, 11:54am UTC](https://discuss.elastic.co/t/getting-null-pointer-exception-with-uri-search/71993 "2017-01-18T11:54:57Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ori.rubinfeld](https://avatars.discourse-cdn.com/v4/letter/o/7c8e57/32.png) [@ori.rubinfeld](https://discuss.elastic.co/u/ori.rubinfeld)\
**Post date:** [January 18, 2017, 11:54am UTC](https://discuss.elastic.co/t/getting-null-pointer-exception-with-uri-search/71993/1 "2017-01-18T11:54:57Z")

</div>

Hi,

We have Elasticsearch release 2.4.1

While running a URI Search, the results are:

curl -u uname:password -XGET 'localhost:9200/myindex/mytype/\_search?q=myfield:123456&pretty'

{  
"error" : {  
"root\_cause" : [ {  
"type" : "null\_pointer\_exception",  
"reason" : null  
} ],  
"type" : "null\_pointer\_exception",  
"reason" : null  
},  
"status" : 500  
}

Need help to understand the reason.  
All fields are not in \_all, and not analyzed.

Thanks,

Ori

---

<div class="post-metadata">

**Author:** ![mainec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mainec/32/5557_2.png) [@mainec](https://discuss.elastic.co/u/mainec)\
**Post date:** [January 18, 2017, 12:07pm UTC](https://discuss.elastic.co/t/getting-null-pointer-exception-with-uri-search/71993/2 "2017-01-18T12:07:01Z")

</div>

Can you check if there's more information in your logs?

Isabel

---

<div class="post-metadata">

**Author:** ![ori.rubinfeld](https://avatars.discourse-cdn.com/v4/letter/o/7c8e57/32.png) [@ori.rubinfeld](https://discuss.elastic.co/u/ori.rubinfeld)\
**Post date:** [January 18, 2017, 12:22pm UTC](https://discuss.elastic.co/t/getting-null-pointer-exception-with-uri-search/71993/3 "2017-01-18T12:22:47Z")

</div>

[2017-01-18 13:34:59,030][WARN][rest.suppressed] path: /myindex/mytype/\_search, params: {q=myfield:123456, index=myindex, type=mytype}  
java.lang.NullPointerException  
at org.elasticsearch.common.compress.lzf.LZFCompressor.isCompressed(LZFCompressor.java:54)  
at org.elasticsearch.common.compress.CompressorFactory.compressor(CompressorFactory.java:74)  
at org.elasticsearch.common.xcontent.XContentHelper.convertToMap(XContentHelper.java:67)  
at org.elasticsearch.search.lookup.SourceLookup.sourceAsMapAndType(SourceLookup.java:88)  
at org.elasticsearch.search.lookup.SourceLookup.sourceAsMap(SourceLookup.java:92)  
at com.graphaware.es.gas.wrap.GraphAidedSearchActionListenerWrapper.wrap(GraphAidedSearchActionListenerWrapper.java:100)  
at com.graphaware.es.gas.GraphAidedSearchFilter.apply(GraphAidedSearchFilter.java:66)  
at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:170)  
at org.elasticsearch.action.support.ActionFilter$Simple.apply(ActionFilter.java:65)  
at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:170)  
at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:144)  
at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:85)  
at org.elasticsearch.client.node.NodeClient.doExecute(NodeClient.java:58)  
at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:359)  
at org.elasticsearch.client.FilterClient.doExecute(FilterClient.java:52)  
at org.elasticsearch.rest.BaseRestHandler$HeadersAndContextCopyClient.doExecute(BaseRestHandler.java:88)  
at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:359)  
at org.elasticsearch.client.support.AbstractClient.search(AbstractClient.java:582)  
at org.elasticsearch.rest.action.search.RestSearchAction.handleRequest(RestSearchAction.java:85)  
at org.elasticsearch.rest.BaseRestHandler.handleRequest(BaseRestHandler.java:54)  
at org.elasticsearch.rest.RestController.executeHandler(RestController.java:198)  
at org.elasticsearch.rest.RestController$RestHandlerFilter.process(RestController.java:280)  
at org.elasticsearch.rest.RestController$ControllerFilterChain.continueProcessing(RestController.java:261)  
at org.elasticsearch.plugin.readonlyrest.ReadonlyRestAction$1.process(ReadonlyRestAction.java:39)  
at org.elasticsearch.rest.RestController$ControllerFilterChain.continueProcessing(RestController.java:264)  
at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:161)  
at org.elasticsearch.http.HttpServer.internalDispatchRequest(HttpServer.java:153)  
at org.elasticsearch.http.HttpServer$Dispatcher.dispatchRequest(HttpServer.java:101)  
at org.elasticsearch.http.netty.NettyHttpServerTransport.dispatchRequest(NettyHttpServerTransport.java:451)  
at org.elasticsearch.http.netty.HttpRequestHandler.messageReceived(HttpRequestHandler.java:61)  
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)  
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)  
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)  
at org.elasticsearch.http.netty.pipelining.HttpPipeliningHandler.messageReceived(HttpPipeliningHandler.java:60)  
at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:88)  
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)  
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)  
at org.jboss.netty.handler.codec.http.HttpChunkAggregator.messageReceived(HttpChunkAggregator.java:145)  
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)  
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)

```
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
    at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
    at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
    at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
    at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
    at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
```

---

<div class="post-metadata">

**Author:** ![ori.rubinfeld](https://avatars.discourse-cdn.com/v4/letter/o/7c8e57/32.png) [@ori.rubinfeld](https://discuss.elastic.co/u/ori.rubinfeld)\
**Post date:** [January 18, 2017, 12:23pm UTC](https://discuss.elastic.co/t/getting-null-pointer-exception-with-uri-search/71993/4 "2017-01-18T12:23:00Z")

</div>

Had to cut it in the middle.....

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [January 18, 2017, 12:55pm UTC](https://discuss.elastic.co/t/getting-null-pointer-exception-with-uri-search/71993/5 "2017-01-18T12:55:04Z")

</div>

You need jackson-dataformat-smile on your classpath. Does it exist?

---

<div class="post-metadata">

**Author:** ![ori.rubinfeld](https://avatars.discourse-cdn.com/v4/letter/o/7c8e57/32.png) [@ori.rubinfeld](https://discuss.elastic.co/u/ori.rubinfeld)\
**Post date:** [January 18, 2017, 12:55pm UTC](https://discuss.elastic.co/t/getting-null-pointer-exception-with-uri-search/71993/6 "2017-01-18T12:55:55Z")

</div>

What is it ?

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [January 18, 2017, 1:07pm UTC](https://discuss.elastic.co/t/getting-null-pointer-exception-with-uri-search/71993/7 "2017-01-18T13:07:47Z")

</div>

[http://search.maven.org/#search|ga|1|a%3A"jackson-dataformat-smile"](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22jackson-dataformat-smile%22)

---

<div class="post-metadata">

**Author:** ![ori.rubinfeld](https://avatars.discourse-cdn.com/v4/letter/o/7c8e57/32.png) [@ori.rubinfeld](https://discuss.elastic.co/u/ori.rubinfeld)\
**Post date:** [January 18, 2017, 1:14pm UTC](https://discuss.elastic.co/t/getting-null-pointer-exception-with-uri-search/71993/8 "2017-01-18T13:14:52Z")

</div>

Which version should I need for Elastic 2.4.1 ?  
How Do I install it ?

Ori

---

<div class="post-metadata">

**Author:** ![mainec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mainec/32/5557_2.png) [@mainec](https://discuss.elastic.co/u/mainec)\
**Post date:** [January 18, 2017, 1:19pm UTC](https://discuss.elastic.co/t/getting-null-pointer-exception-with-uri-search/71993/9 "2017-01-18T13:19:21Z")

</div>

> [@ori.rubinfeld](#):
>
> Elasticsearch release 2.4.1

How did you install that?

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [January 18, 2017, 1:23pm UTC](https://discuss.elastic.co/t/getting-null-pointer-exception-with-uri-search/71993/10 "2017-01-18T13:23:38Z")

</div>

My question was, is it on the class path?

It's distributed by default in ES 2.4.1 tar.gz but maybe somebody removed it?

---

<div class="post-metadata">

**Author:** ![ori.rubinfeld](https://avatars.discourse-cdn.com/v4/letter/o/7c8e57/32.png) [@ori.rubinfeld](https://discuss.elastic.co/u/ori.rubinfeld)\
**Post date:** [January 18, 2017, 1:27pm UTC](https://discuss.elastic.co/t/getting-null-pointer-exception-with-uri-search/71993/11 "2017-01-18T13:27:05Z")

</div>

Found it under the LIB subfolder.

How can I check the classpath ?  
Where am I suppose to add it ?

Ori

---

<div class="post-metadata">

**Author:** ![ori.rubinfeld](https://avatars.discourse-cdn.com/v4/letter/o/7c8e57/32.png) [@ori.rubinfeld](https://discuss.elastic.co/u/ori.rubinfeld)\
**Post date:** [January 18, 2017, 2:08pm UTC](https://discuss.elastic.co/t/getting-null-pointer-exception-with-uri-search/71993/12 "2017-01-18T14:08:59Z")

</div>

Can it be related to: http.cors.allow-origin ?

Ori

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [January 18, 2017, 2:12pm UTC](https://discuss.elastic.co/t/getting-null-pointer-exception-with-uri-search/71993/13 "2017-01-18T14:12:05Z")

</div>

If it's in the lib subfolder, it's on the class path. Then it's another issue.

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [January 18, 2017, 2:15pm UTC](https://discuss.elastic.co/t/getting-null-pointer-exception-with-uri-search/71993/14 "2017-01-18T14:15:00Z")

</div>

It's probably because `_source` is disabled, there is a `NullPointerException` issue related to this [https://github.com/elastic/elasticsearch/issues/17666](https://github.com/elastic/elasticsearch/issues/17666)

---

<div class="post-metadata">

**Author:** ![ori.rubinfeld](https://avatars.discourse-cdn.com/v4/letter/o/7c8e57/32.png) [@ori.rubinfeld](https://discuss.elastic.co/u/ori.rubinfeld)\
**Post date:** [January 18, 2017, 2:34pm UTC](https://discuss.elastic.co/t/getting-null-pointer-exception-with-uri-search/71993/15 "2017-01-18T14:34:21Z")

</div>

the \_source is not disabled.  
the \_all is disabled.

I did not included fields in the \_all

How can I know what is the classpath being used ?

Ori

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [January 18, 2017, 2:39pm UTC](https://discuss.elastic.co/t/getting-null-pointer-exception-with-uri-search/71993/16 "2017-01-18T14:39:26Z")

</div>

Forget about the classpath, every jar in lib is included.

The strange thing is, that Elasticsearch throws the NPE you reported when it tries to open a field in the `_source`. Because it is null, it must be disabled or otherwise be corrupted.

---

<div class="post-metadata">

**Author:** ![ori.rubinfeld](https://avatars.discourse-cdn.com/v4/letter/o/7c8e57/32.png) [@ori.rubinfeld](https://discuss.elastic.co/u/ori.rubinfeld)\
**Post date:** [January 18, 2017, 3:01pm UTC](https://discuss.elastic.co/t/getting-null-pointer-exception-with-uri-search/71993/17 "2017-01-18T15:01:37Z")

</div>

I tested it with other indexes and the results are the same.  
NULL\_POINTER\_EXCEPTION, no matter which index I access.

I tried both analyzed and non analyzed fields.

Ori

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [January 18, 2017, 3:17pm UTC](https://discuss.elastic.co/t/getting-null-pointer-exception-with-uri-search/71993/18 "2017-01-18T15:17:32Z")

</div>

The query and index access works flawlessly.

It's the document source that is accessed by your plugin `com.graphaware.es.gas.GraphAidedSearchFilter` that fails to work.

---

<div class="post-metadata">

**Author:** ![ori.rubinfeld](https://avatars.discourse-cdn.com/v4/letter/o/7c8e57/32.png) [@ori.rubinfeld](https://discuss.elastic.co/u/ori.rubinfeld)\
**Post date:** [January 18, 2017, 3:34pm UTC](https://discuss.elastic.co/t/getting-null-pointer-exception-with-uri-search/71993/19 "2017-01-18T15:34:13Z")

</div>

I checked with an environment on which the plugin is not installed.  
The Versions of ES are the same.  
The Search working fine.

We will have to consider if to remove it.

Thanks!!!!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 15, 2017, 3:34pm UTC](https://discuss.elastic.co/t/getting-null-pointer-exception-with-uri-search/71993/20 "2017-02-15T15:34:19Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
