B4J Question B4J Bridge and remote debugging

shhammer5634

Member
Licensed User
Longtime User
Configuration:

Development system is Windows 7 + B4J 7.51 + Java 8
Target system Ubuntu 18.04 + Java 8
Target system is a cloud-based VM

Application is non-ui.

I'm having trouble getting Bridge to maintain the connection long enough during the program transfer to the remote system to get the whole program transferred and then started up. It will transfer a random amount of the program and then on the remote system I get a message that says:
"Streams_terminated"
Waiting for connections (port=6790) . . .
My IP address is: (redacted)

Then I start the process again. Sometimes I can get it in the first attempt, sometimes like now it takes me over an hour to get the program up so I can debug it.

My question: Since the program is compiled on my local system first and then transferred, is there a way I can transfer the program over and then initiate debugging once it's there?

All suggestions appreciated.
 

shhammer5634

Member
Licensed User
Longtime User
How do you connect the 2 devices? LAN or internet? What is the connection speed?
Connected over the internet. Speed(theoretical) is 100mb down, 10 mb up. The actual down speed is closer to 60, and the up speed does hover around 10.
 
Upvote 0

shhammer5634

Member
Licensed User
Longtime User
You are not on a Wifi LAN right? If you are over the internet, could it be because you don't have a fixed IP?
No. This development is not taking place over wifi. I have a hard connection to my provider from my development system(s). I don't have a fixed local IP from my provider, but it doesn't change more than once a month. And my cloud server has a fixed IP.
 
Upvote 0

shhammer5634

Member
Licensed User
Longtime User
Are you able to debug the server locally? It will be much easier to debug it locally and then only distribute the program code with B4J-Bridge FTP server feature.

Make sure that #MergeLibraries is set to False. Copy the libs once to the libs folder and then you will only need to upload the small jar file.
Thanks Erel,

Yes I am able to debug locally. I have a local environment set up that mirrors my deployment environment. Locally (local PC with B4J and local vm) it works without issue. But there always seems to be something that crops up after I deploy which is why I like to leave it up and running in the debugger. Makes it easier to locate those little gotchas. I wondered if something like what you mentioned was possible. I'll give it a go asap.

I'm sure you hear it all the time, but thanks for all your hard work. I really appreciate this cross platform development ability.
 
Upvote 0

shhammer5634

Member
Licensed User
Longtime User
Run it in release mode and check the logs.
I have done that, but the error messages in the log are vague enough that I don't have a clue as to where to look when one happens. Example: Null Pointer. From a b4j standpoint it doesn't tell me what sub it was in when it crashed. It might from a java standpoint, but I'm not a java programmer.

I'll get it hashed out. Just trying to speed up my development cycle a bit in this case.
 
Upvote 0

shhammer5634

Member
Licensed User
Longtime User
You are probably catching the error with Try / Catch. Otherwise there should be a full stack trace.

Running it in debug mode for a long time and especially on a far away computer is likely to cause other issues.
No try/catch. I try (no pun intended) not to use that unless I really have to. There is a full stack trace, but unless there is something meaningful enough in the first line of the trace to let me know what it was doing when it crashed the trace doesn't help me.
 
Upvote 0
Top