Project

General

Profile

Bug #11266

Filename of extension too long in Windows during import

Added by Dănuț Filimon 6 months ago. Updated 13 days ago.

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

0%

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

hotel_import_fix.patch Magnifier (1.2 KB) Teodor Gorghe, 07/31/2026 02:53 AM

import_fix.patch Magnifier (815 Bytes) Teodor Gorghe, 07/31/2026 03:17 AM


Related issues

Related to Conversion Tools - Bug #11678: Improve FWD support on Windows Review

History

#1 Updated by Dănuț Filimon 6 months ago

I got the following error while running and import.db in hotel_gui, Windows, java 17:

create.db.h2:

BUILD FAILED
C:\gcd\hotel_gui\build.xml:1114: The following error occurred while executing this line:
C:\gcd\hotel_gui\build.xml:1046: The following error occurred while executing this line:
C:\gcd\hotel_gui\build.xml:1092: The following error occurred while executing this line:
C:\gcd\hotel_gui\build_db.xml:53: java.io.IOException: Cannot run program "C:\tools\java\java17\bin\java.exe" (in directory "C:\gcd\hotel_gui"): CreateProcess error=206, The filename or extension is too long
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
        at java.base/java.lang.Runtime.exec(Runtime.java:594)
        at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:58)
        at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:424)
        at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:438)
        at org.apache.tools.ant.taskdefs.Java.fork(Java.java:912)
        at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:229)
        at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:136)
        at org.apache.tools.ant.taskdefs.Java.execute(Java.java:109)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
        at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
        at org.apache.tools.ant.Task.perform(Task.java:350)
        at org.apache.tools.ant.Target.execute(Target.java:449)
        at org.apache.tools.ant.Target.performTasks(Target.java:470)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
        at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:437)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
        at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
        at org.apache.tools.ant.Task.perform(Task.java:350)
        at java.base/java.util.Vector.forEach(Vector.java:1365)
        at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:67)
        at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:217)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
        at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:155)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
        at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
        at org.apache.tools.ant.Task.perform(Task.java:350)
        at java.base/java.util.Vector.forEach(Vector.java:1365)
        at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:67)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
        at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
        at org.apache.tools.ant.Task.perform(Task.java:350)
        at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:391)
        at net.sf.antcontrib.logic.ForTask.doSequentialIteration(ForTask.java:259)
        at net.sf.antcontrib.logic.ForTask.doToken(ForTask.java:268)
        at net.sf.antcontrib.logic.ForTask.doTheTasks(ForTask.java:299)
        at net.sf.antcontrib.logic.ForTask.execute(ForTask.java:244)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
        at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
        at org.apache.tools.ant.Task.perform(Task.java:350)
        at org.apache.tools.ant.Target.execute(Target.java:449)
        at org.apache.tools.ant.Target.performTasks(Target.java:470)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
        at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:437)
        at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:106)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
        at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
        at org.apache.tools.ant.Task.perform(Task.java:350)
        at org.apache.tools.ant.Target.execute(Target.java:449)
        at org.apache.tools.ant.Target.performTasks(Target.java:470)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1374)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
        at org.apache.tools.ant.Main.runBuild(Main.java:818)
        at org.apache.tools.ant.Main.startAnt(Main.java:223)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)
Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long
        at java.base/java.lang.ProcessImpl.create(Native Method)
        at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:499)
        at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:158)
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
        ... 84 more

The workaround is to place hotel_gui directly in C:\, but there should not be a limit on the filename length in the first place.

#2 Updated by Ovidiu Maxiniuc 6 months ago

I think the problem here is the classpath, not the size of filename / extension. Moving the project directly into root will have the indirect effect that the paths to the jars are all shorter and the final command will fit into 8Ki limit imposed by Windows.

To fix this we need to:
  1. clean the old versions of jars in the build/lib or deploy/lib;
  2. reduce the number of dependencies as possible;
  3. using the manifest method instead of classpath;
  4. JDK9 supports argument files, like: java @args.txt ....

I think we already have third implemented so the classpath does not really need all jars, just the 'top-level' jars (p2j, spi and application, I guess). This should work on Linux as well. But the first two should also used periodically.

If the first 3 are not enough, writing the argument to a temporary file and then passing it to java executable (aka 4th solution) instead of passing them directly will definitely solve the issue.

#3 Updated by Greg Shah 6 months ago

Item 3 is the most important. We need to fix our scripting to not be stupid.

But the first two should also used periodically.

Agreed.

writing the argument to a temporary file and then passing it to java executable (aka 4th solution)

I really want to avoid this. Creating temp files is nasty business because it requires write permissions and cleanup of files and it is just a poor design.

#4 Updated by Ovidiu Maxiniuc 6 months ago

I know we recently dropped ant as a tool for building FWD. But in this case, ant is used to do in database import. I think we should use gradle for all these tasks and drop the dependency on ant completely. In addition, some customers use import scripts, similar to the one we provide.

#5 Updated by Dănuț Filimon 6 months ago

I did try to use the 4th option after also discovering that the classpath is the issue, the ScriptRUnner class could nto be found. In the end I moved hotel_gui to C:\ instead of C:\gcd

#6 Updated by Ovidiu Maxiniuc 6 months ago

For ScriptRunner I think the classpath only needs to contain fwd, fwdspi (H2 only) and the db-specific driver jar. Try to alter app.classpath, or better define a specific import.classpath to verify my assumption.

#7 Updated by Greg Shah 13 days ago

In the past, this has been sufficient:

using the manifest method instead of classpath;

Why is it not working now? In other words, we should not specify hundreds of jar files in the classpath. We just should point to p2j.jar and leave off the dependencies.

#8 Updated by Teodor Gorghe 13 days ago

What do you think Danut about this patch?

Now, I am encountering this issue, and Constantin's patch doesn't work:

#9 Updated by Teodor Gorghe 13 days ago

Also as a side note, install_spawner.ps1, the script which selects standard.df and the prepare_hotel.cmd are also broken.
install_spawner.ps1 fails because postbuild.ps1 is missing, there is no windows equivalent script for standard.df selection and prepare_hotel.cmd does not work because deploy/server/directory_db_h2.xml.template is missing.

#10 Updated by Teodor Gorghe 13 days ago

Used this patch to fix the import (FWD needs to be patched because 11646b doesn't fix this issue).

#11 Updated by Constantin Asofiei 13 days ago

Teodor Gorghe wrote:

Used this patch to fix the import (FWD needs to be patched because 11646b doesn't fix this issue).

Teodor, what do you mean? The patch in 11646b is exactly this.

#12 Updated by Teodor Gorghe 13 days ago

Ok, I understood, it is not the same as from the one received from email.
I have updated to the latest trunk and it is fine, sorry for the false alert.

#13 Updated by Șerban Bursuc 12 days ago

  • Related to Bug #11678: Improve FWD support on Windows added

Also available in: Atom PDF