ian
(ian)
December 28, 2011, 7:21am
1
hello
Im new to es and tried to implement it in my project and I got
the error as
TransportClient client = new TransportClient(s);
client.addTransportAddress(new InetSocketTransportAddress(
"localhost",
9300)
);
XContentBuilder docBuilder = XContentFactory.jsonBuilder().startObject();
for(String key:map.keySet())
{
docBuilder.field(key,map.get(key) );
}
docBuilder.endObject();
indexRreqBuild = client.prepareIndex(indexName, indexType).
setConsistencyLevel(WriteConsistencyLevel.DEFAULT).
setSource(docBuilder);
null pointer exception occurs at client.prepareIndex(indexName, indexType).
line
kimchy
(Shay Banon)
December 28, 2011, 10:36am
2
Can you gist the full stack trace?
On Wed, Dec 28, 2011 at 9:21 AM, Simi MA simi.ma@algotree.com wrote:
hello
Im new to es and tried to implement it in my project and I got
the error as
TransportClient client = new TransportClient(s);
client.addTransportAddress(new
InetSocketTransportAddress(
"localhost",
9300)
);
XContentBuilder docBuilder = XContentFactory.jsonBuilder().startObject();
for(String key:map.keySet())
{
docBuilder.field(key,map.get(key) );
}
docBuilder.endObject();
indexRreqBuild = client.prepareIndex(indexName, indexType).
setConsistencyLevel(WriteConsistencyLevel.DEFAULT).
setSource(docBuilder);
null pointer exception occurs at client.prepareIndex(indexName,
indexType). line
ian
(ian)
December 28, 2011, 11:25am
3
The gist is
https://gist.github.com/27c02d804dc64cf197b3
On Wed, Dec 28, 2011 at 5:36 AM, Shay Banon kimchy@gmail.com wrote:
Can you gist the full stack trace?
On Wed, Dec 28, 2011 at 9:21 AM, Simi MA simi.ma@algotree.com wrote:
hello
Im new to es and tried to implement it in my project and I got
the error as
TransportClient client = new TransportClient(s);
client.addTransportAddress(new
InetSocketTransportAddress(
"localhost",
9300)
);
XContentBuilder docBuilder = XContentFactory.jsonBuilder().startObject();
for(String key:map.keySet())
{
docBuilder.field(key,map.get(key) );
}
docBuilder.endObject();
indexRreqBuild = client.prepareIndex(indexName, indexType).
setConsistencyLevel(WriteConsistencyLevel.DEFAULT).
setSource(docBuilder);
null pointer exception occurs at client.prepareIndex(indexName,
indexType). line
ian
(ian)
December 28, 2011, 11:39am
4
Hello
I got where the exception is coming from and solved the problem . Thanx
for your reply
On Wed, Dec 28, 2011 at 6:25 AM, Simi MA simi.ma@algotree.com wrote:
The gist is
https://gist.github.com/27c02d804dc64cf197b3
On Wed, Dec 28, 2011 at 5:36 AM, Shay Banon kimchy@gmail.com wrote:
Can you gist the full stack trace?
On Wed, Dec 28, 2011 at 9:21 AM, Simi MA simi.ma@algotree.com wrote:
hello
Im new to es and tried to implement it in my project and I got
the error as
TransportClient client = new TransportClient(s);
client.addTransportAddress(new
InetSocketTransportAddress(
"localhost",
9300)
);
XContentBuilder docBuilder = XContentFactory.jsonBuilder().startObject();
for(String key:map.keySet())
{
docBuilder.field(key,map.get(key) );
}
docBuilder.endObject();
indexRreqBuild = client.prepareIndex(indexName, indexType).
setConsistencyLevel(WriteConsistencyLevel.DEFAULT).
setSource(docBuilder);
null pointer exception occurs at client.prepareIndex(indexName,
indexType). line