B4J Question Exception in thread "main"

uniplan

Active Member
Licensed User
Longtime User
Often when I run an application from the B4J environment I get the following error:

Waiting for debugger to connect...
Exception in thread "main"
java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: java.net.SocketException: Connection reset
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:119)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
at b4j.example.main.<clinit>(main.java:17)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:209)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
at java.io.DataInputStream.readByte(DataInputStream.java:265)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:223)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
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:497)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
... 2 more

On 10 times I throw at least 7/8 times I get this error.

I do not think it's a problem of configuration of the environment because the other times it works. What can it be?
 

Cableguy

Expert
Licensed User
Longtime User
Without a sample roject that throws this error, we cannot help much...
Guessing will not do you any good either, so...
Try to set up a small example, and we will try to help you with it.
 
Upvote 0

uniplan

Active Member
Licensed User
Longtime User
Maybe I expressed myself badly.
The problem occurs for any program I launch. It is not the specific application that goes into error but it is the B4J environment that goes wrong when it starts and I have the message I mentioned earlier.
 
Upvote 0

uniplan

Active Member
Licensed User
Longtime User
Yes, when I launch the application (B4J), for example, by pressing F5, after a few seconds, the message above comes out.
 
Upvote 0

uniplan

Active Member
Licensed User
Longtime User
Yes is the complete error.
I have checked and there are no other instances of B4J running
 
Upvote 0

uniplan

Active Member
Licensed User
Longtime User
I have never noticed in release mode because I use the release mode rarely and only to compile the application.
I've tried 4/5 times now in release mode and it never happened.
The problem presents itself with all my applications and not with one in particular.
 
Upvote 0

uniplan

Active Member
Licensed User
Longtime User
If this can be useful, I also point out that sometimes in "debug mode" the brekpoint are not hooked, meaning that by setting a brekpoint the environment does not stop when the point is reached.
 
Upvote 0

uniplan

Active Member
Licensed User
Longtime User
Is there anything I can do to solve the problem?
The thing is getting very expensive on 10 times that I start debugging at least 8 times the problem occurs.
Thus it becomes very difficult to use B4J
 
Upvote 0

uniplan

Active Member
Licensed User
Longtime User
I'm already doing it and it's much better. However, even on the other computer sometimes the same problem happens.
 
Upvote 0
Top