Bug? Network release build missing b4j.example.main

OliverA

Expert
Licensed User
Longtime User
When building (in either release mode or release (obfuscated) mode) a UI or Non-UI application on a network drive, the b4j.example.main class is missing error would occur on execution. The actual compilation was without error.

This initially occurred to me when I tried to run the ClientKVS code in release mode at which time I received an error message in the log output window of Missing JavaFX application class b4j.example.main. The ClientKVS code was located on my downloads folder that is located on a network drive (via redirection). In order to take folder redirection out of the equation and any other code in ClientKVS that may be the issue, I created a new project via

File->New->UI (JavaFX), added a log statement after the MainForm.Show line in AppStart
B4X:
MainForm.Show
Log("Somewhere over the rainbow")
and saved the project on the "F:" drive, that is a non-redirected network drive. I then compiled the application in Release mode and receive the following log output (compilation went without a hitch):
Missing JavaFX application class b4j.example.main

Creating a Non-UI (Console) app (File->New->Non-UI (Console)) and adding the log line to AppStart and building the application in release mode will result in
Error: Could not find or load main class b4j.example.main

The same log messages are produced in Release (obfuscated) mode. Please note that the applications will run properly in Debug mode.

When repeating the above steps, but saving the projects to the local C:\ drive, everything works as expected. When opening the jars (I'm using 7zip) and comparing them, the network build have the b4j folder missing. I'm attaching the sample files and their builds (so that the produced jars can be examined).

I'm using B4J 5.51 on Windows 10 Pro (64bit) under Parallels (V12 - Pro Edition) in a Windows domain environment (with most of my development going on locally). My path configuration (in order as they are set up) are as follows:
C:\Program Files\Java\jdk1.8.0_131\bin\javac.exe
C:\B4X\B4J\AdditionalLibraries
C:\B4X\B4J\SharedModules
 

Attachments

  • LocalBuilds.zip
    399.3 KB · Views: 271
  • NetworkBuilds.zip
    396.1 KB · Views: 264

jmon

Well-Known Member
Licensed User
Longtime User

jmon

Well-Known Member
Licensed User
Longtime User

OliverA

Expert
Licensed User
Longtime User

First off, I have no clue why I did not find that post on my own. Secondly, I've checked the "file" server using fsutil.exe and it indeed has 8.3 enabled. This is a Windows 2008 server installed by a third party. I checked our newest server (a Windows 2012 box that was installed by the same 3rd party) and even it has 8.3 enabled. I then went ahead and checked my local Windows 10 Pro box and it also has 8.3 enabled. Since my local box has 8.3 enabled and compilation works properly, I'm not quite sure if turning off 8.3 would solve my issue.

By the way, if you are running windows server, the BPA (Best Practive Analyser) should recommend you to disable 8dot3 names if you didn't do it yet:
https://technet.microsoft.com/en-us/library/ff633453(v=ws.10).aspx

Even though I'm have full administrative rights over our servers, I'm disinclined to turn off 8.3 just to see if this fixes my issue. If anything happens to affect any of the operation of these Windows servers, my day/week will be ruined.

Now to the weird part. I can compile the test programs above properly in release mode on the network with the following method:

Clean the project (either through the menu via Tools->Clean project, or through Ctrl+P), wait at least 8 seconds, run project (either through the run icon or by pressing F5).

This gives me a 100% success rate in compiling and running the project. If I wait less than 8 seconds (approximately) or if I skip the clean project step, I get a 100% failure rate in executing the jar file (with the same error messages as given in post #1). I've checked the time synchronization between my box and the server and found no discrepancies. Now I have a workaround, but I'm totally at a loss as to why this is happening and what is causing it. And why do I not have any issues in debug mode?
 

jmon

Well-Known Member
Licensed User
Longtime User
I'm disinclined to turn off 8.3 just to see if this fixes my issue
You could try on a windows 7 computer first before doing it on your server. Turn off the 8dot3 on one partition, create a folder and share it (i.e D:\Temp). Map that folder as a network drive on your other computer (where you have B4J), copy your project there. Then strip the 8dot3 from that partition where you copied the project (that will strip the 8dot3 from all your project files) (make sure you strip from the root i.e : D:\). You will see if it works.

I don't take responsibility for what could happen :), you decide, but in my case, I've never had any problems of file corruption or anything else with those computers:
+ Windows Server 2012 R2 (Previously upgraded from 2008 & 2003)
-> Did that on about 10TB of existing files in less than 15 minutes
+ Windows Server 2012 R2 Fresh Install
-> Did that on about 50TB of existing files (took less than 1 hour)
+ 2 other windows server
+ Windows 7 Ultimate
-> Did that on about 1TB of storage

In some cases I even stopped the process half way to continue later, and that didn't cause problems.

Even Oracle recommends it: https://blogs.oracle.com/ecmarch/al...stalling-webcenter-content-or-weblogic-server

Hope it solves your problem :)

[EDIT] Just tested your example zip files on my remote drives, and no problem, it works. Tested on Windows 7 & Win Server 2012 R2.
 

OliverA

Expert
Licensed User
Longtime User
I'm stubborn and most likely dumb for pursuing this, but here we go:

First update: I originally mentioned that only release and release (obfuscated) were affected. After some more testing, debug mode has the same issues.

Second update: As of the limited testing I have done, it seems to only affect my Windows 2008 servers. Here are some of the results:

These are my machines that have issues:
Windows 2008 server acting as domain controller with 8dot3 enabled on the tested partition
Windows 2008 server acting as hypervisor host for some of my machines with 8dot3 enabled on the tested partition

These are the machines with which I have no issues:
Windows 2008 server (part of domain) that has 8dot3 disabled on tested partition
Windows 2003 server (not part of domain) that has 8dot3 enabled on the tested partition
Windows 2012 server (part of domain) that has 8dot3 enabled on the tested partition
Windows 10 Pro desktop (part of domain) that has 8dot3 enabled on the tested partition

As you can see, in my environment, only 2008 seems to need 8dot3 to be disabled for the jar file to be generated with the main class included. Weird.

On top of that, I found another solution/workaround. If the directory that contains the B4J project file (*.b4j) and any directories BEFORE that adhere to the 8.3 naming convention, everything works as expected.
 

jmon

Well-Known Member
Licensed User
Longtime User
Another issue I got with some other program that needed to write quicktime files, and that could help you:

If I have 2 network drives pointing to the same server i.e S:\ pointing to \\MyServer\Folder1 and X:\ pointing to \\MyServer\Folder2, I could write quicktime files to the first drive (S:\), but not to the second. If I swapped the drive letters, and mounted X:\ to a letter BEFORE S:\ i.e mounting \\MyServer\Folder2 to R:\, I could write quicktime files!

Maybe that could also be a source of the problem you have. There are some really weird problems with windows sometimes.... :)

As you can see, in my environment, only 2008 seems to need 8dot3 to be disabled for the jar file to be generated with the main class included. Weird.
I also think so, in my case I had problems with Windows 7 & Windows Server 2008. Also had a problem with Windows Server 2012 R2 which was upgraded from 2008.
 
Top