This is drving me crazy! No, I am not using Maven, just a plain simple java
sample project/eclipse. It works fine with Node builder and getting client
from node, but if i use transport client instead, it gives the above
mentioned exception. As far as I know I have included all the possible
dependencies. and here are the imports:
import static org.elasticsearch.node.NodeBuilder.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import org.elasticsearch.action.delete.DeleteResponse;
import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.search.SearchType;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.transport.TransportClient;
import static org.elasticsearch.index.query.QueryBuilders.fieldQuery;
import org.elasticsearch.index.query.*;
import org.elasticsearch.index.query.CommonTermsQueryBuilder.Operator;
import org.elasticsearch.index.query.MatchQueryBuilder.Type;
import org.elasticsearch.rest.RestStatus;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchHits;
import org.elasticsearch.node.Node;
import org.elasticsearch.node.NodeBuilder;
import org.elasticsearch.cluster.metadata.AliasMetaData;
import
org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequestBuilder;
importorg.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesResponse;
//import static org.elasticsearch.node.NodeBuilder.nodeBuilder;
import org.hamcrest.EasyMock2Matchers;
import
org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.search.SearchPhaseExecutionException;
import org.elasticsearch.action.search.ShardSearchFailure;
import org.elasticsearch.common.settings.ImmutableSettings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.search.facet.FacetBuilders;
import org.elasticsearch.action.bulk.*;
import java.io.IOException;
import java.net.InetAddress;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Random;
import java.util.concurrent.ExecutionException;
import static org.elasticsearch.cluster.metadata.IndexMetaData.
SETTING_NUMBER_OF_REPLICAS;
import static org.elasticsearch.cluster.metadata.IndexMetaData.
SETTING_NUMBER_OF_SHARDS;
import static
org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder;
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
import static org.elasticsearch.index.query.FilterBuilders.*;
import static org.elasticsearch.index.query.QueryBuilders.*;
import static
org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders.scriptFunction
;
import org.json.simple.JSONObject;
import org.json.simple.JSONArray;
import org.json.simple.parser.ParseException;
import org.json.simple.parser.JSONParser;
On Wednesday, January 22, 2014 2:59:00 PM UTC-5, David Pilato wrote:
You don't use Maven for your project?
If not, don't forget to add all needed dependencies.
--
David
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
Le 22 janv. 2014 à 20:23, ZenMaster80 <sabda...@gmail.com <javascript:>>
a écrit :
Brian,
This is no different from what I have. I googled the problem, and I guess
this may come from the fact that ES js using a different java version. I
have added the es 0.90.0.jar to java from the es installation folder. I
have no clue what I am missing.
On Wednesday, January 22, 2014 2:02:57 PM UTC-5, InquiringMind wrote:
ImmutableSettings.Builder settingsBuilder =
ImmutableSettings.settingsBuilder();
settingsBuilder.put("cluster.name", clusterName);
TransportClient client = new TransportClient(settingsBuilder.build());
for (String host : hostNames)
{
InetSocketTransportAddress server_address = new
InetSocketTransportAddress(
host, portTransport);
client.addTransportAddress(server_address);
}
Brian
--
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/ebaf9d9d-808a-4fc3-a94f-4f7c5564c1dd%40googlegroups.com
.
For more options, visit https://groups.google.com/groups/opt_out.
--
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/a8df498b-49a6-424c-9754-6a587b77cf13%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.