Four Js Development Tools Forum

Discussions by product => GAS and GBC => Topic started by: Paul M. on October 04, 2023, 07:23:41 pm



Title: Using Apache POI
Post by: Paul M. on October 04, 2023, 07:23:41 pm
We are modernizing our software to use Web only applications, and I am having issues moving an application that uses Apache POI to the web server.  It keeps throwing an 8306 Java exception thrown error.  I realize it is because  I am not referencing the POI libraries properly.  We are running POI-5.0.0 on IIS-10
BDL is on RHEL 8 using version 3.20.13
GAS is on WS2019 running IIS using version 3.20.13

I have tried putting the poi directories in the as.xcf file by creating
<RESOURCE Id="res.poidir" Source="INTERNAL">C:\POI\poi-5.0.0</RESOURCE>
then adding $(res.poidir):$(res.poidir)\lib:$(res.poidir)\ooxml-lib 
to the res.path and res.fglldpath variables for both WNT and UNX

I also tried adding the LD_LIBRARY_PATH and CLASSPATH directly to the 8-10 files in the application.xcf like I do for BDL

I know I am missing something simple.


Title: Re: Using Apache POI
Post by: Reuben B. on October 05, 2023, 11:35:04 pm
I gave a tip in this article https://4js.com/ask-reuben/ig-44/ which would normally help here. (environment variable not set to what you think it is)

At beginning of your program shortly after MAIN add the following

Code
  1. IF some-condition THEN   -- Typically test for existence of a command line argument
  2.   RUN "env | sort > /tmp/yourname.env"  -- use appropriate command for O/S
  3. END IF

Run program in config that works and one that doesn't, and compare value of CLASSPATH, LD_LIBRARY_PATH, JAVA*. etc  Normally find in moving from GDC-Direction Connection to Web via Genero ApplicationServer that an environment variable has not been specified in .xcf either all or correctly.

One thing puzzles me about what you typed though.  You said "running POI-5.0.0 on IIS-10" and the entry for poidir being "c:\" but you also said "BDL is on RHEL8".  When you have IMPORT JAVA it is using the Java on the same server as the fglrun.  So if BDL is on RHEL8, then your Java and Apache POI should also be on RHEL8.

Reuben