Android Question Embed an Http Server doesnt work on android 9 Pie

Ganiadi

Active Member
Licensed User
Longtime User
Hi Erel,

I tried to install the embed http server https://www.b4x.com/android/forum/t...er-in-your-android-application.25984/#content
into a mini pc server run under android 9 Pie.
It installed and run, but when i tried to Start the Server by clicking Start Server button, it raised error and stopped.
below is the error log, pls advice .. tq

Logger connected to: Droidlogic X96Air_P2
--------- beginning of crash
--------- beginning of system
--------- beginning of main
** Activity (main) Create, isFirst = false **
Ip address: 192.168.1.77
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
*** Service (serverservice) Create ***
2019-12-12 13:34:30.094:INFO::jetty-7.x.y-SNAPSHOT
2019-12-12 13:34:30.096:INFO::started o.e.j.s.ServletContextHandler{/,null}
2019-12-12 13:34:30.119:WARN::FAILED [email protected]:5555 FAILED: java.net.BindException: Address already in use
2019-12-12 13:34:30.119:WARN::FAILED org.eclipse.jetty.server.Server@b8fddc0: java.net.BindException: Address already in use
(BindException) java.net.BindException: Address already in use
** Service (serverservice) Start **
** Service (serverservice) Destroy **
2019-12-12 14:53:57.249:INFO::stopped o.e.j.s.ServletContextHandler{/,null}
** Activity (main) Pause, UserClosed = true **
** Activity (main) Create, isFirst = true **
Ip address: 192.168.1.77
** Activity (main) Resume **
*** Service (serverservice) Create ***
2019-12-12 14:55:00.202:INFO::jetty-7.x.y-SNAPSHOT
2019-12-12 14:55:00.244:INFO::started o.e.j.s.ServletContextHandler{/,null}
2019-12-12 14:55:00.259:WARN::FAILED [email protected]:5555 FAILED: java.net.BindException: Address already in use
2019-12-12 14:55:00.259:WARN::FAILED org.eclipse.jetty.server.Server@7c5ee7a: java.net.BindException: Address already in use
(BindException) java.net.BindException: Address already in use
** Service (serverservice) Start **
** Activity (main) Pause, UserClosed = true **
Logger connected to: Droidlogic X96Air_P2
--------- beginning of crash
--------- beginning of system
--------- beginning of main
** Service (serverservice) Destroy **
2019-12-12 14:53:57.249:INFO::stopped o.e.j.s.ServletContextHandler{/,null}
** Activity (main) Pause, UserClosed = true **
** Activity (main) Create, isFirst = true **
Ip address: 192.168.1.77
** Activity (main) Resume **
*** Service (serverservice) Create ***
2019-12-12 14:55:00.202:INFO::jetty-7.x.y-SNAPSHOT
2019-12-12 14:55:00.244:INFO::started o.e.j.s.ServletContextHandler{/,null}
2019-12-12 14:55:00.259:WARN::FAILED [email protected]:5555 FAILED: java.net.BindException: Address already in use
2019-12-12 14:55:00.259:WARN::FAILED org.eclipse.jetty.server.Server@7c5ee7a: java.net.BindException: Address already in use
(BindException) java.net.BindException: Address already in use
** Service (serverservice) Start **
** Activity (main) Pause, UserClosed = true **
** Activity (main) Create, isFirst = true **
Ip address: 192.168.1.77
** Activity (main) Resume **
*** Service (serverservice) Create ***
2019-12-12 14:59:32.091:INFO::jetty-7.x.y-SNAPSHOT
2019-12-12 14:59:32.152:INFO::started o.e.j.s.ServletContextHandler{/,null}
2019-12-12 14:59:32.161:WARN::FAILED [email protected]:5555 FAILED: java.net.BindException: Address already in use
2019-12-12 14:59:32.162:WARN::FAILED org.eclipse.jetty.server.Server@2b44a88: java.net.BindException: Address already in use
serverservice_service_create (java line: 392)
java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:442)
at sun.nio.ch.Net.bind(Net.java:434)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.nio.BlockingChannelConnector.open(BlockingChannelConnector.java:118)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:297)
at org.eclipse.jetty.server.nio.BlockingChannelConnector.doStart(BlockingChannelConnector.java:76)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
at org.eclipse.jetty.server.Server.doStart(Server.java:269)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
at anywheresoftware.b4a.objects.HttpServer.Start(HttpServer.java:56)
at b4a.example.serverservice._service_create(serverservice.java:392)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at b4a.example.serverservice.onCreate(serverservice.java:56)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3532)
at android.app.ActivityThread.access$1300(ActivityThread.java:199)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1666)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
java.lang.RuntimeException: Unable to create service b4a.example.serverservice: java.lang.RuntimeException: java.net.BindException: Address already in use
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3544)
at android.app.ActivityThread.access$1300(ActivityThread.java:199)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1666)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.RuntimeException: java.net.BindException: Address already in use
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:233)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at b4a.example.serverservice.onCreate(serverservice.java:56)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3532)
... 8 more
Caused by: java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:442)
at sun.nio.ch.Net.bind(Net.java:434)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.nio.BlockingChannelConnector.open(BlockingChannelConnector.java:118)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:297)
at org.eclipse.jetty.server.nio.BlockingChannelConnector.doStart(BlockingChannelConnector.java:76)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
at org.eclipse.jetty.server.Server.doStart(Server.java:269)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
at anywheresoftware.b4a.objects.HttpServer.Start(HttpServer.java:56)
at b4a.example.serverservice._service_create(serverservice.java:392)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
... 11 more
Logger connected to: Droidlogic X96Air_P2
--------- beginning of crash
--------- beginning of system
--------- beginning of main
** Activity (main) Create, isFirst = true **
Ip address: 192.168.1.77
** Activity (main) Resume **
*** Service (serverservice) Create ***
2019-12-12 14:55:00.202:INFO::jetty-7.x.y-SNAPSHOT
2019-12-12 14:55:00.244:INFO::started o.e.j.s.ServletContextHandler{/,null}
2019-12-12 14:55:00.259:WARN::FAILED [email protected]:5555 FAILED: java.net.BindException: Address already in use
2019-12-12 14:55:00.259:WARN::FAILED org.eclipse.jetty.server.Server@7c5ee7a: java.net.BindException: Address already in use
(BindException) java.net.BindException: Address already in use
** Service (serverservice) Start **
** Activity (main) Pause, UserClosed = true **
** Activity (main) Create, isFirst = true **
Ip address: 192.168.1.77
** Activity (main) Resume **
*** Service (serverservice) Create ***
2019-12-12 14:59:32.091:INFO::jetty-7.x.y-SNAPSHOT
2019-12-12 14:59:32.152:INFO::started o.e.j.s.ServletContextHandler{/,null}
2019-12-12 14:59:32.161:WARN::FAILED [email protected]:5555 FAILED: java.net.BindException: Address already in use
2019-12-12 14:59:32.162:WARN::FAILED org.eclipse.jetty.server.Server@2b44a88: java.net.BindException: Address already in use
serverservice_service_create (java line: 392)
java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:442)
at sun.nio.ch.Net.bind(Net.java:434)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.nio.BlockingChannelConnector.open(BlockingChannelConnector.java:118)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:297)
at org.eclipse.jetty.server.nio.BlockingChannelConnector.doStart(BlockingChannelConnector.java:76)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
at org.eclipse.jetty.server.Server.doStart(Server.java:269)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
at anywheresoftware.b4a.objects.HttpServer.Start(HttpServer.java:56)
at b4a.example.serverservice._service_create(serverservice.java:392)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at b4a.example.serverservice.onCreate(serverservice.java:56)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3532)
at android.app.ActivityThread.access$1300(ActivityThread.java:199)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1666)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
java.lang.RuntimeException: Unable to create service b4a.example.serverservice: java.lang.RuntimeException: java.net.BindException: Address already in use
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3544)
at android.app.ActivityThread.access$1300(ActivityThread.java:199)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1666)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.RuntimeException: java.net.BindException: Address already in use
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:233)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at b4a.example.serverservice.onCreate(serverservice.java:56)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3532)
... 8 more
Caused by: java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:442)
at sun.nio.ch.Net.bind(Net.java:434)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.nio.BlockingChannelConnector.open(BlockingChannelConnector.java:118)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:297)
at org.eclipse.jetty.server.nio.BlockingChannelConnector.doStart(BlockingChannelConnector.java:76)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
at org.eclipse.jetty.server.Server.doStart(Server.java:269)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
at anywheresoftware.b4a.objects.HttpServer.Start(HttpServer.java:56)
at b4a.example.serverservice._service_create(serverservice.java:392)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
... 11 more
*** Service (serverservice) Create ***
2019-12-12 14:59:33.632:INFO::jetty-7.x.y-SNAPSHOT
2019-12-12 14:59:33.671:INFO::started o.e.j.s.ServletContextHandler{/,null}
2019-12-12 14:59:33.678:WARN::FAILED [email protected]:5555 FAILED: java.net.BindException: Address already in use
2019-12-12 14:59:33.679:WARN::FAILED org.eclipse.jetty.server.Server@4cda108: java.net.BindException: Address already in use
serverservice_service_create (java line: 392)
java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:442)
at sun.nio.ch.Net.bind(Net.java:434)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.nio.BlockingChannelConnector.open(BlockingChannelConnector.java:118)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:297)
at org.eclipse.jetty.server.nio.BlockingChannelConnector.doStart(BlockingChannelConnector.java:76)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
at org.eclipse.jetty.server.Server.doStart(Server.java:269)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
at anywheresoftware.b4a.objects.HttpServer.Start(HttpServer.java:56)
at b4a.example.serverservice._service_create(serverservice.java:392)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at b4a.example.serverservice.onCreate(serverservice.java:56)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3532)
at android.app.ActivityThread.access$1300(ActivityThread.java:199)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1666)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
java.lang.RuntimeException: Unable to create service b4a.example.serverservice: java.lang.RuntimeException: java.net.BindException: Address already in use
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3544)
at android.app.ActivityThread.access$1300(ActivityThread.java:199)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1666)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.RuntimeException: java.net.BindException: Address already in use
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:233)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at b4a.example.serverservice.onCreate(serverservice.java:56)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3532)
... 8 more
Caused by: java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:442)
at sun.nio.ch.Net.bind(Net.java:434)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.nio.BlockingChannelConnector.open(BlockingChannelConnector.java:118)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:297)
at org.eclipse.jetty.server.nio.BlockingChannelConnector.doStart(BlockingChannelConnector.java:76)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
at org.eclipse.jetty.server.Server.doStart(Server.java:269)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
at anywheresoftware.b4a.objects.HttpServer.Start(HttpServer.java:56)
at b4a.example.serverservice._service_create(serverservice.java:392)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
... 11 more
 

Ganiadi

Active Member
Licensed User
Longtime User
Hi Erel,
Tks and it's working now after changing the port.
will follow your suggestion and assistance...
 
Upvote 0
Top