B4J Question [SOLVED] [ABM] How to run compiled jar file made with ABM in Windows?

incendio

Well-Known Member
Licensed User
Longtime User
Hi guys,

I am not using ABM for a long time.

Usually I ran in under Ubuntu with these method :
1. copied directory www from my development pc to home directory in Ubuntu
2. copied compiled jar file and copymewithjar.needs fie to home directory in Ubuntu
3. ran java -jar compiled.jar

It ran OK without problems. Now tried same method, but this time ran in windows, got errors:

abmapplication._vvvvvv5 (java line: 41)
java.lang.NullPointerException
at java.io.File.<init>(Unknown Source)
at com.ab.abmaterial.ABMaterial.CheckApp(Unknown Source)
at com.ab.abmaterial.ABMaterial.WritePageToDisk(Unknown Source)
at com.ab.template.abmapplication._vvvvvv5(abmapplication.java:41)
at com.ab.template.abmserver._vvvvvv5(abmserver.java:49)
at com.ab.template.main._appstart(main.java:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:109)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:96)
at com.ab.template.main.main(main.java:28)


How to fix that?

Thanks in advance.
 

DonManfred

Expert
Licensed User
Longtime User
How to fix that?
You are giving exactly ZERO Information which could help. Start with providing these infos. The Code used for example.
 
Last edited:
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
I would first try to run it non-obfuscated so you know what '_vvvvvv5' is. Maybe some folder is write protected?
Here are the errors after compiled non-obfuscated :

abmapplication._addpage (java line: 41)
java.lang.NullPointerException
at java.io.File.<init>(Unknown Source)
at com.ab.abmaterial.ABMaterial.CheckApp(Unknown Source)
at com.ab.abmaterial.ABMaterial.WritePageToDisk(Unknown Source)
at com.ab.template.abmapplication._addpage(abmapplication.java:41)
at com.ab.template.abmserver._addpage(abmserver.java:49)
at com.ab.template.main._appstart(main.java:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:109)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:96)
at com.ab.template.main.main(main.java:28)

Compiled jar file was located in directory d:\data\cr\object.

If I ran this compiled jar directly from this directory, it run OK, but when I copied the contents of d:\data\cr\object to drive H, it gave those errors.

The list of drive H are :
1. compiled jar file
2. copymewithjar.needs file
3. keystore.jks
3. directory of www

That's what I done on Ubuntu server, and it ran OK, but not on Windows. Where did I missing here?
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
Please post the complete log file (use code tags or upload as a file). The java.io.File error looks like it is unable to read or write a file and maybe the logs before the error can show where it was in the code.
Found the problem !

Drive H is a RAMDisk, use for a temporary disk in Windows. When all files copied to a real disk, it ran OK.

So compiled java file can run from a RAMDisk?
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
Correction, sorry, it seem that it was not RAMDisk problem!

Tested again on RAMDisk, made a dir H:\ABM, copied all files and www directory to this folder, run jar file from this folder, and it ran OK.

Copied again all files and www directory to a root disk on drive D (this is the real drive), same error raised again.

Seem that the compiled jar file can't run from root directory.
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
That could make sense. ABM will search if the B4J source code files are available to analyse, and those are located one level below (parent) where the jar is. If it is in the root, this call will fail.
So this is intentionally?
No problem, I will not put ABM's jar file in root directory then.
 
Upvote 0
Top