B4J Question java line 62 error

suciwulans

Active Member
Licensed User
Longtime User

Attachments

  • java error.png
    java error.png
    89.5 KB · Views: 103

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
Right to the start button there is a combos with release/debug. If you select debug instead of showing the java line it will show you the b4x line.

Also please post the logs as text over here. As the error shown only shows half.
 
Upvote 0

suciwulans

Active Member
Licensed User
Longtime User
here the error
2023-08-03 21:37:40.550:INFO::main: Logging initialized @1311ms to org.eclipse.jetty.util.log.StdErrLog
2023-08-03 21:37:41.575:INFO:eek:ejs.Server:main: jetty-9.4.z-SNAPSHOT; built: 2018-05-03T15:56:21.710Z; git: daa59876e6f384329b122929e70a80934569428c; jvm 1.8.0_371-b11
2023-08-03 21:37:42.027:INFO:eek:ejs.session:main: No SessionScavenger set, using defaults
2023-08-03 21:37:42.036:INFO:eek:ejs.session:main: node0 Scavenging every 660000ms
2023-08-03 21:37:42.027:INFO:eek:ejs.session:main: No SessionScavenger set, using defaults
2023-08-03 21:37:42.036:INFO:eek:ejs.session:main: node0 Scavenging every 660000ms
2023-08-03 21:37:42.191:INFO:eek:ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@520a3426{/,file:///C:/Users/Administrator/Downloads/IoTExample/IoTExample/Edison/Objects/www/,AVAILABLE}
2023-08-03 21:37:42.259:INFO:eek:ejs.AbstractNCSARequestLog:main: Opened C:\Users\Administrator\Downloads\IoTExample\IoTExample\Edison\Objects\logs\b4j-2023_08_04.request.log
main._appstart (java line: 72)
java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:438)
at sun.nio.ch.Net.bind(Net.java:430)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:225)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:340)
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:308)
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:244)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.server.Server.doStart(Server.java:398)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at anywheresoftware.b4j.object.ServerWrapper.Start(ServerWrapper.java:220)
at b4j.example.main._appstart(main.java:72)
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 anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at b4j.example.main.main(main.java:28)
main.main (java line: 28)
java.lang.RuntimeException: java.net.BindException: Address already in use: bind
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:140)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at b4j.example.main.main(main.java:28)
Caused by: java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:438)
at sun.nio.ch.Net.bind(Net.java:430)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:225)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:340)
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:308)
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:244)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.server.Server.doStart(Server.java:398)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at anywheresoftware.b4j.object.ServerWrapper.Start(ServerWrapper.java:220)
at b4j.example.main._appstart(main.java:72)
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 anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
... 2 more
 
Upvote 0

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
java.net.BindException: Address already in use: bind
this error says that the port you are trying to use is already occupied.
but i don't think thats the error you are trying to solve, may be you left an example open.

try:
to kill all java proccess and run again.
change the port that is being used.
 
Upvote 0

teddybear

Well-Known Member
Licensed User
Upvote 0

suciwulans

Active Member
Licensed User
Longtime User
this error says that the port you are trying to use is already occupied.
but i don't think thats the error you are trying to solve, may be you left an example open.

try:
to kill all java proccess and run again.
change the port that is being used.
MQTT port : 1883
Websocket port: 9001
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
I'm confused, there are two different errors.

In the first post the error is UnsatisfiedLinkError, then later in the log it's BindException: Address already in use.

Has the first error been solved?
 
Upvote 0

suciwulans

Active Member
Licensed User
Longtime User
I'm confused, there are two different errors.

In the first post the error is UnsatisfiedLinkError, then later in the log it's BindException: Address already in use.

Has the first error been solved?i cannot fix error si modifued source code but i have got another error.
 
Upvote 0

suciwulans

Active Member
Licensed User
Longtime User
This error happens when you run multiple instances of a server and the port is already opened:

java.net.BindException: Address already in use: bind
I compiled the soruce code again. I cannit click Button kill process because the button not enabled
 
Upvote 0

suciwulans

Active Member
Licensed User
Longtime User
i got this error
2023-08-14 21:02:29.510:INFO::main: Logging initialized @1313ms to org.eclipse.jetty.util.log.StdErrLog
2023-08-14 21:02:30.632:INFO:eek:ejs.Server:main: jetty-9.4.z-SNAPSHOT; built: 2018-05-03T15:56:21.710Z; git: daa59876e6f384329b122929e70a80934569428c; jvm 1.8.0_371-b11
2023-08-14 21:02:31.054:INFO:eek:ejs.session:main: DefaultSessionIdManager workerName=node0
2023-08-14 21:02:31.055:INFO:eek:ejs.session:main: No SessionScavenger set, using defaults
2023-08-14 21:02:31.064:INFO:eek:ejs.session:main: node0 Scavenging every 660000ms
mqtt_connected: true
2023-08-14 21:02:31.285:INFO:eek:ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@520a3426{/,file:///C:/Users/Administrator/Downloads/IoTExample/IoTExample/Edison/Objects/www/,AVAILABLE}
2023-08-14 21:02:31.303:INFO:eek:ejs.AbstractNCSARequestLog:main: Opened C:\Users\Administrator\Downloads\IoTExample\IoTExample\Edison\Objects\logs\b4j-2023_08_15.request.log
2023-08-14 21:02:31.480:INFO:eek:ejs.AbstractConnector:main: Started ServerConnector@5bc79255{HTTP/1.1,[http/1.1]}{0.0.0.0:51042}
2023-08-14 21:02:31.481:INFO:eek:ejs.Server:main: Started @3291ms
java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (Map).
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:140)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at anywheresoftware.b4j.object.WebSocketModule$Adapter$ThreadHandler.run(WebSocketModule.java:188)
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:750)
Caused by: java.lang.RuntimeException: Object should first be initialized (Map).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:49)
at anywheresoftware.b4a.objects.collections.Map.getSize(Map.java:138)
at anywheresoftware.b4a.objects.collections.Map$IterableMap.getSize(Map.java:178)
at b4j.example.websocketmodule._update(websocketmodule.java:64)
at b4j.example.websocketmodule._websocket_connected(websocketmodule.java:102)
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 anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
... 7 more

the on browser toggle switch not shown on web
 

Attachments

  • error.png
    error.png
    9.7 KB · Views: 97
Upvote 0
Top