Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connector Error #1108

Closed
zhangjianweibj opened this issue Oct 26, 2017 · 7 comments
Closed

connector Error #1108

zhangjianweibj opened this issue Oct 26, 2017 · 7 comments
Labels

Comments

@zhangjianweibj
Copy link
Contributor

hi,I run my test case,but I got error messages:

"ConnectionException{message=java.net.ConnectException: Connection refused: connect, status=0}
at org.openstack4j.connectors.jersey2.HttpExecutorServiceImpl.invoke(HttpExecutorServiceImpl.java:58)
at org.openstack4j.connectors.jersey2.HttpExecutorServiceImpl.execute(HttpExecutorServiceImpl.java:33)
at org.openstack4j.core.transport.internal.HttpExecutor.execute(HttpExecutor.java:51)
at org.openstack4j.openstack.internal.BaseOpenStackService$Invocation.execute(BaseOpenStackService.java:213)
at org.openstack4j.openstack.internal.BaseOpenStackService$Invocation.execute(BaseOpenStackService.java:207)
at org.openstack4j.openstack.telemetry.internal.AlarmAodhServiceImpl.getById(AlarmAodhServiceImpl.java:30)
at org.openstack4j.api.telemetry.AlarmTests.getAlarmTest(AlarmTests.java:37)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:295)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:90)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: javax.ws.rs.ProcessingException: java.net.ConnectException: Connection refused: connect
at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:287)
at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:255)
at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:684)
at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:681)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444)
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:681)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:411)
at org.openstack4j.connectors.jersey2.HttpCommand.execute(HttpCommand.java:91)
at org.openstack4j.connectors.jersey2.HttpExecutorServiceImpl.invokeRequest(HttpExecutorServiceImpl.java:65)
at org.openstack4j.connectors.jersey2.HttpExecutorServiceImpl.invoke(HttpExecutorServiceImpl.java:56)
... 33 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
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.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
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.parseHTTP(HttpClient.java:698)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1569)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
at org.glassfish.jersey.client.internal.HttpUrlConnector._apply(HttpUrlConnector.java:394)
at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:285)
... 45 more
... Removed 21 stack frames
ConnectionException{message=java.net.ConnectException: Connection refused: connect, status=0}
at org.openstack4j.connectors.jersey2.HttpExecutorServiceImpl.invoke(HttpExecutorServiceImpl.java:58)
at org.openstack4j.connectors.jersey2.HttpExecutorServiceImpl.execute(HttpExecutorServiceImpl.java:33)
at org.openstack4j.core.transport.internal.HttpExecutor.execute(HttpExecutor.java:51)
at org.openstack4j.openstack.internal.BaseOpenStackService$Invocation.execute(BaseOpenStackService.java:213)
at org.openstack4j.openstack.internal.BaseOpenStackService$Invocation.execute(BaseOpenStackService.java:207)
at org.openstack4j.openstack.telemetry.internal.AlarmAodhServiceImpl.getById(AlarmAodhServiceImpl.java:30)
at org.openstack4j.api.telemetry.AlarmTests.getAlarmTest(AlarmTests.java:37)
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:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1198)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1123)
at org.testng.TestNG.run(TestNG.java:1031)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:295)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:90)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: javax.ws.rs.ProcessingException: java.net.ConnectException: Connection refused: connect
at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:287)
at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:255)
at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:684)
at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:681)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444)
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:681)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:411)
at org.openstack4j.connectors.jersey2.HttpCommand.execute(HttpCommand.java:91)
at org.openstack4j.connectors.jersey2.HttpExecutorServiceImpl.invokeRequest(HttpExecutorServiceImpl.java:65)
at org.openstack4j.connectors.jersey2.HttpExecutorServiceImpl.invoke(HttpExecutorServiceImpl.java:56)
... 33 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
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.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
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.parseHTTP(HttpClient.java:698)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1569)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
at org.glassfish.jersey.client.internal.HttpUrlConnector._apply(HttpUrlConnector.java:394)
at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:285)
... 45 more
"
org.openstack4j.connectors.jersey2.HttpExecutorServiceImpl.invoke(HttpExecutorServiceImpl.java:58)
org.openstack4j.connectors.jersey2.HttpExecutorServiceImpl.execute(HttpExecutorServiceImpl.java:33)
org.openstack4j.core.transport.internal.HttpExecutor.execute(HttpExecutor.java:51)
org.openstack4j.openstack.internal.BaseOpenStackService$Invocation.execute(BaseOpenStackService.java:213)
org.openstack4j.openstack.internal.BaseOpenStackService$Invocation.execute(BaseOpenStackService.java:207)
org.openstack4j.openstack.telemetry.internal.AlarmAodhServiceImpl.getById(AlarmAodhServiceImpl.java:30)
org.openstack4j.api.telemetry.AlarmTests.getAlarmTest(AlarmTests.java:37)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
org.testng.TestRunner.privateRun(TestRunner.java:767)
org.testng.TestRunner.run(TestRunner.java:617)
org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
org.testng.SuiteRunner.run(SuiteRunner.java:240)
org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
org.testng.TestNG.runSuitesSequentially(TestNG.java:1198)
org.testng.TestNG.runSuitesLocally(TestNG.java:1123)
org.testng.TestNG.run(TestNG.java:1031)
org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:295)
org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84)
org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:90)
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

what should i do,i do not know how to config local connector!Please give detail instructions.thinks

@zhangjianweibj zhangjianweibj changed the title Test cases Error connector Error Oct 26, 2017
@auhlig
Copy link
Member

auhlig commented Oct 26, 2017

Caused by: java.net.ConnectException: Connection refused: connect Correct URL of your OpenStack instance?

@zhangjianweibj
Copy link
Contributor Author

hi,@auhlig i write telemetry test cases,not change any configuration.then run "mvn integration-test".then got the error message.sorry,not config local connector.and do not kown how to config connector.is any documention about how to config connector .thinks.

test cases:
@test(suiteName="Alarms")
public class AlarmTests extends AbstractTest {

private static final String JSON_ALARMS = "/telemetry/alarms.json";

@Test
public void getAlarmTest() throws IOException {
    respondWith(JSON_ALARMS);
    List<? extends Alarm> list=osv3().telemetry().alarms().list();
    assertEquals(2,list.size());

}

@Override
protected Service service() {
    return Service.TELEMETRY;
}

}

@auhlig
Copy link
Member

auhlig commented Oct 30, 2017

Mh. There's a default connector, so actually there should be no need to define it. Does this happen with a fresh clone of Os4j? Is anything else messing with/blocking port 8087 on your side?

@zhangjianweibj
Copy link
Contributor Author

@auhlig yeah,i checkout from master branch,then write the test cases,change noting else.8087 port is not blocked.the test cases i wrote,can your run properly?thinks

@zhangjianweibj
Copy link
Contributor Author

core-test/src/main/resources/telemetry/alarms.json

[{
"alarm_actions" : ["http://192.168.0.1:8000/v1/signal/arn%3Aopenstack%3Aheat%3A%3A3c8edb30c13d471d96c9881dee761134%3Astacks%2Fsdfasdf%2F4bb97267-0657-4834-bbe2-eb0a5f40480d%2Fresources%2FWebAS-Sig_group.WebAS-Sig_scale_out?Timestamp=2015-01-20T15%3A06%3A04Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=800c42eb3f4a49218f45688547c77266&SignatureVersion=2&Signature=Hgbvixq0VkVKJIKEyuIIEx7a68ut2eCl0EpxoaahUVU%3D"],
"ok_actions" : [],
"name" : "sdfasdf-scale_out_WebAS-Sig-l4ue3wfz6otx",
"timestamp" : "2015-01-20T15:06:06.625000",
"enabled" : true,
"state" : "insufficient data",
"state_timestamp" : "2015-01-20T15:06:06.625000",
"threshold_rule" : {
"meter_name" : "cpu",
"evaluation_periods" : 2,
"period" : 60,
"statistic" : "avg",
"threshold" : 500.0,
"query" : [{
"field" : "metadata.metering.metadata.stack_id",
"value" : "4bb97267-0657-4834-bbe2-eb0a5f40480d",
"op" : "eq"
}, {
"field" : "metadata.metering.metadata.resource_name",
"value" : "WebAS-OeM",
"op" : "eq"
}
],
"comparison_operator" : "gt",
"exclude_outliers" : false
},
"alarm_id" : "7de0effc-bf54-4ffd-bb63-dec286d4f17f",
"time_constraints" : [],
"insufficient_data_actions" : [],
"repeat_actions" : true,
"user_id" : "de2fd0ebac804ef8970e69ae5a4b4a16",
"project_id" : "3c8edb30c13d471d96c9881dee761134",
"type" : "threshold",
"description" : "scale out"
}, {
"alarm_actions" : ["http://192.168.0.1:8000/v1/signal/arn%3Aopenstack%3Aheat%3A%3A3c8edb30c13d471d96c9881dee761134%3Astacks%2Fsdfasdf%2F4bb97267-0657-4834-bbe2-eb0a5f40480d%2Fresources%2FWebAS-Sig_group.WebAS-Sig_scale_in?Timestamp=2015-01-20T15%3A06%3A04Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=aca03ce06e4e4aec97aeea345b817249&SignatureVersion=2&Signature=H743x%2FSH8mLzSW%2BHmQLedflGIv69R6EFsa9VIduT6m8%3D"],
"ok_actions" : [],
"name" : "sdfasdf-scale_in_WebAS-Sig-ob3jxa7tl6ch",
"timestamp" : "2015-01-20T15:06:06.724000",
"enabled" : true,
"state" : "insufficient data",
"state_timestamp" : "2015-01-20T15:06:06.724000",
"threshold_rule" : {
"meter_name" : "cpu",
"evaluation_periods" : 2,
"period" : 60,
"statistic" : "avg",
"threshold" : 100.0,
"query" : [{
"field" : "metadata.metering.metadata.stack_id",
"value" : "4bb97267-0657-4834-bbe2-eb0a5f40480d",
"op" : "eq"
}, {
"field" : "metadata.metering.metadata.resource_name",
"value" : "WebAS-OeM",
"op" : "eq"
}
],
"comparison_operator" : "lt",
"exclude_outliers" : false
},
"alarm_id" : "ca1ac89f-5dfe-4209-b92f-f9ca4f4eb85b",
"time_constraints" : [],
"insufficient_data_actions" : [],
"repeat_actions" : true,
"user_id" : "de2fd0ebac804ef8970e69ae5a4b4a16",
"project_id" : "3c8edb30c13d471d96c9881dee761134",
"type" : "threshold",
"description" : "scale in"
}
]

@zhangjianweibj
Copy link
Contributor Author

@auhlig @gondor by default ,alarm test cases in openstack4j,never run?see this test cases?
qq 20171031160918

@auhlig
Copy link
Member

auhlig commented Nov 21, 2017

Sorry @zhangjianweibj . I missed that. Can you fix and enable the test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants