Adalennis opened a new issue, #9405:
URL: https://github.com/apache/hop/issues/9405

   ### Apache Hop version?
   
   2.20.0
   
   ### Java version?
   
   Java 21
   
   ### Operating system
   
   macOS
   
   ### What happened?
   
   Reproduced on 2.20.0 on macOS; the code involved is unchanged on main.
   
   On macOS, a pipeline with a Microsoft Excel writer transform that has "Auto 
size columns" enabled never finishes when it is run from the command line. 
There is no error: the writer never ends, and `hop-run.sh` or `hop run` keeps 
running until it is killed.
   
   Steps, with the samples project:
   
   ```
   ./hop-run.sh -j samples -r local -f 
'${PROJECT_HOME}/transforms/microsoft-excel-writer.hpl'
   ```
   
   The Data grid finishes (`books.0 - Finished processing (... W=2 ...)`), and 
then nothing more happens. `./hop run` behaves the same.
   
   A thread dump shows the writer thread stuck in AWT's macOS toolkit:
   
   ```
   "microsoft-excel-writer - microsoft excel writer" ... RUNNABLE
        at sun.lwawt.macosx.LWCToolkit.initAppkit(Native Method)
        at sun.lwawt.macosx.LWCToolkit.<init>
        at java.awt.Toolkit.getDefaultToolkit
        at sun.font.CFontManager.getFontPath
        at sun.font.SunFontManager.loadFonts
        at sun.font.SunFontManager.findFont2D
        at java.awt.Font.getFont2D
        ...
   ```
   
   `ExcelWriterTransform` calls POI's `autoSizeColumn()`, which measures text 
with AWT fonts. Loading the fonts starts the AWT toolkit, and on macOS that 
tries to start AppKit, which never completes in a process without a GUI. The 
launchers don't set `java.awt.headless`, so Java doesn't know it has no GUI.
   
   The same pipeline finishes normally in either of these cases:
   - "Auto size columns" off
   - `HOP_OPTIONS="-Xmx2048m -Djava.awt.headless=true" ./hop-run.sh ...`
   
   ### Issue Priority
   
   Priority: 3
   
   ### Issue Component
   
   Component: Hop Run


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to