Unable to execute HTTP request: Connect to localhost:4583 for SSM - amazon-web-services

I run localstack in docker at macOS(Mojave). I can use some other services like s3, DynamoDb, SQS; but I am unable to use SSM.
I tried with aws-cli with command
aws --endpoint-url=http://localhost:4583 --region ap-souteast-1 ssm put-parameter --name dev-param --value df00a020-4937-47be-8ec8-e2a25f45ae2a --type String --overwrite
response I got
Could not connect to the endpoint URL: "http://localhost:4583/"
I tried with java sdk
public SsmService() {
this.ssmClient = AWSSimpleSystemsManagementClientBuilder.standard()
.withEndpointConfiguration( new AwsClientBuilder.EndpointConfiguration(SSM_ENDPOINT,REGION))
.withCredentials(new AWSStaticCredentialsProvider(new BasicAWSCredentials("key", "key")))
.build();
}
public void saveParam(String paramName, String paramValue,boolean overWrite) {
try {
PutParameterRequest putParameterRequest = new PutParameterRequest();
putParameterRequest.setName(paramName);
putParameterRequest.setValue(paramValue);
putParameterRequest.setOverwrite(overWrite);
putParameterRequest.setType("String");
var result = ssmClient.putParameter(putParameterRequest);
System.out.println("result = " + result.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
new SsmService().saveParam("dev-kms-key-id","df00a020-4937-47be-8ec8-e2a25f45ae2a",true);
yet again I got error
com.amazonaws.SdkClientException: Unable to execute HTTP request: Connect to localhost:4583 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleRetryableException(AmazonHttpClient.java:1175)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1121)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:770)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:744)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:726)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:686)
at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:668)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:532)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:512)
at com.amazonaws.services.simplesystemsmanagement.AWSSimpleSystemsManagementClient.doInvoke(AWSSimpleSystemsManagementClient.java:8446)
at com.amazonaws.services.simplesystemsmanagement.AWSSimpleSystemsManagementClient.invoke(AWSSimpleSystemsManagementClient.java:8413)
at com.amazonaws.services.simplesystemsmanagement.AWSSimpleSystemsManagementClient.invoke(AWSSimpleSystemsManagementClient.java:8402)
at com.amazonaws.services.simplesystemsmanagement.AWSSimpleSystemsManagementClient.executePutParameter(AWSSimpleSystemsManagementClient.java:6626)
at com.amazonaws.services.simplesystemsmanagement.AWSSimpleSystemsManagementClient.putParameter(AWSSimpleSystemsManagementClient.java:6598)
at com.bkash.rnd.ssm.SsmService.saveParam(SsmService.java:38)
at com.bkash.rnd.LocalstactAwsApplication.main(LocalstactAwsApplication.java:70)
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:4583 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:156)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:374)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.amazonaws.http.conn.ClientConnectionManagerFactory$Handler.invoke(ClientConnectionManagerFactory.java:76)
at com.amazonaws.http.conn.$Proxy51.connect(Unknown Source)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
at com.amazonaws.http.apache.client.impl.SdkHttpClient.execute(SdkHttpClient.java:72)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1297)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1113)
... 14 more
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
at java.base/java.net.Socket.connect(Socket.java:591)
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
... 30 more
It would be very helpful to know how this issue can be resolved and be able to establish connection at localhost:4583

Make sure you are mapping the ports correctly while starting localstack. for example you can use -p4583:4583 to map the ports of your container and host

Related

502 Bad Gateway: Registered endpoint failed to handle the request: on cloud foundry

After pushing my app to Cloud Foundry (pushing was successful), I am getting back (by using the url):
502 Bad Gateway: Registered endpoint failed to handle the request.
My log:
2019-05-20T13:51:52.78+0200 [APP/PROC/WEB/0] OUT 2019-05-20 11:51:52.780 INFO 6 --- [pool-3-thread-1] d.d.l.s.service.scheduling.DataOutput : Sending data to data analytics service...
2019-05-20T13:51:52.78+0200 [APP/PROC/WEB/0] OUT 2019-05-20 11:51:52.782 INFO 6 --- [pool-3-thread-1] ContainerTrustManagerFactory$PKIXFactory : Adding System Trust Manager
2019-05-20T13:51:52.78+0200 [APP/PROC/WEB/0] OUT 2019-05-20 11:51:52.784 ERROR 6 --- [pool-3-thread-1] d.d.l.s.service.scheduling.DataOutput : Tag data could not be posted to analytics service: Connect to 127.0.0.1:5000 [/127.0.0.1] failed: Connection refused (Connection refused)
2019-05-20T13:51:52.78+0200 [APP/PROC/WEB/0] ERR org.apache.http.conn.HttpHostConnectException: Connect to 127.0.0.1:5000 [/127.0.0.1] failed: Connection refused (Connection refused)
2019-05-20T13:51:52.78+0200 [APP/PROC/WEB/0] ERR at
...
2019-05-20T13:51:52.78+0200 [APP/PROC/WEB/0] ERR Caused by: java.net.ConnectException: Connection refused (Connection refused)
2019-05-20T13:51:52.78+0200 [APP/PROC/WEB/0] ERR at java.net.PlainSocketImpl.socketConnect(Native Method)
2019-05-20T13:51:52.78+0200 [APP/PROC/WEB/0] ERR at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
2019-05-20T13:51:52.78+0200 [APP/PROC/WEB/0] ERR at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
2019-05-20T13:51:52.78+0200 [APP/PROC/WEB/0] ERR at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
2019-05-20T13:51:52.78+0200 [APP/PROC/WEB/0] ERR at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
2019-05-20T13:51:52.78+0200 [APP/PROC/WEB/0] ERR at java.net.Socket.connect(Socket.java:589)
2019-05-20T13:51:52.78+0200 [APP/PROC/WEB/0] ERR at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)
2019-05-20T13:51:52.78+0200 [APP/PROC/WEB/0] ERR at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
2019-05-20T13:51:52.78+0200 [APP/PROC/WEB/0] ERR ... 33 more
I understand that I can't connect to 127.0.0.1:5000.
When I start my application locally I am getting the same error but I can access my application:
My local logs:
2019-05-20 11:32:08.700 INFO 14948 --- [pool-3-thread-1] d.d.l.s.service.scheduling.DataOutput : Sending data to data analytics service...
2019-05-20 11:32:09.708 ERROR 14948 --- [pool-3-thread-1] d.d.l.s.service.scheduling.DataOutput : Tag data could not be posted to analytics service: Connect to 127.0.0.1:5000 [/127.0.0.1] failed: Connection refused: connect
org.apache.http.conn.HttpHostConnectException: Connect to 127.0.0.1:5000 [/127.0.0.1] failed: Connection refused: connect
...
Any ideas what I am missing?

Connection refused when running a script fragment in a Zeppelin notebook paragraph

I'm following the tutorial here to setup a local apache Zeppelin notebook to test AWS Glue ETL scripts.
I think I've done everything mentioned in Tutorial Prerequisites and Tutorial: Local Zeppelin Notebook.
But when I run the following script in the notebook.
%pyspark
import sys
from pyspark.context import SparkContext
from awsglue.context import GlueContext
from awsglue.transforms import *
# Create a Glue context
glueContext = GlueContext(SparkContext.getOrCreate())
# Create a DynamicFrame using the 'persons_json' table
persons_DyF = glueContext.create_dynamic_frame.from_catalog(database="legislators", table_name="persons_json")
# Print out information about this data
print "Count: ", persons_DyF.count()
persons_DyF.printSchema()
I got an error saying
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 org.apache.thrift.transport.TSocket.open(TSocket.java:182)
at org.apache.zeppelin.interpreter.remote.ClientFactory.create(ClientFactory.java:51)
at org.apache.zeppelin.interpreter.remote.ClientFactory.create(ClientFactory.java:37)
at org.apache.commons.pool2.BasePooledObjectFactory.makeObject(BasePooledObjectFactory.java:60)
at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:861)
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:435)
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:363)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreterProcess.getClient(RemoteInterpreterProcess.java:62)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreterProcess.callRemoteFunction(RemoteInterpreterProcess.java:133)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.internal_create(RemoteInterpreter.java:165)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.open(RemoteInterpreter.java:132)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.getFormType(RemoteInterpreter.java:299)
at org.apache.zeppelin.notebook.Paragraph.jobRun(Paragraph.java:407)
at org.apache.zeppelin.scheduler.Job.run(Job.java:188)
at org.apache.zeppelin.scheduler.RemoteScheduler$JobRunner.run(RemoteScheduler.java:307)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Here's my configuration of spark interpreter:
I use run zeppelin inside a docker container(docker run -p 8080:8080 --rm --name zeppelin apache/zeppelin:0.8.0).
I've also setup port forwarding using the command ssh -i my_private_key.pem -vnNT -L :9007:169.254.76.1:9007 glue#ec2-XXX-XXX-XXX-XXX.region.compute.amazonaws.com.
Here's a complete log found in /zeppelin/logs/zeppelin--XXXXXXXXXX.log:
INFO [2018-10-18 03:40:29,438] ({qtp1458849419-14} VFSNotebookRepo.java[save]:196) - Saving note:2DS6DYE8N
INFO [2018-10-18 03:40:29,471] ({pool-2-thread-2} SchedulerFactory.java[jobStarted]:109) - Job 20181018-033943_1834157789 started by scheduler org.apache.zeppelin.interpreter.remote.RemoteInterpreter-spark:existing_process-existing_process
INFO [2018-10-18 03:40:29,473] ({pool-2-thread-2} Paragraph.java[jobRun]:380) - Run paragraph [paragraph_id: 20181018-033943_1834157789, interpreter: , note_id: 2DS6DYE8N, user: anonymous]
ERROR [2018-10-18 03:40:29,474] ({pool-2-thread-2} Job.java[run]:190) - Job failed
java.lang.RuntimeException: org.apache.zeppelin.interpreter.InterpreterException: org.apache.thrift.transport.TTransportException: java.net.ConnectException: Connection refused (Connection refused)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreterProcess.callRemoteFunction(RemoteInterpreterProcess.java:141)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.internal_create(RemoteInterpreter.java:165)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.open(RemoteInterpreter.java:132)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.getFormType(RemoteInterpreter.java:299)
at org.apache.zeppelin.notebook.Paragraph.jobRun(Paragraph.java:407)
at org.apache.zeppelin.scheduler.Job.run(Job.java:188)
at org.apache.zeppelin.scheduler.RemoteScheduler$JobRunner.run(RemoteScheduler.java:307)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.zeppelin.interpreter.InterpreterException: org.apache.thrift.transport.TTransportException: java.net.ConnectException: Connection refused (Connection refused)
at org.apache.zeppelin.interpreter.remote.ClientFactory.create(ClientFactory.java:53)
at org.apache.zeppelin.interpreter.remote.ClientFactory.create(ClientFactory.java:37)
at org.apache.commons.pool2.BasePooledObjectFactory.makeObject(BasePooledObjectFactory.java:60)
at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:861)
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:435)
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:363)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreterProcess.getClient(RemoteInterpreterProcess.java:62)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreterProcess.callRemoteFunction(RemoteInterpreterProcess.java:133)
... 13 more
Caused by: org.apache.thrift.transport.TTransportException: java.net.ConnectException: Connection refused (Connection refused)
at org.apache.thrift.transport.TSocket.open(TSocket.java:187)
at org.apache.zeppelin.interpreter.remote.ClientFactory.create(ClientFactory.java:51)
... 20 more
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 org.apache.thrift.transport.TSocket.open(TSocket.java:182)
... 21 more
ERROR [2018-10-18 03:40:29,478] ({pool-2-thread-2} NotebookServer.java[afterStatusChange]:2294) - Error
java.lang.RuntimeException: org.apache.zeppelin.interpreter.InterpreterException: org.apache.thrift.transport.TTransportException: java.net.ConnectException: Connection refused (Connection refused)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreterProcess.callRemoteFunction(RemoteInterpreterProcess.java:141)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.internal_create(RemoteInterpreter.java:165)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.open(RemoteInterpreter.java:132)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.getFormType(RemoteInterpreter.java:299)
at org.apache.zeppelin.notebook.Paragraph.jobRun(Paragraph.java:407)
at org.apache.zeppelin.scheduler.Job.run(Job.java:188)
at org.apache.zeppelin.scheduler.RemoteScheduler$JobRunner.run(RemoteScheduler.java:307)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.zeppelin.interpreter.InterpreterException: org.apache.thrift.transport.TTransportException: java.net.ConnectException: Connection refused (Connection refused)
at org.apache.zeppelin.interpreter.remote.ClientFactory.create(ClientFactory.java:53)
at org.apache.zeppelin.interpreter.remote.ClientFactory.create(ClientFactory.java:37)
at org.apache.commons.pool2.BasePooledObjectFactory.makeObject(BasePooledObjectFactory.java:60)
at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:861)
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:435)
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:363)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreterProcess.getClient(RemoteInterpreterProcess.java:62)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreterProcess.callRemoteFunction(RemoteInterpreterProcess.java:133)
... 13 more
Caused by: org.apache.thrift.transport.TTransportException: java.net.ConnectException: Connection refused (Connection refused)
at org.apache.thrift.transport.TSocket.open(TSocket.java:187)
at org.apache.zeppelin.interpreter.remote.ClientFactory.create(ClientFactory.java:51)
... 20 more
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 org.apache.thrift.transport.TSocket.open(TSocket.java:182)
... 21 more
WARN [2018-10-18 03:40:29,479] ({pool-2-thread-2} NotebookServer.java[afterStatusChange]:2302) - Job 20181018-033943_1834157789 is finished, status: ERROR, exception: java.lang.RuntimeException: org.apache.zeppelin.interpreter.InterpreterException: org.apache.thrift.transport.TTransportException: java.net.ConnectException: Connection refused (Connection refused), result: %text 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 org.apache.thrift.transport.TSocket.open(TSocket.java:182)
at org.apache.zeppelin.interpreter.remote.ClientFactory.create(ClientFactory.java:51)
at org.apache.zeppelin.interpreter.remote.ClientFactory.create(ClientFactory.java:37)
at org.apache.commons.pool2.BasePooledObjectFactory.makeObject(BasePooledObjectFactory.java:60)
at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:861)
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:435)
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:363)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreterProcess.getClient(RemoteInterpreterProcess.java:62)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreterProcess.callRemoteFunction(RemoteInterpreterProcess.java:133)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.internal_create(RemoteInterpreter.java:165)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.open(RemoteInterpreter.java:132)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreter.getFormType(RemoteInterpreter.java:299)
at org.apache.zeppelin.notebook.Paragraph.jobRun(Paragraph.java:407)
at org.apache.zeppelin.scheduler.Job.run(Job.java:188)
at org.apache.zeppelin.scheduler.RemoteScheduler$JobRunner.run(RemoteScheduler.java:307)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
INFO [2018-10-18 03:40:29,489] ({pool-2-thread-2} VFSNotebookRepo.java[save]:196) - Saving note:2DS6DYE8N
INFO [2018-10-18 03:40:29,494] ({pool-2-thread-2} SchedulerFactory.java[jobFinished]:115) - Job 20181018-033943_1834157789 finished by scheduler org.apache.zeppelin.interpreter.remote.RemoteInterpreter-spark:existing_process-existing_process
How can I debug this issue now?
I don't find many discussions about this bug online.
I also had this issue when running Zeppelin 0.8.0, but switching to Zeppelin 0.7.3 seemed to resolve it.

JHipster project deployed using aws sub-generator returns http 404 error

This question about "aws sub-generator" (not "aws-containers sub-generator").
Question 1:
Is this generator supposed to update "application-prod.yml"? I can see the information I provided while running the sub-generator including the database name in ".yo-rc.json". But database user-name and password are neither there nor in the "application-prod.yml".
Question 2:
I generated a simple JHipster project with some entities. It was working fine locally on my PC. I used the "aws sub-generator" and everything went well. It created the Elastic Beanstalk application, an EC2 instance, the S3 bucket, the RDS database, the security groups...Here is the event log of the Elastic Beanstalk:
Successfully launched environment: alirezatodoapplicationapril-env
Environment health has been set to GREEN
Created CloudWatch alarm named: awseb-e-i2vaqsmdbh-stack-AWSEBCloudwatchAlarmHigh-18WDVCSH132VM
Created CloudWatch alarm named: awseb-e-i2vaqsmdbh-stack-AWSEBCloudwatchAlarmLow-EA2GT2HFN77U
Created Auto Scaling group policy named: arn:aws:autoscaling:us-east-1:827968211260:scalingPolicy:5cf0c635-40b7-4008-9ebe-57823a3f9b3c:autoScalingGroupName/awseb-e-i2vaqsmdbh-stack-AWSEBAutoScalingGroup-1SLCXWGKICYGM:policyName/awseb-e-i2vaqsmdbh-stack-AWSEBAutoScalingScaleDownPolicy-JHTI8C9VQTF1
Created Auto Scaling group policy named: arn:aws:autoscaling:us-east-1:827968211260:scalingPolicy:5e6f86c4-79f7-4504-a6d2-8a8a9c638ef5:autoScalingGroupName/awseb-e-i2vaqsmdbh-stack-AWSEBAutoScalingGroup-1SLCXWGKICYGM:policyName/awseb-e-i2vaqsmdbh-stack-AWSEBAutoScalingScaleUpPolicy-E1W03HEXTE6R
Waiting for EC2 instances to launch. This may take a few minutes.
Created Auto Scaling group named: awseb-e-i2vaqsmdbh-stack-AWSEBAutoScalingGroup-1SLCXWGKICYGM
Added EC2 instance 'i-074488994cedde8c7' to Auto Scaling Group 'awseb-e-i2vaqsmdbh-stack-AWSEBAutoScalingGroup-1SLCXWGKICYGM'.
Adding instance 'i-074488994cedde8c7' to your environment.
Created Auto Scaling launch configuration named: awseb-e-i2vaqsmdbh-stack-AWSEBAutoScalingLaunchConfiguration-1F3VDL1LKSD1B
Created load balancer named: awseb-e-i-AWSEBLoa-18MWGKA8O6FHP
Created security group named: awseb-e-i2vaqsmdbh-stack-AWSEBSecurityGroup-1BS14HUVJLFUD
Created security group named: sg-874777cd
Using elasticbeanstalk-us-east-1-827968211260 as Amazon S3 storage bucket for environment data.
createEnvironment is starting.
But, now when I use the link of the Beanstalk application it gives me a 404 error. What is missed? Here is the log of application startup (catalina.out):
██╗ ██╗ ██╗ ████████╗ ███████╗ ██████╗ ████████╗ ████████╗ ███████╗
██║ ██║ ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
██║ ████████║ ██║ ███████╔╝ ╚█████╗ ██║ ██████╗ ███████╔╝
██╗ ██║ ██╔═══██║ ██║ ██╔════╝ ╚═══██╗ ██║ ██╔═══╝ ██╔══██║
╚██████╔╝ ██║ ██║ ████████╗ ██║ ██████╔╝ ██║ ████████╗ ██║ ╚██╗
╚═════╝ ╚═╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝
:: JHipster 🤓 :: Running Spring Boot 2.0.3.RELEASE ::
:: https://www.jhipster.tech ::
2018-07-31 20:18:22.679 ERROR 3398 --- [ost-startStop-1] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalStateException: Could not locate PropertySource and the fail fast property is set, failing
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:136)
at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:94)
at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:633)
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:373)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:325)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:155)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:135)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:87)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5204)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1141)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:8761/config/ToDo/prod/master": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:732)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:680)
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:600)
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getRemoteEnvironment(ConfigServicePropertySourceLocator.java:218)
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:96)
... 20 common frames omitted
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 java.net.Socket.connect(Socket.java:538)
at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:242)
at sun.net.www.http.HttpClient.New(HttpClient.java:339)
at sun.net.www.http.HttpClient.New(HttpClient.java:357)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)
at org.springframework.http.client.SimpleBufferingClientHttpRequest.executeInternal(SimpleBufferingClientHttpRequest.java:76)
at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48)
at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:723)
... 24 common frames omitted
31-Jul-2018 20:18:22.688 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1141)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Could not locate PropertySource and the fail fast property is set, failing
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:136)
at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:94)
at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:633)
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:373)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:325)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:155)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:135)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:87)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5204)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
Caused by: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:8761/config/ToDo/prod/master": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:732)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:680)
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:600)
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getRemoteEnvironment(ConfigServicePropertySourceLocator.java:218)
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:96)
... 20 more
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 java.net.Socket.connect(Socket.java:538)
at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:242)
at sun.net.www.http.HttpClient.New(HttpClient.java:339)
at sun.net.www.http.HttpClient.New(HttpClient.java:357)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)
at org.springframework.http.client.SimpleBufferingClientHttpRequest.executeInternal(SimpleBufferingClientHttpRequest.java:76)
at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48)
at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:723)
... 24 more
31-Jul-2018 20:18:22.690 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Error deploying web application directory [/var/lib/tomcat8/webapps/ROOT]
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:758)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1141)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
31-Jul-2018 20:18:22.691 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/var/lib/tomcat8/webapps/ROOT] has finished in [16,376] ms
31-Jul-2018 20:18:22.695 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
31-Jul-2018 20:18:22.727 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
31-Jul-2018 20:18:22.742 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 16499 ms
The JHipster AWS ElasticBeanstalk option only works with monoliths and won't deploy the JHipster Registry if that option is chosen when generating the project.
If you want to disable the JHipster Registry feature, you can set two config variables in your project. In bootstrap-prod.yml, set spring.cloud.config.enabled: false and disable Eureka in application-prod.yml with eureka.client.enabled: false.
In regards to the database connection settings, those are set as environment variables when creating the ElasticBeanstalk environment which Spring Boot uses instead of the hardcoded config in application-prod.yml

Error in consuming sample message from Wso2mb

I tried to run wso2mb-3.1.0/samples/JmsMessageListenerClient but I get below error on server start. Am I missing some config?
org.wso2.andes.AMQConnectionFailureException: Unable to Connect
at org.wso2.andes.client.AMQConnection.<init>(AMQConnection.java:475)
at org.wso2.andes.client.AMQConnectionFactory.createConnection(AMQConnectionFactory.java:328)
at org.wso2.andes.client.AMQConnectionFactory.createTopicConnection(AMQConnectionFactory.java:443)
at com.wickes.common.jms.service.wso2mq.Wso2MessageListener.registerSubscribers(Wso2MessageListener.java:41)
at com.wickes.product.web.Controller.get(Controller.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.wso2.msf4j.internal.router.HttpMethodInfo.invoke(HttpMethodInfo.java:132)
at org.wso2.msf4j.internal.MSF4JMessageProcessor.dispatchMethod(MSF4JMessageProcessor.java:130)
at org.wso2.msf4j.internal.MSF4JMessageProcessor.receive(MSF4JMessageProcessor.java:72)
at org.wso2.carbon.transport.http.netty.listener.WorkerPoolDispatchingSourceHandler.lambda$publishToWorkerPool$12(WorkerPoolDispatchingSourceHandler.java:125)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
javax.jms.JMSException: Error creating connection: Unable to Connect
at org.wso2.andes.client.AMQConnectionFactory.createConnection(AMQConnectionFactory.java:338)
at org.wso2.andes.client.AMQConnectionFactory.createTopicConnection(AMQConnectionFactory.java:443)
at com.wickes.common.jms.service.wso2mq.Wso2MessageListener.registerSubscribers(Wso2MessageListener.java:41)
at com.wickes.product.web.Controller.get(Controller.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.wso2.msf4j.internal.router.HttpMethodInfo.invoke(HttpMethodInfo.java:132)
at org.wso2.msf4j.internal.MSF4JMessageProcessor.dispatchMethod(MSF4JMessageProcessor.java:130)
at org.wso2.msf4j.internal.MSF4JMessageProcessor.receive(MSF4JMessageProcessor.java:72)
at org.wso2.carbon.transport.http.netty.listener.WorkerPoolDispatchingSourceHandler.lambda$publishToWorkerPool$12(WorkerPoolDispatchingSourceHandler.java:125)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.wso2.andes.AMQConnectionFailureException: Unable to Connect
at org.wso2.andes.client.AMQConnection.<init>(AMQConnection.java:475)
at org.wso2.andes.client.AMQConnectionFactory.createConnection(AMQConnectionFactory.java:328)
... 14 more
2017-02-21 16:03 ERROR AMQStateManager:162 - Notifying Waiters([org.wso2.andes.client.state.StateWaiter#520acd8f]) for error:Exception thrown against AMQConnection:
Host: localhost
Port: 5672
Virtual Host: carbon
Client ID: carbon
Active session count: 0: org.wso2.andes.AMQDisconnectedException: Server closed connection and reconnection not permitted.
2017-02-21 16:03 ERROR AMQProtocolHandler:485 - Exception processing frame
org.wso2.andes.framing.AMQProtocolClassException: Protocol class 1 was expected; received 3
at org.wso2.andes.framing.ProtocolInitiation.checkVersion(ProtocolInitiation.java:190)
at org.wso2.andes.client.protocol.AMQProtocolHandler$2.run(AMQProtocolHandler.java:476)
at org.wso2.andes.pool.Job.processAll(Job.java:109)
at org.wso2.andes.pool.Job.run(Job.java:157)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2017-02-21 16:03 ERROR AMQConnection:1307 - Throwable Received but no listener set: org.wso2.andes.AMQDisconnectedException: Server closed connection and reconnection not permitted.
2017-02-21 16:03 ERROR AMQConnection:1307 - Throwable Received but no listener set: org.wso2.andes.framing.AMQProtocolClassException: Protocol class 1 was expected; received 3
Thanks,
Manish

Soap WS Connection refused

I'm trying to connect to a SOAP webserver, I was given a certificate but I get the below exception.
I did:
$openssl pkcs12 -in cert.pfx -out certificate.cer -nodes
$keytool -import -alias webserver -file certificate.cer
Certificate was added to keystore
I have a junit test that calls the remote server with these JVM options:
-ea -Djavax.net.debug=all -Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true
-Dcom.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump=true
-Dcom.sun.xml.ws.transport.http.HttpAdapter.dump=true
-Dcom.sun.xml.internal.ws.transport.http.HttpAdapter.dump=true
-Djavax.net.ssl.trustStore=certificate.cer
-Djavax.net.ssl.trustStoreType=PEM
-Djavax.net.ssl.trustStorePassword=pwd
-Djavax.net.ssl.keyStore=certificate.cer
-Djavax.net.ssl.keyStoreType=PEM
-Djavax.net.ssl.keyStorePassword=pwd
the remote call is done using:
authenticationService.getAuthenticationServiceSoap().authenticateWithPasswordAuth(clientId, username, password);
where the client I'm using has got these annotations:
#WebServiceClient
public class AuthenticationService extends Service {
and
#WebEndpoint(name = "AuthenticationServiceSoap")
public AuthenticationServiceSoap getAuthenticationServiceSoap()
I don't do anything else code wise, and I get the below Exception:
I don't even understand if java is trying to use https or no.
---[HTTP request - http://..../Soap/AuthenticationService.asmx]--- Accept: [text/xml, multipart/related] Content-Type: [text/xml;
charset=utf-8] SOAPAction:
["http://....../AuthenticateWithPasswordAuth"] User-Agent: [JAX-WS RI
2.2.4-b01]
Caused by: java.net.ConnectException: Connection refused at
java.net.PlainSocketImpl.socketConnect(Native Method) at
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at
java.net.Socket.connect(Socket.java:579) at
java.net.Socket.connect(Socket.java:528) at
sun.net.NetworkClient.doConnect(NetworkClient.java:180) at
sun.net.www.http.HttpClient.openServer(HttpClient.java:432) at
sun.net.www.http.HttpClient.openServer(HttpClient.java:527) at
sun.net.www.http.HttpClient.(HttpClient.java:211) at
sun.net.www.http.HttpClient.New(HttpClient.java:308) at
sun.net.www.http.HttpClient.New(HttpClient.java:326) at
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:997)
at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:976)
at
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:851)
at
sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1092)
at
com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:105)