Home Unable to start Grizzly http server
Reply: 1

Unable to start Grizzly http server

dileepvarma
1#
dileepvarma Published in 2018-01-13 04:30:43Z

I am getting below error when I try starting Grizzly server from Java code. Please help.

javax.ws.rs.ProcessingException: Failed to start Grizzly HTTP server: Cannot assign requested address: bind at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory.createHttpServer(GrizzlyHttpServerFactory.java:299) at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory.createHttpServer(GrizzlyHttpServerFactory.java:119) at org.alm.TestClient.setUp(TestClient.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80) at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:525) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:202) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:130) at
org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:173)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105) at org.testng.TestRunner.runWorkers(TestRunner.java:1178) at org.testng.TestRunner.privateRun(TestRunner.java:757) at org.testng.TestRunner.run(TestRunner.java:608) 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:1158) at org.testng.TestNG.runSuitesLocally(TestNG.java:1083) at org.testng.TestNG.run(TestNG.java:999) at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76) Caused by: java.net.BindException: Cannot assign requested address: bind at sun.nio.ch.Net.bind0(Native Method)

Code

@BeforeClass
    public void setUp() throws Exception
    {
        final ResourceConfig rc = new ResourceConfig(AlmApiStub.class);
        System.out.println(config.host()+config.port());
        server = GrizzlyHttpServerFactory.createHttpServer(
                URI.create(String.format("https://%s:%s/", config.host(), config.port())), rc);
    }
Ravi
2#
Ravi Reply to 2018-01-13 05:45:59Z

javax.ws.rs.ProcessingException: Failed to start Grizzly HTTP server: Cannot assign requested address: bind at

Make sure, there aren't any application running on same machine, using same port i.e. 8443. Because Grizzly would be trying to acquire same port, but it might be held-up by another application on same machine. Alternatively, you could try assigning different port.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.419681 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO