Android Question java.net.BindException: bind failed: EACCES (Permission denied)

wimpie3

Well-Known Member
Licensed User
Using the HTTP Server library 1.0, I get an EACCES crash.

B4X:
** Activity (main) Create, isFirst = true **
2018-08-13 00:15:26.620:INFO::jetty-7.x.y-SNAPSHOT
2018-08-13 00:15:26.682:INFO::started o.e.j.s.ServletContextHandler{/,null}
2018-08-13 00:15:26.686:WARN::FAILED BlockingChannelConnector@0.0.0.0:80 FAILED: java.net.BindException: bind failed: EACCES (Permission denied)
2018-08-13 00:15:26.687:WARN::FAILED org.eclipse.jetty.server.Server@41d5a030: java.net.BindException: bind failed: EACCES (Permission denied)
main_activity_create (java line: 450)
java.net.BindException: bind failed: EACCES (Permission denied)
    at libcore.io.IoBridge.bind(IoBridge.java:89)
    at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:150)
    at java.net.ServerSocket.bind(ServerSocket.java:319)
    at java.nio.ServerSocketChannelImpl$ServerSocketAdapter.bind(ServerSocketChannelImpl.java:124)
    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.main._activity_create(main.java:450)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:191)
    at b4a.example.main.afterFirstLayout(main.java:104)
    at b4a.example.main.access$000(main.java:17)
    at b4a.example.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:733)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:136)
    at android.app.ActivityThread.main(ActivityThread.java:5017)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:788)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:604)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: libcore.io.ErrnoException: bind failed: EACCES (Permission denied)
    at libcore.io.Posix.bind(Native Method)
    at libcore.io.ForwardingOs.bind(ForwardingOs.java:40)
    at libcore.io.IoBridge.bind(IoBridge.java:87)
    ... 26 more
java.net.BindException: bind failed: EACCES (Permission denied)

Manifest is as follows (target 19, Android 4.4.2):
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="19"/>
<supports-screens android:largeScreens="true" android:hardwareAccelerated="true"
    android:normalScreens="true" 
    android:smallScreens="true" 
    android:anyDensity="true"/>)
   
AddManifestText(<uses-permission 
android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
)
AddManifestText(<uses-permission 
android:name="android.permission.INTERNET" /> 
)
AddManifestText(<uses-permission 
android:name="android.permission.ACCESS_NETWORK_STATE" /> 
)
AddManifestText(<uses-permission 
android:name="android.permission.ACCESS_WIFI_STATE" /> 
)

so all the required permissions are given, right?
 
Top