quintinali commented on issue #17: SDAP-72
URL: 
https://github.com/apache/incubator-sdap-mudrod/pull/17#issuecomment-390074295
 
 
   @lewismc Yes, I still have issues with the try-with-resources. 
   
   If I create ESTransportClient using try-with-resources as follow, an error 
occurs.
   `
   if (hosts != null && port > 1) {  
         try (TransportClient transportClient = new 
ESTransportClient(settings)) {
           for (String host : hosts){
             transportClient.addTransportAddress(new 
InetSocketTransportAddress(InetAddress.getByName(host), port));
           }
           client = transportClient;
         }
       } else if (clusterName != null) {
         node = new Node(settings);
         client = node.client();
       }
   `
   
   2018-05-17 22:17:02,276 ERROR main.MudrodEngine 
(MudrodEngine.java:main(398)) - Error whilst parsing command line.
   java.lang.IllegalStateException: transport client is closed
        at 
org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:240)
        at 
org.elasticsearch.client.transport.TransportProxyClient.execute(TransportProxyClient.java:59)
        at 
org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:356)
        at 
org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:403)
        at 
org.elasticsearch.client.support.AbstractClient$IndicesAdmin.execute(AbstractClient.java:1226)
        at 
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:80)
        at 
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:54)
        at org.apache.sdap.mudrod.driver.ESDriver.putMapping(ESDriver.java:142)
        at 
org.apache.sdap.mudrod.discoveryengine.MudrodAbstract.initMudrod(MudrodAbstract.java:84)
        at 
org.apache.sdap.mudrod.discoveryengine.MudrodAbstract.<init>(MudrodAbstract.java:56)
        at 
org.apache.sdap.mudrod.discoveryengine.DiscoveryEngineAbstract.<init>(DiscoveryEngineAbstract.java:29)
        at 
org.apache.sdap.mudrod.discoveryengine.WeblogDiscoveryEngine.<init>(WeblogDiscoveryEngine.java:50)
        at 
org.apache.sdap.mudrod.main.MudrodEngine.startFullIngest(MudrodEngine.java:242)
        at org.apache.sdap.mudrod.main.MudrodEngine.main(MudrodEngine.java:388)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to