I am trying to create a small transaction app and have created docker container for each service.
All the services are routing like through Gateway service and my gateway service is running on 8000 port.
When I try to run the services locally it is working properly but once I create container it is giving me FeignCLient error.
My authentication service is using FeignCLient to communicate with User service for creating a user.
I'm receiving the following error
2023-02-15 17:02:02 2023-02-15 11:32:02.241 INFO 1 --- [ main] c.m.g.GatewayServiceApplication : Started GatewayServiceApplication in 9.836 seconds (JVM running for 10.409)
2023-02-15 17:02:42 2023-02-15 11:32:42.261 ERROR 1 --- [or-http-epoll-3] a.w.r.e.AbstractErrorWebExceptionHandler : [7e0d203d] 500 Server Error for HTTP POST "/api/v1/auth/signup"
2023-02-15 17:02:42
2023-02-15 17:02:42 io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: localhost/127.0.0.1:3000
2023-02-15 17:02:42 Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
2023-02-15 17:02:42 Error has been observed at the following site(s):
2023-02-15 17:02:42 *__checkpoint ⇢ org.springframework.web.cors.reactive.CorsWebFilter [DefaultWebFilterChain]
2023-02-15 17:02:42 *__checkpoint ⇢ org.springframework.cloud.gateway.filter.WeightCalculatorWebFilter [DefaultWebFilterChain]
2023-02-15 17:02:42 *__checkpoint ⇢ HTTP POST "/api/v1/auth/signup" [ExceptionHandlingWebHandler]
2023-02-15 17:02:42 Original Stack Trace:
2023-02-15 17:02:42 Caused by: java.net.ConnectException: finishConnect(..) failed: Connection refused
2023-02-15 17:02:42 at io.netty.channel.unix.Errors.newConnectException0(Errors.java:155) ~[netty-transport-native-unix-common-4.1.79.Final.jar!/:4.1.79.Final]
2023-02-15 17:02:42 at io.netty.channel.unix.Errors.handleConnectErrno(Errors.java:128) ~[netty-transport-native-unix-common-4.1.79.Final.jar!/:4.1.79.Final]
2023-02-15 17:02:42 at io.netty.channel.unix.Socket.finishConnect(Socket.java:321) ~[netty-transport-native-unix-common-4.1.79.Final.jar!/:4.1.79.Final]
2023-02-15 17:02:42 at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.doFinishConnect(AbstractEpollChannel.java:710) ~[netty-transport-classes-epoll-4.1.79.Final.jar!/:4.1.79.Final]
Related
I am experiencing a weird situation where I am not able to get the spring boot application working in Debug mode. The same application responds correctly when started in normal mode. This behaviour is only observed when I am adding this external library as dependency in my build.gradle file.
I am very sure the issue is because of the addition of this said library and sure how I should resolve this.
My IDE is IntelliJ
What I have tried so far:
Clean and rebuild
IntelliJ invalidate caches and restart
Gradle entry
compile "com.mpatric:mp3agic:0.9.1"
I can see the application starts correctly from the logs and listening on port 8080. When I make the API call there is no entry in the logs.
UPDATE
When I run my application in with debug level logging resolution, I get the following:
2019-04-19 23:25:58.267 DEBUG 8212 --- [nio-8080-exec-2] o.apache.coyote.http11.Http11Processor : Error parsing HTTP request header
java.io.EOFException: null
at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1208) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1142) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:729) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:352) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:294) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-9.0.13.jar:9.0.13]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:791) [tomcat-embed-core-9.0.13.jar:9.0.13]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417) [tomcat-embed-core-9.0.13.jar:9.0.13]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.13.jar:9.0.13]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135) [na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [na:na]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.13.jar:9.0.13]
at java.base/java.lang.Thread.run(Thread.java:844) [na:na]
2019-04-19 23:25:58.267 DEBUG 8212 --- [nio-8080-exec-2] o.apache.coyote.http11.Http11Processor : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper#1f2672ea:org.apache.tomcat.util.net.NioChannel#19ebacea:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8080 remote=/0:0:0:0:0:0:0:1:57538]], Status in: [OPEN_READ], State out: [CLOSED]
2019-04-19 23:25:58.269 DEBUG 8212 --- [nio-8080-exec-2] o.apache.tomcat.util.threads.LimitLatch : Counting down[http-nio-8080-exec-2] latch=2
2019-04-19 23:25:58.269 DEBUG 8212 --- [nio-8080-exec-2] org.apache.tomcat.util.net.NioEndpoint : Socket: [org.apache.tomcat.util.net.NioChannel#19ebacea:java.nio.channels.SocketChannel[closed]] closed
2019-04-19 23:25:58.279 DEBUG 8212 --- [nio-8080-exec-1] org.apache.tomcat.util.http.Parameters : Set query string encoding to UTF-8
2019-04-19 23:25:58.283 DEBUG 8212 --- [nio-8080-exec-1] o.a.c.authenticator.AuthenticatorBase : Security checking request POST /v1/agents
2019-04-19 23:25:58.283 DEBUG 8212 --- [nio-8080-exec-1] org.apache.catalina.realm.RealmBase : No applicable constraints defined
2019-04-19 23:25:58.287 DEBUG 8212 --- [nio-8080-exec-1] o.a.c.a.jaspic.AuthConfigFactoryImpl : Loading persistent provider registrations from [C:\Users\Vino\AppData\Local\Temp\tomcat.11733970093983411817.8080\conf\jaspic-providers.xml]
2019-04-19 23:25:58.287 DEBUG 8212 --- [nio-8080-exec-1] o.a.c.authenticator.AuthenticatorBase : Not subject to any constraint
2019-04-19 23:25:58.303 DEBUG 8212 --- [nio-8080-exec-1] o.a.tomcat.util.net.SocketWrapperBase : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper#2d6dfe49:org.apache.tomcat.util.net.NioChannel#1cc15a:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8080 remote=/0:0:0:0:0:0:0:1:57539]], Read from buffer: [0]
2019-04-19 23:25:58.303 DEBUG 8212 --- [nio-8080-exec-1] org.apache.tomcat.util.net.NioEndpoint : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper#2d6dfe49:org.apache.tomcat.util.net.NioChannel#1cc15a:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8080 remote=/0:0:0:0:0:0:0:1:57539]], Read direct from socket: [0]
2019-04-19 23:25:58.303 DEBUG 8212 --- [nio-8080-exec-1] o.apache.coyote.http11.Http11Processor : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper#2d6dfe49:org.apache.tomcat.util.net.NioChannel#1cc15a:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8080 remote=/0:0:0:0:0:0:0:1:57539]], Status in: [OPEN_READ], State out: [OPEN]
2019-04-19 23:26:10.967 DEBUG 8212 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Pool stats (total=10, active=0, idle=10, waiting=0)
2019-04-19 23:26:40.542 DEBUG 8212 --- [Engine[Tomcat]]] org.apache.catalina.session.ManagerBase : Start expire sessions StandardManager at 1555680400542 sessioncount 0
2019-04-19 23:26:40.542 DEBUG 8212 --- [Engine[Tomcat]]] org.apache.catalina.session.ManagerBase : End expire sessions StandardManager processingTime 0 expired sessions: 0
2019-04-19 23:26:40.969 DEBUG 8212 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Pool stats (total=10, active=0, idle=10, waiting=0)
2019-04-19 23:26:44.541 DEBUG 8212 --- [nnection-reaper] h.i.c.PoolingHttpClientConnectionManager : Closing connections idle longer than 60000 MILLISECONDS
2019-04-19 23:26:44.541 DEBUG 8212 --- [nnection-reaper] h.i.c.PoolingHttpClientConnectionManager : Closing connections idle longer than 60000 MILLISECONDS
2019-04-19 23:26:44.541 DEBUG 8212 --- [nnection-reaper] h.i.c.PoolingHttpClientConnectionManager : Closing connections idle longer than 60000 MILLISECONDS
2019-04-19 23:26:44.541 DEBUG 8212 --- [nnection-reaper] h.i.c.PoolingHttpClientConnectionManager : Closing connections idle longer than 60000 MILLISECONDS
So basically the request is reaching the server. The response is getting created but it's not being sent by the server.
I added apache metamodel into my project.
<dependency>
<groupId>org.apache.metamodel</groupId>
<artifactId>MetaModel-full</artifactId>
<version>5.0.0</version>
</dependency>
mongo-java-driver came as a dependency.
[INFO] | +- org.apache.metamodel:MetaModel-mongodb-mongo3:jar:5.0.0:compile
[INFO] | | +- org.apache.metamodel:MetaModel-mongodb-common:jar:5.0.0:compile
[INFO] | | \- org.mongodb:mongo-java-driver:jar:3.4.3:compile
[INFO] | +- org.apache.metamodel:MetaModel-mongodb-mongo2:jar:5.0.0:compile
Then I see some logs like.
2018-01-16 02:33:09.467 INFO 15417 --- [ restartedMain] org.mongodb.driver.cluster : Cluster created with settings {hosts=[localhost:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
2018-01-16 02:33:09.512 DEBUG 15417 --- [ restartedMain] org.mongodb.driver.cluster : Updating cluster description to {type=UNKNOWN, servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING}]
2018-01-16 02:33:09.521 DEBUG 15417 --- [localhost:27017] org.mongodb.driver.connection : Closing connection connectionId{localValue:1}
2018-01-16 02:33:09.525 INFO 15417 --- [localhost:27017] org.mongodb.driver.cluster : Exception in monitor thread while connecting to server localhost:27017
com.mongodb.MongoSocketOpenException: Exception opening socket
at com.mongodb.connection.SocketStream.open(SocketStream.java:63)
at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:115)
at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:113)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at com.mongodb.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:57)
at com.mongodb.connection.SocketStream.open(SocketStream.java:58)
... 3 common frames omitted
2018-01-16 02:33:09.527 DEBUG 15417 --- [localhost:27017] org.mongodb.driver.cluster : Updating cluster description to {type=UNKNOWN, servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused (Connection refused)}}]
When I dig source code of mongo-java-driver I see mongo-java-driver starts a Thread to monitor default mongodb server. I dont want to exclude mongodb driver but how can I disable com.mongodb.connection.DefaultServerMonitor thread.
After further search I realized that it is spring-boot autoconfiguration issue. My application is a spring-boot app. spring-boot auto config finds a mongos-java-driver jar in classpath and start-up mongo-drive.
Added #EnableAutoConfiguration(exclude = {MongoAutoConfiguration.class}) and mongo-java-driver doesn't start anymore.
I am getting connection is not available error msg with below config xml mapping.Please suggest me what i am doing wrong in beolw code or this is some another issue. As per my investigation this is an intregation issue with HikariCP, Hibernate and Spring Batch.
2.0.3
5.1.6
4.0.0.RELEASE
3.0.0.RELEASE
3.0.0.RELEASE
0.5
2.3.2
4.3.5.Final
Below Configuration
#Bean
public DataSource dataSource() {
final HikariConfig config = new HikariConfig();
config.setMaximumPoolSize(1);
System.out.println("Pool size is "+config.getMaximumPoolSize());
config.setDriverClassName(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_DRIVER));
config.setJdbcUrl(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_URL));
config.setUsername(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_USERNAME));
config.setPassword(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_PASSWORD));
final HikariDataSource dataSource = new HikariDataSource(config);
return dataSource;
}
Error:--
DEBUG com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Timeout failure stats (total=1, active=1, idle=0, waiting=0)
2017-01-03T11:10:30.33+0000 [App/0] OUT PDC::fre-staging/0: 2017-01-03 11:10:30.335 [task-scheduler-6] WARN o.h.e.jdbc.spi.SqlExceptionHelper - SQL Error: 0, SQLState: null
2017-01-03T11:10:30.33+0000 [App/0] OUT PDC::fre-staging/0: 2017-01-03 11:10:30.335 [task-scheduler-6] ERROR o.h.e.jdbc.spi.SqlExceptionHelper - HikariPool-1 - Connection is not available, request timed out after 30000ms.
2017-01-03T11:10:30.34+0000 [App/0] OUT In finally If
2017-01-03T11:10:43.89+0000 [App/0] OUT PDC::fre-staging/0: 2017-01-03 11:10:43.896 [HikariPool-1 housekeeper] DEBUG com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Pool stats (total=1, active=1, idle=0, waiting=1)
2017-01-03T11:11:00.34+0000 [App/0] OUT PDC::fre-staging/0: 2017-01-03 11:11:00.340 [task-scheduler-6] DEBUG com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Timeout failure stats (total=1, active=1, idle=0, waiting=0)
2017-01-03T11:11:00.34+0000 [App/0] OUT PDC::fre-staging/0: 2017-01-03 11:11:00.341 [task-scheduler-6] WARN o.h.e.jdbc.spi.SqlExceptionHelper - SQL Error: 0, SQLState: null
2017-01-03T11:11:00.34+0000 [App/0] OUT PDC::fre-staging/0: 2017-01-03 11:11:00.341 [task-scheduler-6] ERROR o.h.e.jdbc.spi.SqlExceptionHelper - HikariPool-1 - Connection is not available, request timed out after 30000ms.
2017-01-03T11:11:00.35+0000 [App/0] OUT PDC::fre-staging/0: 2017-01-03 11:11:00.354 [task-scheduler-6] ERROR o.s.batch.core.step.AbstractStep - Encountered an error executing step emisTopupStep in job emisTopupJob
2017-01-03T11:11:00.35+0000 [App/0] OUT javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: Could not open connection.
Please help me out.
You are setting the pool max size to 1 with the line
config.setMaximumPoolSize(1);
My guess is that is your problem. Try increasing it, just don't over do it. The defaults is 10 which is good for most cases.
I have a Java application running on Websphere 8.5. I am trying to call a 3rd party webservice using below code but it fails the SSLException as follows.
HttpClient httpClient = new HttpClient();
PostMethod post = new PostMethod(clientURL);
post.addRequestHeader(....blah);
httpClient.executeMethod(post); // The error is thrown at this line `
It fails with the below error:
HttpMethodDir I org.apache.commons.httpclient.HttpMethodDirector executeWithRetry I/O exception (javax.net.ssl.SSLException) caught when processing request: Received fatal alert: decode_error`
Below is the full stacktrace:
[8/21/15 16:33:08:997 EDT] 00000093 HttpMethodDir I
org.apache.commons.httpclient.HttpMethodDirector executeWithRetry I/O
exception (javax.net.ssl.SSLException) caught when processing request:
Received fatal alert: decode_error [8/21/15 16:33:08:997 EDT] 00000093
HttpMethodDir I org.apache.commons.httpclient.HttpMethodDirector
executeWithRetry Retrying request [8/21/15 16:33:09:059 EDT] 00000093
HttpMethodDir I org.apache.commons.httpclient.HttpMethodDirector
executeWithRetry I/O exception (javax.net.ssl.SSLException) caught
when processing request: Received fatal alert: decode_error [8/21/15
16:33:09:059 EDT] 00000093 HttpMethodDir I
org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
Retrying request [8/21/15 16:33:09:122 EDT] 00000093 HttpMethodDir I
org.apache.commons.httpclient.HttpMethodDirector executeWithRetry I/O
exception (javax.net.ssl.SSLException) caught when processing request:
Received fatal alert: decode_error [8/21/15 16:33:09:122 EDT] 00000093
HttpMethodDir I org.apache.commons.httpclient.HttpMethodDirector
executeWithRetry Retrying request [8/21/15 16:33:09:168 EDT] 00000093
SystemOut O In MessageSender....end of sendMessage() [8/21/15
16:33:09:168 EDT] 00000093 servlet E
com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0014E:
Uncaught service() exception root cause /cova.jsp:
com.ibm.websphere.servlet.error.ServletErrorReport:
com.company.exception.ClientCommunicationException: No response
received at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:695)
at com.ibm._jsp._cova._jspService(_cova.java:147) at
com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:99) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:668) at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1225)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:775)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:457)
at
com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at
com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:122)
at
com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:216)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1032)
at
com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3761)
at
com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:975)
at
com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:459)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:526)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:312)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:283)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) at
com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905) at
com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1815)
-Thanks.
I'm guessing here, but here's a few possibilities...
Either A: You should be using http as opposed to https in your post URL (or visa versa)
B : You are using https and the SSL Certificate is not valid
Or C : You are using the correct URL and SSL is valid yet the Authentication your providing to the API is invalid and not being handled very well by the third party API
I am running hbase using java,my hbase started earlier with ease ,now when I am giving "list" command in
hbase(main) :001:0:>>list
It types "TABLE" and give so many lines of java on terminal and ended with
ERROR :org.apache.hadoop.hbase.masternotrunningexception: Retried 7 times
I stopped the hbase and restarted, but it didn't work for me.
This is the trace of logs:
14/02/18 07:16:17 INFO zookeeper.ZooKeeper: Initiating client
connection, connectString=localhost:2181 sessionTimeout=180000
watcher=hconnection
14/02/18 07:16:17 INFO zookeeper.ClientCnxn: Opening socket connection
to server localhost/127.0.0.1:2181. Will not attempt to authenticate
using SASL (unknown error)
14/02/18 07:16:17 INFO zookeeper.RecoverableZooKeeper: The identifier
of this process is 5461#ubuntu
14/02/18 07:16:17 WARN zookeeper.ClientCnxn: Session 0x0 for server
null, unexpected error, closing socket connection and attempting
reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:597)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
14/02/18 07:16:17 WARN zookeeper.RecoverableZooKeeper: Possibly
transient ZooKeeper exception:
org.apache.zookeeper.KeeperException$ConnectionLossException:
KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
14/02/18 07:16:17 INFO util.RetryCounter: Sleeping 2000ms before retry #1...
14/02/18 07:16:18 INFO zookeeper.ClientCnxn: Opening socket connection
to server localhost/127.0.0.1:2181. Will not attempt to authenticate
using SASL (unknown error)
14/02/18 07:16:18 WARN zookeeper.ClientCnxn: Session 0x0 for server
null, unexpected error, closing socket connection and attempting
reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:597)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
14/02/18 07:16:19 INFO zookeeper.ClientCnxn: Opening socket connection
to server localhost/127.0.0.1:2181. Will not attempt to authenticate
using SASL (unknown error)
14/02/18 07:16:19 WARN zookeeper.ClientCnxn: Session 0x0 for server
null, unexpected error, closing socket connection and attempting
reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:597)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
14/02/18 07:16:19 WARN zookeeper.RecoverableZooKeeper: Possibly
transient ZooKeeper exception:
org.apache.zookeeper.KeeperException$ConnectionLossException:
KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
14/02/18 07:16:19 INFO util.RetryCounter: Sleeping 4000ms before retry #2``
my hbase-site.xml:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Apache 2 License ommitted to keep the output short -->
<configuration>
<property>
<name>hbase.rootdir</name>
<value>file:///home/hduser/HBASE/hbase</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/home/hduser/HBASE/zookeeper</value>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2222</value>
<description>Property from ZooKeeper's config zoo.cfg.
The port at which the clients will connect.
</description>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>localhost</value>
</property>
</configuration>
Please make sure that your zookeeper is running fine and you don't have any name resolution related issue. Also, make sure that you have added the hbase.zookeeper.quorum property in your hbase-site.xml. If the problem still persists please show us your hbase-site.xml file.