Project

General

Profile

Bug #11678

Improve FWD support on Windows

Added by Teodor Gorghe 2 months ago. Updated 4 days ago.

Status:
Review
Priority:
Normal
Assignee:
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
production:
No
env_name:
topics:

hotel_gui_win.patch Magnifier (105 KB) Teodor Gorghe, 08/07/2026 10:16 AM

hotel_win.patch Magnifier (107 KB) Teodor Gorghe, 08/14/2026 02:26 AM


Related issues

Related to Runtime Infrastructure - Bug #10609: FWD compilation issues on Windows New
Related to Conversion Tools - Bug #11266: Filename of extension too long in Windows during import New

History

#1 Updated by Teodor Gorghe 2 months ago

Currently, FWD compiles without any change, but only with a specific version of mingw gcc version (4.9.0, from 2015), old version of libffi and msys.

The issues are the following:
  • make utility needs to choose which shell to use. Since it was prioritized to use GNU utilities, it will search for sh first and if not found, it will use the shell (cmd.exe). FWD fails to build with sh.exe make because in the make file, files paths are mixed (Z:\trunk/src/native needs to be Z:/trunk/src/native works both on sh.exe and cmd.exe shell).
  • buildadmin task fails on network drives: systemProperty('gwt.watchFileChanges', 'false') needs to added to disable GWT file changes scan.

After I make the changes for FWD to fully build on Windows, I will document the updated steps, which will be: download msys2, install dependencies for FWD using one command (msys2 uses a package manager), no need for adjusting PATH var.

Eugenie told in the about this:

Some considerations. I think we need to consider the case when consumer of the Windows building do not know anything about Linux (and even do not even want to know). So the Windows installation should be completely within Windows style standards.

On Windows, usually, users uses prebuilt binaries. In our case, the zip files generated by ant dist is enough, but our sample project is highly coupled with FWD source code.
Standard way to build apps on Windows is using msvc compiler, which comes bundled in Visual Studio Build Tools, but the project sample is a format generated by VS IDE, called solution (vsproject files).
The alternative is using GNU tools, which we are at right now, and I think it is the best way because we stay independent from IDE build environments.

#2 Updated by Șerban Bursuc 2 months ago

  • Related to Bug #10609: FWD compilation issues on Windows added

#3 Updated by Șerban Bursuc 2 months ago

  • Related to Bug #11266: Filename of extension too long in Windows during import added

#4 Updated by Șerban Bursuc 2 months ago

#11266 is the biggest issue right now - Hotel GUI only compiles if placed in C:\h now. A few months ago it could compile under C:\hotel. At this pace in a short amount of time FWD won't be able to compile at all.

#5 Updated by Eugenie Lyzenko 2 months ago

Teodor Gorghe wrote:

Currently, FWD compiles without any change, but only with a specific version of mingw gcc version (4.9.0, from 2015), old version of libffi and msys.

The recent binaries are also available here: https://www.mingw-w64.org/downloads/, some countries need VPN to access this. I used the revision 15.2.0 installed 6 month ago and FWD is building fine. But on my systems nether *.ps1 work correct. Is there a serious reason we drop using *.CMD and prefer PowerShell?

#6 Updated by Eugenie Lyzenko 2 months ago

I'm still have no running Hotel server on Windows:

26/07/31 14:02:02.568-0700 | WARNING | com.goldencode.p2j.main.ServerDriver | ThreadName:main | The default character set is windows-1252, but currently only UTF-8 is supported.
26/07/31 14:02:02.568-0700 |    INFO | com.goldencode.p2j.main.StandardServer | ThreadName:main | FWD v4.0.0_p2j_trunk_16681 Server starting initialization.
26/07/31 14:02:02.568-0700 |    INFO | com.goldencode.p2j.main.StandardServer | ThreadName:main | ServerDriver: 4 arguments =_   [_      'server.xml',_      'net:connection:secure=true',_      'net:server:secure_port=3333',_      'net:server:insecure_port=3433'_   ]_   Product Version FWD v4.0.0_p2j_trunk_16681_   JVM Version 17.0.18_   JVM Memory: free = 506691016; total = 536870912; max = 8589934592;_   JVM Available CPUs: 8_   JVM Properties =_   {_      java.specification.version = '17',_      sun.cpu.isalist = 'amd64',_      sun.jnu.encoding = 'Cp1252',_      java.class.path = 'c:\opt\hotel_gui\deploy\lib\fwdspi.jar;c:\opt\hotel_gui\deploy\lib\hotel.jar;c:\opt\hotel_gui\deploy\lib\p2j.jar;c:\opt\hotel_gui\deploy\lib\fwdaopltw.jar;',_      java.vm.vendor = 'Oracle Corporation',_      sun.arch.data.model = '64',_      user.variant = '',_      java.vendor.url = 'https://java.oracle.com/',_      user.timezone = 'America/Los_Angeles',_      java.vm.specification.version = '17',_      os.name = 'Windows 10',_      sun.java.launcher = 'SUN_STANDARD',_      user.country = 'US',_      sun.boot.library.path = 'C:\jdk17\bin',_      sun.java.command = 'com.goldencode.p2j.main.ServerDriver server.xml net:connection:secure=true net:server:secure_port=3333 net:server:insecure_port=3433',_      jdk.debug = 'release',_      sun.cpu.endian = 'little',_      user.home = 'C:\Users\evl',_      user.language = 'en',_      java.specification.vendor = 'Oracle Corporation',_      java.version.date = '2026-01-20',_      java.home = 'C:\jdk17',_      file.separator = '\',_      java.vm.compressedOopsMode = 'Zero based',_      line.separator = '__',_      java.vm.specification.vendor = 'Oracle Corporation',_      java.system.class.loader = 'com.goldencode.p2j.classloader.MultiClassLoader',_      java.specification.name = 'Java Platform API Specification',_      user.script = '',_      sun.management.compiler = 'HotSpot 64-Bit Tiered Compilers',_      java.locale.provider = 'SPI,CLDR,COMPAT',_      java.runtime.version = '17.0.18+8-LTS-264',_      user.name = 'evl',_      path.separator = ';',_      os.version = '10.0',_      java.runtime.name = 'Java(TM) SE Runtime Environment',_      file.encoding = 'Cp1252',_      java.vm.name = 'Java HotSpot(TM) 64-Bit Server VM',_      java.vendor.url.bug = 'https://bugreport.java.com/bugreport/',_      java.io.tmpdir = 'C:\Users\evl\AppData\Local\Temp\',_      java.version = '17.0.18',_      user.dir = 'C:\opt\hotel_gui\deploy\server',_      os.arch = 'amd64',_      java.vm.specification.name = 'Java Virtual Machine Specification',_      sun.os.patch.level = '',_      native.encoding = 'Cp1252',_      java.library.path = '../lib/',_      java.vm.info = 'mixed mode, sharing',_      java.vendor = 'Oracle Corporation',_      java.vm.version = '17.0.18+8-LTS-264',_      ANTLR_USE_DIRECT_CLASS_LOADING = 'true',_      java.specification.maintenance.version = '1',_      sun.io.unicode.encoding = 'UnicodeLittle',_      java.class.version = '61.0'_   }_   JVM Environment =_   {_      USERDOMAIN_ROAMINGPROFILE = 'DESKTOP-IQGBAQQ',_      PROCESSOR_LEVEL = '6',_      SESSIONNAME = 'Console',_      ALLUSERSPROFILE = 'C:\ProgramData',_      PROCESSOR_ARCHITECTURE = 'AMD64',_      PSModulePath = 'C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules',_      SystemDrive = 'C:',_      ANT_OPTS = '"-Xmx4g"',_      USERNAME = 'evl',_      ProgramFiles(x86) = 'C:\Program Files (x86)',_      FPS_BROWSER_USER_PROFILE_STRING = 'Default',_      PATHEXT = '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC',_      DriverData = 'C:\Windows\System32\Drivers\DriverData',_      test = 'n',_      spi = '-Djava.locale.provider=SPI,CLDR,COMPAT -Djava.library.path=../lib/',_      ProgramData = 'C:\ProgramData',_      ProgramW6432 = 'C:\Program Files',_      HOMEPATH = '\Users\evl',_      PROCESSOR_IDENTIFIER = 'Intel64 Family 6 Model 158 Stepping 13, GenuineIntel',_      ProgramFiles = 'C:\Program Files',_      PUBLIC = 'C:\Users\Public',_      usage[15] = '-b      = launch a program associated with a process account',_      windir = 'C:\WINDOWS',_      pwd = 'C:\opt\hotel_gui',_      =:: = '::\',_      fspawn = 'C:\opt\hotel_gui\deploy\spawner',_      LOCALAPPDATA = 'C:\Users\evl\AppData\Local',_      USERDOMAIN = 'DESKTOP-IQGBAQQ',_      FPS_BROWSER_APP_PROFILE_STRING = 'Internet Explorer',_      LOGONSERVER = '\\DESKTOP-IQGBAQQ',_      JAVA_HOME = 'C:\jdk17',_      PROMPT = '$P$G',_      serverCmd = '"java -Xmx8192m -server   @classes.txt -Djava.locale.provider=SPI,CLDR,COMPAT -Djava.library.path=../lib/ -XX:GCTimeRatio=19 -XX:MaxTenuringThreshold=7 -XX:StringTableSize=1000003 --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.naming/javax.naming=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED -Djava.system.class.loader=com.goldencode.p2j.classloader.MultiClassLoader com.goldencode.p2j.main.ServerDriver   server.xml net:connection:secure=true net:server:secure_port=3333 net:server:insecure_port=3433 1>stdout.log 2>server.log"',_      statcode = 'n',_      ANT_HOME = 'C:\ant11015',_      OneDrive = 'C:\Users\evl\OneDrive',_      =C: = 'C:\opt\hotel_gui\deploy\server',_      APPDATA = 'C:\Users\evl\AppData\Roaming',_      open_api = '--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.naming/javax.naming=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED',_      perf = '-XX:GCTimeRatio=19 -XX:MaxTenuringThreshold=7 -XX:StringTableSize=1000003',_      CommonProgramFiles = 'C:\Program Files\Common Files',_      Path = 'C:\jdk17\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\jdk17\bin;C:\jdk17\bin\server;C:\ant11015\bin;C:\Program Files\jEdit;C:\WINDOWS\System32\OpenSSH\;C:\mingw64\bin;C:\Program Files (x86)\Bazaar;C:\Users\evl\AppData\Local\Microsoft\WindowsApps;',_      OS = 'Windows_NT',_      COMPUTERNAME = 'DESKTOP-IQGBAQQ',_      PROCESSOR_REVISION = '9e0d',_      CommonProgramW6432 = 'C:\Program Files\Common Files',_      ComSpec = 'C:\WINDOWS\system32\cmd.exe',_      SystemRoot = 'C:\WINDOWS',_      TEMP = 'C:\Users\evl\AppData\Local\Temp',_      HOMEDRIVE = 'C:',_      USERPROFILE = 'C:\Users\evl',_      TMP = 'C:\Users\evl\AppData\Local\Temp',_      CommonProgramFiles(x86) = 'C:\Program Files (x86)\Common Files',_      NUMBER_OF_PROCESSORS = '8'_   }
26/07/31 14:02:02.568-0700 |    INFO | com.goldencode.p2j.main.StandardServer | ThreadName:main | BootstrapConfig sharedFile = server.xml; privateFile = none; isServer = true; configuraton values =_   {_      NET:ROUTER:THREADS = 2_      NET:CONNECTION:SECURE = true_      NET:SERVER:SECURE_PORT = 3333_      NET:SERVER:INSECURE_PORT = 3433_      SECURITY:SERVER:ID = standard_      DIRECTORY:BACKEND:TYPE = xml_      DIRECTORY:XML:FILENAME = directory.xml_      DIRECTORY:XML:MUST_EXIST = true_   }
26/07/31 14:02:02.568-0700 | WARNING | com.goldencode.p2j.security.SecurityCache | ThreadName:main | No custom server extension defined in P2J directory
26/07/31 14:02:02.568-0700 | WARNING | com.goldencode.p2j.security.SecurityCache | ThreadName:main | No custom client extension defined in P2J directory
26/07/31 14:02:02.568-0700 | WARNING | com.goldencode.p2j.security.SecurityCache | ThreadName:main | Security audit log is disabled
26/07/31 14:02:02.568-0700 |    INFO | com.goldencode.p2j.util.logging.CentralLoggerServer | ThreadName:main, ThreadId:00000003, User:standard | Configs received: com.goldencode.p2j.util.logging.CentralLoggerServer$Configs isServerSide: false, hasConsole: false, filePath: c:/opt/hotel_gui/deploy/logs/fwd_%m_%tY%tm%td_%tH%tM%tS_%uos_%pid_%uf_%g.log, level: INFO, fileLimit: 500000, fileCount: 4. WRITE_TO_SLF4J_API: false
26/07/31 14:02:02.568-0700 |    INFO | com.goldencode.p2j.main.StandardServer | ThreadName:main, ThreadId:00000003, User:standard | No exported entry points defined in the P2J directory
26/07/31 14:02:02.791-0700 |    INFO | com.goldencode.p2j.schema.SchemaConfig | ThreadName:main, ThreadId:00000003, User:standard | Using default schema profile.
26/07/31 14:02:03.662-0700 |    INFO | org.reflections.Reflections | ThreadName:main, ThreadId:00000003, User:standard | Reflections took 56 ms to scan 1 urls, producing 10 keys and 24 values
26/07/31 14:02:03.717-0700 |    INFO | org.reflections.Reflections | ThreadName:main, ThreadId:00000003, User:standard | Reflections took 0 ms to scan 1 urls, producing 4 keys and 4 values
26/07/31 14:02:03.736-0700 |    INFO | org.reflections.Reflections | ThreadName:main, ThreadId:00000003, User:standard | Reflections took 19 ms to scan 1 urls, producing 8 keys and 10 values
26/07/31 14:02:03.756-0700 |    INFO | org.reflections.Reflections | ThreadName:main, ThreadId:00000003, User:standard | Reflections took 20 ms to scan 1 urls, producing 10 keys and 29 values
26/07/31 14:02:03.903-0700 |    INFO | org.reflections.Reflections | ThreadName:main, ThreadId:00000003, User:standard | Reflections took 131 ms to scan 1 urls, producing 265 keys and 1302 values
26/07/31 14:02:04.421-0700 |    INFO | org.reflections.Reflections | ThreadName:main, ThreadId:00000003, User:standard | Reflections took 0 ms to scan 1 urls, producing 14 keys and 29 values
26/07/31 14:02:04.439-0700 |    INFO | org.reflections.Reflections | ThreadName:main, ThreadId:00000003, User:standard | Reflections took 18 ms to scan 1 urls, producing 6 keys and 17 values
26/07/31 14:02:04.439-0700 |    INFO | org.reflections.Reflections | ThreadName:main, ThreadId:00000003, User:standard | Reflections took 0 ms to scan 1 urls, producing 16 keys and 60 values
26/07/31 14:02:04.513-0700 |    INFO | org.reflections.Reflections | ThreadName:main, ThreadId:00000003, User:standard | Reflections took 18 ms to scan 1 urls, producing 37 keys and 186 values
26/07/31 14:02:04.570-0700 |    INFO | org.reflections.Reflections | ThreadName:main, ThreadId:00000003, User:standard | Reflections took 0 ms to scan 1 urls, producing 2 keys and 26 values
26/07/31 14:02:04.719-0700 |    INFO | org.reflections.Reflections | ThreadName:main, ThreadId:00000003, User:standard | Reflections took 149 ms to scan 1 urls, producing 473 keys and 2207 values
26/07/31 14:02:05.273-0700 |    INFO | org.reflections.Reflections | ThreadName:main, ThreadId:00000003, User:standard | Reflections took 110 ms to scan 1 urls, producing 362 keys and 1561 values
26/07/31 14:02:05.589-0700 |    INFO | org.reflections.Reflections | ThreadName:main, ThreadId:00000003, User:standard | Reflections took 0 ms to scan 1 urls, producing 37 keys and 78 values
26/07/31 14:02:05.626-0700 |    INFO | org.reflections.Reflections | ThreadName:main, ThreadId:00000003, User:standard | Reflections took 19 ms to scan 1 urls, producing 29 keys and 116 values
26/07/31 14:02:05.626-0700 | WARNING | com.goldencode.p2j.convert.MatchPhraseDictionary | ThreadName:main, ThreadId:00000003, User:standard | Could not find match phrase list!
26/07/31 14:02:06.126-0700 | WARNING | com.goldencode.artifacts.ArtifactManager | ThreadName:main, ThreadId:00000003, User:standard | No files found in the file set.
26/07/31 14:02:06.960-0700 |    INFO | com.goldencode.p2j.persist.ConversionPool | ThreadName:main, ThreadId:00000003, User:standard | Runtime conversion pool initialized in 4188 ms.
26/07/31 14:02:06.960-0700 | WARNING | com.goldencode.p2j.scheduler.Scheduler [Scheduler.initialize()] | ThreadName:main, ThreadId:00000003, User:standard | No scheduler configured.
26/07/31 14:02:07.016-0700 |    INFO | com.goldencode.p2j.persist.TemporaryDatabaseManager | ThreadName:main, ThreadId:00000003, User:standard | Using public (shared) temporary database.
26/07/31 14:02:07.016-0700 |    INFO | com.goldencode.p2j.persist.DatabaseManager | ThreadName:main, ThreadId:00000003, User:standard | Using H2 database version 1.4.200 (2019-10-14)
26/07/31 14:02:07.145-0700 |    INFO | com.goldencode.p2j.persist.meta.MetadataManager | ThreadName:main, ThreadId:00000003, User:standard | Metadata server modules: [Myconnection, Connect, Index, DatabaseFeature, Sequence, FieldTrig, Lock, Field, Area, Usertablestat, Tenant, Filelist, FileTrig, Tablestat, File, Trans, IndexField, Startup, Db]
26/07/31 14:02:07.623-0700 |  SEVERE | com.goldencode.p2j.persist.dialect.H2Helper | ThreadName:main, ThreadId:00000003, User:standard | Error setting FWD-specific collation;  please ensure 'fwdspi.jar' is installed in Java extension directory
26/07/31 14:02:07.623-0700 |  SEVERE | com.goldencode.p2j.main.CommonDriver | ThreadName:main, ThreadId:00000003, User:standard | System exits with code -13 caused by:
com.goldencode.p2j.cfg.ConfigurationException: Failed to initialize hook com.goldencode.p2j.main.StandardServer$7
    at com.goldencode.p2j.main.ServerHookManager.hookInitialize(ServerHookManager.java:170)
    at com.goldencode.p2j.main.StandardServer.bootstrap(StandardServer.java:1218)
    at com.goldencode.p2j.main.ServerDriver.start(ServerDriver.java:566)
    at com.goldencode.p2j.main.CommonDriver.process(CommonDriver.java:522)
    at com.goldencode.p2j.main.ServerDriver.process(ServerDriver.java:233)
    at com.goldencode.p2j.main.ServerDriver.main(ServerDriver.java:1062)
Caused by: java.lang.RuntimeException: Error initializing persistence services for database 'hotel'.
    at com.goldencode.p2j.persist.Persistence.initializeTenant(Persistence.java:4279)
    at com.goldencode.p2j.persist.Persistence.<init>(Persistence.java:1034)
    at com.goldencode.p2j.persist.PersistenceFactory.getInstance(PersistenceFactory.java:193)
    at com.goldencode.p2j.persist.meta.LockTableUpdater.<init>(LockTableUpdater.java:198)
    at com.goldencode.p2j.persist.DatabaseManager.initDb(DatabaseManager.java:1902)
    at com.goldencode.p2j.persist.DatabaseManager.initialize(DatabaseManager.java:1730)
    at com.goldencode.p2j.persist.Persistence.initialize(Persistence.java:1088)
    at com.goldencode.p2j.main.StandardServer$7.initialize(StandardServer.java:1481)
    at com.goldencode.p2j.main.ServerHookManager.hookInitialize(ServerHookManager.java:147)
    ... 5 more
Caused by: com.goldencode.p2j.persist.PersistenceException: Error initializing embedded database
Caused by: org.h2.jdbc.JdbcSQLDataException: Invalid value "en_US_iso88591_fwd_basic" for parameter "collation"; SQL statement:
set collation "en_US_iso88591_fwd_basic" [90008-200]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:590)
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:429)
    at org.h2.message.DbException.get(DbException.java:205)
    at org.h2.message.DbException.getInvalidValueException(DbException.java:280)
    at org.h2.command.Parser.parseSetCollation(Parser.java:7427)
    at org.h2.command.Parser.parseSet(Parser.java:7197)
    at org.h2.command.Parser.parsePrepared(Parser.java:989)
    at org.h2.command.Parser.parse(Parser.java:848)
    at org.h2.command.Parser.parse(Parser.java:820)
    at org.h2.command.Parser.prepareCommand(Parser.java:753)
    at org.h2.engine.Session.prepareLocal(Session.java:669)
    at org.h2.engine.Session.prepareCommand(Session.java:606)
    at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1260)
    at org.h2.jdbc.JdbcStatement.executeUpdateInternal(JdbcStatement.java:164)
    at org.h2.jdbc.JdbcStatement.executeBatch(JdbcStatement.java:768)
    at com.goldencode.p2j.persist.dialect.H2Helper.executeDDL(H2Helper.java:626)
    at com.goldencode.p2j.persist.dialect.H2Helper.prepareDatabase(H2Helper.java:290)
    at com.goldencode.p2j.persist.Persistence.initializeTenant(Persistence.java:4263)
    at com.goldencode.p2j.persist.Persistence.<init>(Persistence.java:1034)
    at com.goldencode.p2j.persist.PersistenceFactory.getInstance(PersistenceFactory.java:193)
    at com.goldencode.p2j.persist.meta.LockTableUpdater.<init>(LockTableUpdater.java:198)
    at com.goldencode.p2j.persist.DatabaseManager.initDb(DatabaseManager.java:1902)
    at com.goldencode.p2j.persist.DatabaseManager.initialize(DatabaseManager.java:1730)
    at com.goldencode.p2j.persist.Persistence.initialize(Persistence.java:1088)
    at com.goldencode.p2j.main.StandardServer$7.initialize(StandardServer.java:1481)
    at com.goldencode.p2j.main.ServerHookManager.hookInitialize(ServerHookManager.java:147)
    at com.goldencode.p2j.main.StandardServer.bootstrap(StandardServer.java:1218)
    at com.goldencode.p2j.main.ServerDriver.start(ServerDriver.java:566)
    at com.goldencode.p2j.main.CommonDriver.process(CommonDriver.java:522)
    at com.goldencode.p2j.main.ServerDriver.process(ServerDriver.java:233)
    at com.goldencode.p2j.main.ServerDriver.main(ServerDriver.java:1062)

This is Windows 10 in VirtualBox. Note exotic line.separator value in log file. It is neither \r\n not \n.

#7 Updated by Eugenie Lyzenko 2 months ago

Small update. The server is starting with explicit command:

java -XX:+HeapDumpOnOutOfMemoryError -XX:GCTimeRatio=19 -XX:MaxTenuringThreshold=7 -XX:StringTableSize=1000003  -Xmx8192m -server    -Djava.locale.providers=SPI,CLDR,COMPAT --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.naming/javax.naming=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED -classpath ../lib/p2j.jar;../lib/hotel.jar;../lib/fwdspi.jar;../lib/fwdaopltw.jar com.goldencode.p2j.main.FwdLauncher   server.xml net:connection:secure=true net:server:secure_port=3333 net:server:insecure_port=3433

While the Swing client does not work:

...
26/07/31 16:17:04.987-0700 |   FINER | com.goldencode.p2j.net.SessionManager [SessionManager.createQueue()] | PID:2584, ThreadName:main-evl | host = localhost; port = 3333; secure = true;
26/07/31 16:17:05.110-0700 |  SEVERE | com.goldencode.p2j.main.ClientCore | PID:2584, ThreadName:main-evl | The client stopped working throwing an unexpected exception:
java.net.SocketException: Socket is closed
    at java.base/sun.security.ssl.SSLSocketImpl.getOutputStream(SSLSocketImpl.java:1234)
    at com.goldencode.p2j.net.NetSocketWrapper.<init>(NetSocketWrapper.java:132)
    at com.goldencode.p2j.net.NetSocket$1.create(NetSocket.java:120)
    at com.goldencode.p2j.net.SessionManager.connect(SessionManager.java:1345)
    at com.goldencode.p2j.net.SessionManager.createQueue(SessionManager.java:1206)
    at com.goldencode.p2j.net.LeafSessionManager.connectDirect(LeafSessionManager.java:256)
    at com.goldencode.p2j.net.SessionManager.connectDirect(SessionManager.java:713)
    at com.goldencode.p2j.main.ClientCore.initialize(ClientCore.java:329)
    at com.goldencode.p2j.main.ClientCore.start(ClientCore.java:550)
    at com.goldencode.p2j.main.ClientDriver.start(ClientDriver.java:293)
    at com.goldencode.p2j.main.CommonDriver.process(CommonDriver.java:522)
    at com.goldencode.p2j.main.ClientDriver.process(ClientDriver.java:175)
    at com.goldencode.p2j.main.ClientDriver.main(ClientDriver.java:381)
26/07/31 16:17:05.111-0700 |  SEVERE | com.goldencode.p2j.main.CommonDriver | PID:2584, ThreadName:main-evl | System exits with code -13 caused by:
java.lang.NullPointerException: Cannot invoke "com.goldencode.p2j.main.MainEntry.standardEntry(String)" because "is.main" is null
    at com.goldencode.p2j.main.ClientCore.start(ClientCore.java:553)
    at com.goldencode.p2j.main.ClientDriver.start(ClientDriver.java:293)
    at com.goldencode.p2j.main.CommonDriver.process(CommonDriver.java:522)
    at com.goldencode.p2j.main.ClientDriver.process(ClientDriver.java:175)
    at com.goldencode.p2j.main.ClientDriver.main(ClientDriver.java:381)

#8 Updated by Teodor Gorghe 2 months ago

I have started doing some small fixes.

Currently, the changes are not being committed, because I have a small thing which needs to be addressed, regarding automatic resolution of jvm.dll dependency.

On newer JDK (17+), that jvm.dll comes from JAVA_HOME\bin\server. In our build script, we use JAVA_HOME\lib\server, which is the path for linux based system. We use dynamic linking spawn.exe, which is required to add a PATH var entry to find this jvm.dll. I am trying to add this automatically in ClientSpawner or find a more elegant solution to that.

I have some fixes for the Windows scripts in the hotel_gui project, which I will commit soon.

#9 Updated by Teodor Gorghe 2 months ago

Eugenie Lyzenko wrote:

Small update. The server is starting with explicit command:

[...]

While the Swing client does not work:

[...]

I think the missing -Djava.library.path=../lib might be the culprit here.

#10 Updated by Eugenie Lyzenko 2 months ago

Teodor Gorghe wrote:

I have started doing some small fixes.

Currently, the changes are not being committed, because I have a small thing which needs to be addressed, regarding automatic resolution of jvm.dll dependency.

On newer JDK (17+), that jvm.dll comes from JAVA_HOME\bin\server. In our build script, we use JAVA_HOME\lib\server, which is the path for linux based system. We use dynamic linking spawn.exe, which is required to add a PATH var entry to find this jvm.dll. I am trying to add this automatically in ClientSpawner or find a more elegant solution to that.

I have some fixes for the Windows scripts in the hotel_gui project, which I will commit soon.

Note for Windows we instruct to directly put jvm.dll on the Windows system path while set up JDK for Windows OS.

#11 Updated by Teodor Gorghe 2 months ago

Attaching the hotel_gui_win.patch which is needed since most of the Windows scripts are not working.

Also, committed the changes for FWD to work better on Windows, on 11678/r16694.

#12 Updated by Teodor Gorghe 2 months ago

  • % Done changed from 0 to 100
  • reviewer Eugenie Lyzenko added

Eugenie, please review the changes in the 11678a/r16694 and the ones for hotel_gui, attached in #11678-11.
It improves FWD compilation on Windows and also makes the setup easy for hotel_gui, like on linux equivalent. It shouldn't break your environment.

#13 Updated by Teodor Gorghe 2 months ago

  • Status changed from New to WIP

#14 Updated by Teodor Gorghe 2 months ago

  • Assignee set to Teodor Gorghe
  • Status changed from WIP to Review

#15 Updated by Eugenie Lyzenko 2 months ago

Teodor Gorghe wrote:

Eugenie, please review the changes in the 11678a/r16694 and the ones for hotel_gui, attached in #11678-11.
It improves FWD compilation on Windows and also makes the setup easy for hotel_gui, like on linux equivalent. It shouldn't break your environment.

What about 11678a revision 16695? Also need to be reviewed?

#16 Updated by Teodor Gorghe 2 months ago

Yes, 11678a/r16695 needs to be reviewed.

#17 Updated by Eugenie Lyzenko 2 months ago

Teodor Gorghe wrote:

Yes, 11678a/r16695 needs to be reviewed.

What Windows version do you use to test this build?

#18 Updated by Teodor Gorghe 2 months ago

A Windows 10 VM.

#19 Updated by Eugenie Lyzenko 2 months ago

Teodor Gorghe wrote:

A Windows 10 VM.

OK. In general I think the changes are reasonable. But I want to start using Hotel GUI on Windows before I can tell everything is OK.

And here I have issues. The 11678a/r16695 can not be built with gradlew all --info:

...
make -f C:/opt/11678a_16695/src/native/makefile.spawn
make[1]: Entering directory 'C:/opt/11678a_16695/build/native'
"Checking FWD gcc environment at start of: C:/opt/11678a_16695/src/native/makefile.spawn" 
"Initial CFLAGS: -DFWD_VERSION="\"4.0.0_p2j_11678a_16695\"" -IC:/jdk17/include -IC:/jdk17/include/win32 -IC:/opt/11678a_16695/src/native -Wall -fpic" 
"Initial JVM_LIBPATH: C:/jdk17/lib" 
rm -f ../../build/native/spawn.exe
process_begin: CreateProcess(NULL, rm -f ../../build/native/spawn.exe, ...) failed.
make (e=2): The system cannot find the file specified.
make[1]: [C:/opt/11678a_16695/src/native/makefile.spawn:309: clean] Error 2 (ignored)
gcc -DFWD_VERSION="\"4.0.0_p2j_11678a_16695\"" -IC:/jdk17/include -IC:/jdk17/include/win32 -IC:/opt/11678a_16695/src/native -Wall -fpic -g -Wall -s -LC:/jdk17/lib -DNDEBUG -D_UNICODE  -m64 -IC:/jdk17/include -IC:/jdk17/include/win32 -IC:/opt/11678a_16695/src/native C:/opt/11678a_16695/src/native/winspawn.c -o ../../build/native/spawn.exe -m64
make[1]: Leaving directory 'C:/opt/11678a_16695/build/native'
make -f C:/opt/11678a_16695/src/native/makefile.win_utils
make[1]: Entering directory 'C:/opt/11678a_16695/build/native'
"Checking FWD gcc environment at start of: C:/opt/11678a_16695/src/native/makefile.win_utils" 
"Initial CFLAGS: -DFWD_VERSION="\"4.0.0_p2j_11678a_16695\"" -IC:/jdk17/include -IC:/jdk17/include/win32 -IC:/opt/11678a_16695/src/native -Wall -fpic" 
"Initial JVM_LIBPATH: C:/jdk17/lib" 
rm -f ../../build/native/get_text_metrics.exe
process_begin: CreateProcess(NULL, rm -f ../../build/native/get_text_metrics.exe, ...) failed.
make (e=2): The system cannot find the file specified.
make[1]: *** [C:/opt/11678a_16695/src/native/makefile.win_utils:194: clean] Error 2
make[1]: Leaving directory 'C:/opt/11678a_16695/build/native'
make: *** [makefile:312: win_utils] Error 2
...

So the Window version is still not working for now.

#20 Updated by Teodor Gorghe 2 months ago

  • Status changed from Review to WIP
  • % Done changed from 100 to 90

As the logs tell, there is no rm or cp in your machine, which tells to me that having POSIX shell, doesn't guarantee that these utilities are installed in the system. Your system uses a make binary which uses a GNU shell by default, without having these two binaries.

I think the best way is to revert this section to trunk, using the cmd.exe /c del /q for delete and cmd.exe /c copy /B /V ... /B for copy. Quoting these paths makes them shell agnostic.

I will tell when it is done for review.

#21 Updated by Teodor Gorghe 2 months ago

  • Status changed from WIP to Review
  • % Done changed from 90 to 100

Done in 11678a/r16696.

#22 Updated by Eugenie Lyzenko 2 months ago

Teodor Gorghe wrote:

Done in 11678a/r16696.

OK.

I think for the cases we can use regular Windows tools or utilities that are part of the OS we need to prefer this way. To simplify the system setup process.

#23 Updated by Roger Borrello 2 months ago

Teodor, there is a update to tools/docker/docker_build.sh that will include server in /opt/fwd-deploy. Can I add it to 11678a? It does need to lay on top of trunk_16699, so a rebase would need to be done.

#24 Updated by Eugenie Lyzenko 2 months ago

Teodor Gorghe wrote:

Eugenie, please review the changes in the 11678a/r16694 and the ones for hotel_gui, attached in #11678-11.

How can I apply this patch to the Hotel GUI? Is it the patch to be used on Ubuntu, right?

I tried (patch -p < hotel_gui_win.patch) for recent Hotel GUI(revision 474) running inside root of the application but most of the files are not updating. Can you please make an archive with only modified but just patched versions, to just apply on top of the Hotel GUI?

And BTW the revision 16696 is now building fine on Windows.

#25 Updated by Teodor Gorghe 2 months ago

Roger, I will rebase the branch to contain these changes.

For hotel_gui, I have just patched it the host (using patch -p1 -i hotel_win.patch). You have a copy of it into an internal server.

#26 Updated by Roger Borrello 2 months ago

Teodor Gorghe wrote:

Roger, I will rebase the branch to contain these changes.

Let me know when this is done... I want to add my updates. Last I checked it was still revision 16696.

#27 Updated by Roger Borrello 2 months ago

Roger Borrello wrote:

Teodor Gorghe wrote:

Roger, I will rebase the branch to contain these changes.

Let me know when this is done... I want to add my updates. Last I checked it was still revision 16696.

I will do this and report back on any conflicts I cannot resolve.

#28 Updated by Roger Borrello 2 months ago

Branch was rebased to trunk_16702 and is now at revision 16704.

#29 Updated by Roger Borrello 2 months ago

Roger Borrello wrote:

Teodor, there is a update to tools/docker/docker_build.sh that will include server in /opt/fwd-deploy. Can I add it to 11678a? It does need to lay on top of trunk_16699, so a rebase would need to be done.

Committed to revision 16705.

Added server dist to Docker images where appropriate. Also, build images without PG when PG requested so as to have a complete set.

#30 Updated by Teodor Gorghe 2 months ago

Committed revision 16707 on task branch 11678a:
  • Fixed version mismatches between FWD convert and server and added fwdspi to server libs.

This was done due to #11673-67.

#31 Updated by Eugenie Lyzenko 2 months ago

Teodor,

The Hotel GUI from devsrv01 still has config issue:

C:\opt\hotel_gui>prepare_hotel.cmd
Enter your application name (only letters or digits, first character a letter): hotel
Enter your project name (can be different from the application) (only letters or digits, first character a letter): [hotel] hotel_gui
Edit the regex which matches all your include files (enter for default): [*.[fhi]] *.[fhi]
Edit the regex which matches all your program files (enter for default): [(*.[pPwW]|*.cls|*.htm|*html)] *.[pPwW]
Edit the root package name - Java format (enter for default): [com.goldencode.hotel] com.goldencode.hotel
Enter the PROPATH from your progress.ini file used for the application build (enter for default): [.:] .:common:
Enter the PROPATH from your progress.ini file used for the application runtime (enter for default): [.:] .;common;
Enter the ADM version: [ADM2.2] ADM2.2
Enter the legacy database name(s), separated by a comma (default DB first): hotel
Enter the database import file for "hotel": [hotel] hotel
Enter the database type of "hotel" (h2 or postgres): [h2] h2
Edit the DB host name for your imported database "hotel": [localhost] localhost
Edit the H2 database path for your imported database "hotel": [../db/] ../db
Enter the SQL admin for your imported database "hotel": [fwd_admin] fwd_admin
Enter the SQL admin password for your imported database "hotel": [admin] admin
Enter the SQL user for your imported database "hotel": [fwd_user] fwd_user
Enter the SQL user password for your imported database "hotel": [user] user
Enter the collation scheme for your imported database "hotel": [en_US@iso88591_fwd_basic] en_US@iso88591_fwd_basic
Enter the C3P0 Max Pool Size for your imported database "hotel": [20] 20
Does your ABL application currently run on the Windows OS (answer yes/no): [no] no
Enter the date format from your progress.ini (enter for default): [mdy] mdy
Enter the number group separator from your progress.ini (enter for default): [,] ,
Enter the number decimal separator from your progress.ini (enter for default): [.] .
Enter the procedure name containing the entry point for your application: start.p
Enter the hostname for the embedded web server: [localhost] localhost
Enter the port to use for web client access: [7443] 7443
Enter the directory filename, including path (relative to the server.xml file location.) (enter for default): [directory.xml] directory.xml
Do you want a sample AppCDS setup (answer yes/no): [no] yes
Wrote prepare_template.json
...
The argument 'C:\opt\hotel_gui\json_template.ps1' to the -File parameter does not exist. Provide the path to an existing '.ps1' file as an argument to the -File parameter.
...
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

#32 Updated by Teodor Gorghe 2 months ago

Forgot to include json_template.ps1 and json_template.cmd in the patch.
Updated patch.

#33 Updated by Constantin Asofiei about 2 months ago

  • reviewer Constantin Asofiei added

#34 Updated by Roger Borrello 26 days ago

Teodor, what is the state of the 11678a branch? My docker_build.sh needs to merge to trunk.

#35 Updated by Teodor Gorghe 26 days ago

Needs to be reviewed.

#36 Updated by Roger Borrello 22 days ago

Teodor Gorghe wrote:

Needs to be reviewed.

OK. I was going to rebase with the latest trunk, but there is conflict in build.gradle.

#37 Updated by Teodor Gorghe 22 days ago

I am rebasing it right now.

#38 Updated by Teodor Gorghe 22 days ago

Ok. I have rebased 11678a to trunk revision 16765. Latest revision is now 16772.

#39 Updated by Roger Borrello 14 days ago

Teodor Gorghe wrote:

Ok. I have rebased 11678a to trunk revision 16765. Latest revision is now 16772.

No review yet?

#40 Updated by Constantin Asofiei 14 days ago

I'm OK with the changes. Eugenie - please look at the windows native code changes.

#41 Updated by Eugenie Lyzenko 13 days ago

Constantin Asofiei wrote:

I'm OK with the changes. Eugenie - please look at the windows native code changes.

OK. I have two questions:

1. In winspawn.c function LoadJvm()

...
BOOL LoadJvm()
{
...
   // jvm.dll imports VCRUNTIME140[_1].dll, which the JDK ships in bin and not in bin\server. Those
   // are usually installed in the system directory too, this covers a machine where they are not.
   wcscpy(szBin, szJvm);
   _PathRemoveFileSpecW(szBin);
   _PathRemoveFileSpecW(szBin); <--------- EVL
   SetDllDirectoryW(szBin);

..

The exactly same call is doubled. Is there a reason? One call is not enough?

2. The changes in Windows makefiles. Are you tested the building on native Windows system?

Beside these two notes I'm OK with rest of changes.

#42 Updated by Teodor Gorghe 13 days ago

Eugenie Lyzenko wrote:

OK. I have two questions:

1. In winspawn.c function LoadJvm()

[...]

The exactly same call is doubled. Is there a reason? One call is not enough?

Check Windows documentation for PathRemoveFileSpecW:

Example how it works (pseudocode):

szJvm = 'C:\Program Files\Java\jdk-17\bin\java.exe'; // which has been obtained using SearchPathW.
// First call of PathRemoveFileSpecW
PathRemoveFileSpecW(szJvm);
// szJvm becomes 'C:\Program Files\Java\jdk-17\bin'

So, the example showed how the first part of LoadJvm works.

Then, the server\jvm.dll is being appended (because jvm.dll is located at C:\Program Files\Java\jdk-17\bin\server\jvm.dll:

// szJvm is C:\Program Files\Java\jdk-17\bin
PathAppendW(szJvm, 'server\jvm.dll');
// szJvm now is C:\Program Files\Java\jdk-17\bin\server\jvm.dll

So, that is the path for the jvm.dll, and we keep that path saved in szJvm. We initialize a new "string" variable called szBin and we copy the contents from szJvm. We go back to previous path (before appending server\jvm.dll):

wcscpy(szBin, szJvm); // copy szJvm char[] to szBin (value being 'C:\Program Files\Java\jdk-17\bin\server\jvm.dll').
PathRemoveFileSpecW(szBin); // szBin <- 'C:\Program Files\Java\jdk-17\bin\server'
PathRemoveFileSpecW(szBin); // szBin <- 'C:\Program Files\Java\jdk-17\bin'

The next step for that is to add C:\Program Files\Java\jdk-17\bin path to the DLL search path because jvm.dll depends from VCRUNTIME140.dll.

SetDllDirectoryW(szBin); // 'VCRUNTIME140.dll' is located at 'C:\Program Files\Java\jdk-17\bin', add 'C:\Program Files\Java\jdk-17\bin' to dll search path.

Then, I think it is obvious, loads the jvm.dll and then links the _JNI_CreateJavaVM to the actual JNI_CreateJavaVM function.

This change was done because I have completely remove the need for Windows JVM static link when building the spawn executable.

Eugenie Lyzenko wrote:

2. The changes in Windows makefiles. Are you tested the building on native Windows system?

Yes, they were being tested both in the old setup environment, which you may already use, and the new one, which I have designed, and it should simplify a lot the setup of FWD on Windows.
As I have told earlier, when you have tested this branch, it shouldn't require additional configuration steps for existing Windows setups.

I have used a Windows 10 VM.

#43 Updated by Teodor Gorghe 13 days ago

Another reason why this was introduced, alongside with the ClientBuilder change, was to remove the requirement to have the jvm.dll in the Windows PATH variable, for runtime.

#44 Updated by Eugenie Lyzenko 13 days ago

Teodor Gorghe wrote:

Example how it works (pseudocode):
[...]
So, the example showed how the first part of LoadJvm works.

Then, the server\jvm.dll is being appended (because jvm.dll is located at C:\Program Files\Java\jdk-17\bin\server\jvm.dll:
[...]

So, that is the path for the jvm.dll, and we keep that path saved in szJvm. We initialize a new "string" variable called szBin and we copy the contents from szJvm. We go back to previous path (before appending server\jvm.dll):
[...]

The next step for that is to add C:\Program Files\Java\jdk-17\bin path to the DLL search path because jvm.dll depends from VCRUNTIME140.dll.
[...]

Then, I think it is obvious, loads the jvm.dll and then links the _JNI_CreateJavaVM to the actual JNI_CreateJavaVM function.

This change was done because I have completely remove the need for Windows JVM static link when building the spawn executable.

OK. I was confused by the API name: PathRemoveFileSpecW because the server is a directory name in this case. Why not to use substring with \ char search?

At least I think additional comment in C code is necessary to explain this logic to simplify the further code maintain.

#45 Updated by Teodor Gorghe 13 days ago

Eugenie Lyzenko wrote:

OK. I was confused by the API name: PathRemoveFileSpecW because the server is a directory name in this case. Why not to use substring with \ char search?

At least I think additional comment in C code is necessary to explain this logic to simplify the further code maintain.

I would prefer to use the Windows API because it is way easier to maintain and you know, on C, String.substring('\\') is not just 1 line of code.
Done in revision 16773.

#46 Updated by Greg Shah 12 days ago

Our guidance in general would be this:

  • If possible, use CRT calls and put things in common code.
  • If because of the structure of the code (or other similar reason), it doesn't make sense to move something to common code, we still would prefer CRT calls all other things being equal.
  • If there is some strong reason platform-specific code is better or if it is absolutely required, then it is OK to use platform specific (e.g. Windows API) calls.

Also: we really DO NOT want C++ nonsense used in our native code. Use the CRT for this kind of thing.

The reason for the bias here is that the CRT is portable and is better understood by developers than the average Windows API call. Thus it gives us more options and the code reads better.

I'm not going to put a hard requirement on the CRT for this usage, but the fact that we are having this discussion means that the 2 back-to-back calls are confusing. The reader really needs to think about why this code may be correct and it totally depends on the system-level paths that come from the JDK install. That is fragile (it could break easily with different JDKs) and confusing.

SO: at a minimum, please put comments around this code to explain why it is called twice.

#47 Updated by Teodor Gorghe 12 days ago

Greg Shah wrote:

I'm not going to put a hard requirement on the CRT for this usage, but the fact that we are having this discussion means that the 2 back-to-back calls are confusing. The reader really needs to think about why this code may be correct and it totally depends on the system-level paths that come from the JDK install. That is fragile (it could break easily with different JDKs) and confusing.

SO: at a minimum, please put comments around this code to explain why it is called twice.

Ok, I understand.

The main reason why I have used the PathRemoveFileSpecW is because I want to avoid bugs on C, which are a bit tricky to analyze (for example, double backslash case, etc).
I will port that by hand, there is no C runtime equivalent for that.

The comments are already there, I have added them in the last revision.

About JVM install path, it uses system's path to search for java.exe (the ClientBuilder enforces the java version for the used JDK for FWD server, from JAVA_HOME).

Prior 11678a, there was a bug in the makefiles, where the path for jvm.dll was wrong. I have checked on latest OpenJDK Windows variants (17, 21, 25) and the location for the dll is on server\bin, not in server\lib.

#48 Updated by Roger Borrello 6 days ago

Teodor, when you have a chance, can you rebase 11678a? There are some conflicts in build.gradle that I might make a mess of.

#49 Updated by Teodor Gorghe 4 days ago

Rebased 11678a to trunk revision 16794.

Committed revision 16803 on task branch 11678a:
  • Removed PathRemoveFileSpecW usage from winspawn.exe.
  • Made the resolution of jvm.dll configurable, from spawn.ini. The precedence is now the following: config, *java.exe* from @JAVA_HOME, PATH variable).

#50 Updated by Teodor Gorghe 4 days ago

I had the hotel_gui UI version and I have noticed bugs related with resource path.

Back to WIP because I see lots of HTML-BROWSER widget issues, which I am fixing it right now.

#51 Updated by Teodor Gorghe 4 days ago

Committed revision 16804 on task branch 11678a:
  • Fix for HTML-BROWSER widget to work on Windows.

Also available in: Atom PDF