Name or service not known exception on starting Neo4j - java

I remove completely and install Neo4j graph database again.After that I get Exception when I tried to start Neo4j service on debian server in the following segment:
Failed to get local hostname java.net.UnknownHostException: brain.kaankilic: brain.kaankilic: Name or service not known
at java.net.UnknownHostException: brain.kaankilic: brain.kaankilic: Name or service not known
at at java.net.InetAddress.getLocalHost(InetAddress.java:1473)
at at ch.qos.logback.core.util.ContextUtil.getLocalHostName(ContextUtil.java:32)
at at ch.qos.logback.core.util.ContextUtil.addHostNameAsProperty(ContextUtil.java:41)
at at ch.qos.logback.classic.joran.action.ConfigurationAction.begin(ConfigurationAction.java:56)
at at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:276)
at at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:148)
at at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:130)
at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:157)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:143)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:106)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:56)
at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148)
at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:279)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:252)
at at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156)
at at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
at at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685)
at at org.apache.commons.configuration.AbstractFileConfiguration.<init>(AbstractFileConfiguration.java:121)
at at org.apache.commons.configuration.AbstractFileConfiguration.<init>(AbstractFileConfiguration.java:154)
at at org.apache.commons.configuration.PropertiesConfiguration.<init>(PropertiesConfiguration.java:252)
at at org.neo4j.server.configuration.PropertyFileConfigurator.loadPropertiesConfig(PropertyFileConfigurator.java:132)
at at org.neo4j.server.configuration.PropertyFileConfigurator.<init>(PropertyFileConfigurator.java:67)
at at org.neo4j.server.Bootstrapper.createConfigurator(Bootstrapper.java:215)
at at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:93)
at at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:57)
Caused by: java.net.UnknownHostException: brain.kaankilic: Name or service not known
at at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)
at at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1293)
at at java.net.InetAddress.getLocalHost(InetAddress.java:1469)
How can I fix that problem?
Thanks for interest

Try to replace localhost in your neo4j.properties and neo4j-server.properties with 127.0.0.1.
Alternatively you might change your settings in /etc/hosts.

Related

Jhipster Registry 4.0.0 exception pre-packaged WAR

When I run Gateway I get this error on Registry service.
2018-07-31 11:23:33.472 ERROR 1617 --- [get_localhost-3] c.n.e.cluster.ReplicationTaskProcessor : It seems to be
a socket read timeout exception, it will retry later. if it continues to happen and some eureka node occupied all the cpu time, you should set property 'eureka.server.peer-node-read-timeout-ms' to a bigger value
com.sun.jersey.api.client.ClientHandlerException: java.net.SocketTimeoutException: Read timed out
at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:187)
at com.netflix.eureka.cluster.DynamicGZIPContentEncodingFilter.handle(DynamicGZIPContentEncodingFilter.java:48)
at com.netflix.discovery.EurekaIdentityHeaderFilter.handle(EurekaIdentityHeaderFilter.java:27)
at com.sun.jersey.api.client.Client.handle(Client.java:652)
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:682)
at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:570)
at com.netflix.eureka.transport.JerseyReplicationClient.submitBatchUpdates(JerseyReplicationClient.java:116
)
at com.netflix.eureka.cluster.ReplicationTaskProcessor.process(ReplicationTaskProcessor.java:80)
at com.netflix.eureka.util.batcher.TaskExecutors$BatchWorkerRunnable.run(TaskExecutors.java:187)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:161)
at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:82)
at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:278)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)
at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.jav
a:286)
at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:257
)
at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java
:230)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:684)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:486)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:118)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:173)
... 10 common frames omitted
I use pre-packaged war file downloaded from Releases page.
Version 4.0.0
Interesting part is when I run microservice I don't get this error. It happens only with gateway.
Also when creating new gateway and run it exception also not appear. It happens after 1 day and after a day if you got this exception you get this every time...
I got the same error using the default configuration. The solution lies on the error message itself which is to increase the peer-node-read-timeout-ms value (default value is 200).
Go to your application.yml
server:
# see discussion about enable-self-preservation:
# https://github.com/jhipster/generator-jhipster/issues/3654
enable-self-preservation: false
peer-node-read-timeout-ms: 5000

Hbase client API not connecting to Hbase throwing SocketTimeoutException

I'm trying to connect to Hbase using Hbase client API in a kerborized Cloudera cluster.
Sample code:
Configuration hbaseConf = HBaseConfiguration.create();
/*hbaseConf.set("hbase.master", "somenode.net:2181");
hbaseConf.set("hbase.client.scanner.timeout.period", "1200000");
hbaseConf.set("hbase.zookeeper.quorum",
"somenode.net,somenode2.net");
hbaseConf.set("zookeeper.znode.parent", "/hbase");*/
hbaseConf.setInt("timeout", 120000);
hbaseConf.set(TableInputFormat.INPUT_TABLE, tableName);
//hbaseConf.addResource("src/main/resources/hbase-site.xml");
UserGroupInformation.setConfiguration(hbaseConf);
UserGroupInformation.loginUserFromKeytab("principal", "keytab");
JavaPairRDD<ImmutableBytesWritable, Result> javaPairRdd = ctx
.newAPIHadoopRDD(hbaseConf, TableInputFormat.class,
ImmutableBytesWritable.class, Result.class);
I tried to set the hbase-site.xml in the maven project resources, also passed as jar file in spark-submit command using --jars, but nothing works.
Error log:
Caused by: java.net.SocketTimeoutException: callTimeout=60000, callDuration=68545: row '¨namespace:test,,00000000000000' on table 'hbase:meta' at region=hbase:meta,,1.1588230740, hostname=hostname.net,60020,1511970022474, seqNum=0
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:159)
at org.apache.hadoop.hbase.client.ResultBoundedCompletionService$QueueingFuture.run(ResultBoundedCompletionService.java:65)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
at sun.nio.ch.IOUtil.write(IOUtil.java:65)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:487)
at org.apache.hadoop.net.SocketOutputStream$Writer.performIO(SocketOutputStream.java:63)
at org.apache.hadoop.net.SocketIOWithTimeout.doIO(SocketIOWithTimeout.java:142)
at org.apache.hadoop.net.SocketOutputStream.write(SocketOutputStream.java:159)
at org.apache.hadoop.net.SocketOutputStream.write(SocketOutputStream.java:117)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at java.io.DataOutputStream.flush(DataOutputStream.java:123)
at org.apache.hadoop.hbase.ipc.IPCUtil.write(IPCUtil.java:278)
at org.apache.hadoop.hbase.ipc.IPCUtil.write(IPCUtil.java:266)
at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.writeRequest(RpcClientImpl.java:920)
at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.tracedWriteRequest(RpcClientImpl.java:873)
at org.apache.hadoop.hbase.ipc.RpcClientImpl.call(RpcClientImpl.java:1242)
at org.apache.hadoop.hbase.ipc.AbstractRpcClient.callBlockingMethod(AbstractRpcClient.java:227)
at org.apache.hadoop.hbase.ipc.AbstractRpcClient$BlockingRpcChannelImplementation.callBlockingMethod(AbstractRpcClient.java:336)
at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$BlockingStub.scan(ClientProtos.java:34094)
at org.apache.hadoop.hbase.client.ScannerCallable.openScanner(ScannerCallable.java:394)
at org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:203)
at org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:64)
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:200)
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas$RetryingRPC.call(ScannerCallableWithReplicas.java:360)
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas$RetryingRPC.call(ScannerCallableWithReplicas.java:334)
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:126)
... 4 more
18/02/26 16:25:42 INFO spark.SparkContext: Invoking stop() from shutdown hook
The problem you are facing is because your environment is not properly set up.
I have answer it to my own question here

Getting java.net.SocketTimeoutException: connect timed out error

I am trying to connect to a webservice from my application and I am getting following exception :
org.apache.axis2.AxisFault: The host did not accept the connection within timeout of 30000 ms
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:197)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:404)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:231)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:406)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
Caused by: org.apache.commons.httpclient.ConnectTimeoutException: The host did not accept the connection within timeout of 30000 ms
at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:155)
at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:130)
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:621)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:193)
... 27 more
Caused by: java.net.SocketTimeoutException: connect timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:367)
at java.net.Socket.connect(Socket.java:524)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:545)
at sun.reflect.GeneratedMethodAccessor197.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:140)
... 35 more
I am not overwriting timeout interval in my application.
Can anyone please tell me through which property this timeout is configured ?and in which place its configured ? I thought its configured in axis2.xml But i might be wrong
I am not realy sure what you promise of it, but the default timeout of 30 seconds is set in the sourcecode of axis2.
To be precisely in org.apache.axis2.client.Options on line 118 (axis2 version 1.7.4):
public static final int DEFAULT_TIMEOUT_MILLISECONDS = 30 * 1000;
This default value will be used if the timout is not set manually and has its default value of -1 (line 504 eg).
return timeOutInMilliSeconds == -1 ? DEFAULT_TIMEOUT_MILLISECONDS
: timeOutInMilliSeconds;
If you want to overwrite the timeout I will refer you to the axis documentation

Can't connect to to HBase via phoenix with jdbc. Error NONODE, code 101

I try to connect to phoenix via jdbc with code
Connection r = DriverManager.getConnection("jdbc:phoenix:serverName:8765/hbase");
Execution error
java.sql.SQLException: java.lang.RuntimeException: java.lang.NullPointerException
at org.apache.phoenix.query.ConnectionQueryServicesImpl$13.call(ConnectionQueryServicesImpl.java:2432)
at org.apache.phoenix.query.ConnectionQueryServicesImpl$13.call(ConnectionQueryServicesImpl.java:2352)
at org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:76)
at org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:2352)
at org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:232)
at org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.createConnection(PhoenixEmbeddedDriver.java:147)
at org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:202)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:270)
at myfunction
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:208)
at org.apache.hadoop.hbase.client.ClientScanner.call(ClientScanner.java:320)
at org.apache.hadoop.hbase.client.ClientScanner.nextScanner(ClientScanner.java:295)
at org.apache.hadoop.hbase.client.ClientScanner.initializeScannerInConstruction(ClientScanner.java:160)
at org.apache.hadoop.hbase.client.ClientScanner.<init>(ClientScanner.java:155)
at org.apache.hadoop.hbase.client.HTable.getScanner(HTable.java:821)
at org.apache.hadoop.hbase.MetaTableAccessor.fullScan(MetaTableAccessor.java:602)
at org.apache.hadoop.hbase.MetaTableAccessor.tableExists(MetaTableAccessor.java:366)
at org.apache.hadoop.hbase.client.HBaseAdmin.tableExists(HBaseAdmin.java:392)
at org.apache.phoenix.query.ConnectionQueryServicesImpl$13.call(ConnectionQueryServicesImpl.java:2378)
... 36 more
Caused by: java.lang.NullPointerException
at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.getMetaReplicaNodes(ZooKeeperWatcher.java:395)
at org.apache.hadoop.hbase.zookeeper.MetaTableLocator.blockUntilAvailable(MetaTableLocator.java:553)
at org.apache.hadoop.hbase.client.ZooKeeperRegistry.getMetaRegionLocation(ZooKeeperRegistry.java:61)
at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.locateMeta(ConnectionManager.java:1186)
at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.locateRegion(ConnectionManager.java:1153)
at org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.getRegionLocations(RpcRetryingCallerWithReadReplicas.java:300)
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:155)
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:59)
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:200)
... 45 more
Inside ZooKeeper I found another ignored exception:
org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode
This exception produced by response error 101
org.apache.zookeeper.KeeperException.create(KeeperException.java:111)
org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:1472)
org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.getChildren(RecoverableZooKeeper.java:295)
org.apache.hadoop.hbase.zookeeper.ZKUtil.listChildrenNoWatch(ZKUtil.java:635)
org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.getMetaReplicaNodes(ZooKeeperWatcher.java:392)
org.apache.hadoop.hbase.zookeeper.MetaTableLocator.blockUntilAvailable(MetaTableLocator.java:553)
org.apache.hadoop.hbase.client.ZooKeeperRegistry.getMetaRegionLocation(ZooKeeperRegistry.java:61)
org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.locateMeta(ConnectionManager.java:1186)
org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.locateRegion(ConnectionManager.java:1153)
org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.getRegionLocations(RpcRetryingCallerWithReadReplicas.java:300)
org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:155)
org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:59)
org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:200)
org.apache.hadoop.hbase.client.ClientScanner.call(ClientScanner.java:320)
org.apache.hadoop.hbase.client.ClientScanner.nextScanner(ClientScanner.java:295)
org.apache.hadoop.hbase.client.ClientScanner.initializeScannerInConstruction(ClientScanner.java:160)
org.apache.hadoop.hbase.client.ClientScanner.<init>(ClientScanner.java:155)
org.apache.hadoop.hbase.client.HTable.getScanner(HTable.java:821)
org.apache.hadoop.hbase.MetaTableAccessor.fullScan(MetaTableAccessor.java:602)
org.apache.hadoop.hbase.MetaTableAccessor.tableExists(MetaTableAccessor.java:366)
org.apache.hadoop.hbase.client.HBaseAdmin.tableExists(HBaseAdmin.java:392)
org.apache.phoenix.query.ConnectionQueryServicesImpl$13.call(ConnectionQueryServicesImpl.java:2378)
org.apache.phoenix.query.ConnectionQueryServicesImpl$13.call(ConnectionQueryServicesImpl.java:2352)
org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:76)
org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:2352)
org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:232)
org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.createConnection(PhoenixEmbeddedDriver.java:147)
org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:202)
java.sql.DriverManager.getConnection(DriverManager.java:664)
java.sql.DriverManager.getConnection(DriverManager.java:270)
Driver version 4.9.0-HBase-1.1
Version from Hbase shell 1.1.2.2.5.0.0-1245
PS: I'm able to connect to Hbase directly with HBase client API
There are mistake in connection string.
It should be jdbc:phoneix[:zk_quorum][:zk_port][:zk_hbase_path]
In my case jdbc:phoenix:zookeperServerName:2181:/hbase-unsecure

Sending Email Exception in Play! 2

I am trying to send an email in the Play! Framework v 2.1.1.
In build.scala I have:
"com.typesafe" %% "play-plugins-mailer" % "2.1.0"
In conf/application.conf I have:
smtp.host=smtp.gmail.com
smtp.port= "587"
smtp.ssl=true
smtp.tls=true
smtp.user="dylanrboudro#gmail.com"
smtp.password="xxxxxx"
I have also tried smtp.port = "465"
The method to send the email is:
public void Email() {
MailerAPI mail = play.Play.application().plugin(MailerPlugin.class).email();
mail.setSubject("test");
mail.addRecipient("dylanrboudro#gmail.com");
mail.addFrom("DevOpsNotifications#gmail.com");
String body = "this is the first email sent by the devops requestor";
mail.sendHtml(body);
I am getting this error:
[RuntimeException: org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.gmail.com:587]
And this stack trace:
! #6f9o6gmj8 - Internal server error, for (POST) [/request] ->
play.api.Application$$anon$1: Execution exception[[RuntimeException: org.apache.
commons.mail.EmailException: Sending the email to the following server failed :
smtp.gmail.com:587]]
at play.api.Application$class.handleError(Application.scala:289) ~[play_
2.10.jar:2.1.1]
at play.api.DefaultApplication.handleError(Application.scala:383) [play_
2.10.jar:2.1.1]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anon$2$$anonfun$ha
ndle$1.apply(PlayDefaultUpstreamHandler.scala:144) [play_2.10.jar:2.1.1]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anon$2$$anonfun$ha
ndle$1.apply(PlayDefaultUpstreamHandler.scala:140) [play_2.10.jar:2.1.1]
at play.api.libs.concurrent.PlayPromise$$anonfun$extend1$1.apply(Promise
.scala:113) [play_2.10.jar:2.1.1]
at play.api.libs.concurrent.PlayPromise$$anonfun$extend1$1.apply(Promise
.scala:113) [play_2.10.jar:2.1.1]
java.lang.RuntimeException: org.apache.commons.mail.EmailException: Sending the
email to the following server failed : smtp.gmail.com:587
at play.libs.F$Promise$6.apply(F.java:401) ~[play_2.10.jar:2.1.1]
at scala.concurrent.Future$$anonfun$map$1.liftedTree2$1(Future.scala:253
) ~[scala-library.jar:na]
at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:249) ~[scal
a-library.jar:na]
at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:249) ~[scal
a-library.jar:na]
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:29) ~[scala-
library.jar:na]
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.liftedTree1$1(Bat
chingExecutor.scala:67) ~[akka-actor_2.10.jar:na]
Caused by: org.apache.commons.mail.EmailException: Sending the email to the foll
owing server failed : smtp.gmail.com:587
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1242) ~[comm
ons-email-1.2.jar:1.2]
at org.apache.commons.mail.Email.send(Email.java:1267) ~[commons-email-1
.2.jar:1.2]
at com.typesafe.plugin.CommonsMailer.send(MailerPlugin.scala:242) ~[play
-plugins-mailer_2.10-2.1.0.jar:2.1.0]
at com.typesafe.plugin.MailerBuilder$class.sendHtml(MailerPlugin.scala:2
04) ~[play-plugins-mailer_2.10-2.1.0.jar:2.1.0]
at com.typesafe.plugin.CommonsMailer.sendHtml(MailerPlugin.scala:215) ~[
play-plugins-mailer_2.10-2.1.0.jar:2.1.0]
at models.V1Project.Email(V1Project.java:211) ~[na:na]
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.g
mail.com, port: 465
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1391) ~
[mail-1.4.1.jar:1.4.1]
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:41
2) ~[mail-1.4.1.jar:1.4.1]
at javax.mail.Service.connect(Service.java:310) ~[mail-1.4.1.jar:1.4.1]
at javax.mail.Service.connect(Service.java:169) ~[mail-1.4.1.jar:1.4.1]
at javax.mail.Service.connect(Service.java:118) ~[mail-1.4.1.jar:1.4.1]
at javax.mail.Transport.send0(Transport.java:188) ~[mail-1.4.1.jar:1.4.1
]
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method) ~[na:1.7.0_
07]
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketI
mpl.java:69) ~[na:1.7.0_07]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.ja
va:339) ~[na:1.7.0_07]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocket
Impl.java:200) ~[na:1.7.0_07]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java
:182) ~[na:1.7.0_07]
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157) ~[na:1.7.0
_07]
Anyone have any idea? Thanks so much!
You need to remove quotes from smtp.port settings.
It should be smtp.port = 587.
I'm not using quotes for the smtp.password field and it is working for me.
Here is a sample app that does what you need:
https://github.com/jamesward/play-emailer
Perhaps try that app and see if it works. If not, then your problem is likely that your network doesn't allow the outbound connection.

Categories

Resources