• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CF2021 poi lib issue

Advisor ,
May 20, 2024 May 20, 2024

Copy link to clipboard

Copied

Greetings,

We have ColdFusion (2021 release) Update 13. 

The POI version should be 4.1.2 according to the next article

What are the version numbers of the libraries underlying CF2021 - ColdFusion (adobe.com)

The CF package in the laptop show the same version

jfb00_0-1716230880934.png

But the version show 3.1.7 using the next code

variables.objPoi = createObject( 'java', 'org.apache.poi.Version' ).getVersion();
writeOutput('<h2>'&variables.objPoi&'</h2>');

We reinstall the update and reboot the laptop, still show the old poi version.

Any ideas about this issue?

How can we resolve this issue? Do we need to reinstall CF?

Thanks,

Johnny

 

Views

168

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 08, 2024 Jun 08, 2024

Hi @jfb00 , it is futile to look for the POI version that ColdFusion 2021 uses. There is no such thing. Not at the moment at least.

 

That is because ColdFusion 2021 uses POI 3.1.7 as well as POI 4.1.2. Some packages that ColdFusion uses depend on POI 3.1.7 (for example, the "Presentation" package). Whereas other packages depend on POI 4.1.2 (such as the "PDF" package, and the "Spreadsheet" package pictured in your original post).

BKBK_0-1717851278571.png

 

Votes

Translate

Translate
Explorer ,
May 20, 2024 May 20, 2024

Copy link to clipboard

Copied

Uninstall the presentation package or add a version to createobject.

variables.objPoi = createObject( 'java', 'org.apache.poi.Version','poi','4.1.2' ).getVersion();
 

https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-c-d/CreateObjectJav...

Note: 

For ColdFusion (2021 release) and later, use the following syntax:

  • createObject("java", "org.apache.poi.xssf.usermodel.XSSFWorkbook","jarname", "jar_version"). You can get the values for jarname and jar_version from the file, <cfroot>/bundles/bundlesdependency.json.

For example, createObject("java", "org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDataValidation","poi", "4.1.2")

 

 

 
 
 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
May 29, 2024 May 29, 2024

Copy link to clipboard

Copied

We uninstall the presentation and it doesn't work. Even reinstall CF 2021 and install the package 13 and still show poi 3.17 version.

We have multiple applications and many files that will affect to add the jar version, the issue is only in one developer laptop.

We are pointing CF to the java jdk 23 to pass IT security.

Any other ideas in how to fix this issue?

Thanks,

Johnny

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 29, 2024 May 29, 2024

Copy link to clipboard

Copied

Since the problem happens on only one machine, I would assume it's happening there because you have some other poi jar within the cf folders. There are a few that are on what is called the Java classpath.

 

Look at the cf admin "system information" page ("i" in the top right corner) or the "settings summary" page, which both have a section showing jars on the "CF Server Java Class Path", to see if any refer to "poi".  (I find none by default, but CF obviously finds its poi classes in some jar listed there. And don't look for the specific version number you are observing: the jar filenames may not have the number you refer to. Java doesn't care about file names; if a jar is in a folder in the classpath, the classes within it can be found.) 

 

Finally, I'll assume that by "jdk23" you mean jdk 11 and its latest update, which is 23. Java/jdk 23 is not out yet (and cf2021 supports only Java 11, not any of the later versions still updated by Oracle. More here). 


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 29, 2024 May 29, 2024

Copy link to clipboard

Copied

When I wrote my comment above, I was reading (and replying) on my phone. Since then I've done some more digging. First, both CF2021 and 2023 have poi-3.17.jar as well as poi-4.1.0.jar and poi-4.1.2.jar within their bundles\repo folder (such as C:\ColdFusion2021\bundles\repo).

 

Second, yes, if you've installed the later spreadsheet package, it does list that point-4.1.2 jar as "required"...but  I assume that could mean only that the package requires it...and that the OSGI framework (underlying CF2021 and above) ensures that the code supported by that spreadsheet package will use that POI version. 

 

It may NOT mean that code you write doing such a createobject call will report THAT specific version. So let's press the question: you raised the issue. What's the concern? Is it that YOU want to use the POI embedded within CF? And you presumed it was that version? As was noted above, you could name the version.

 

Still another approach would be to use the application-level this.javasettings feature and its loadpaths option (both introduced in CF10), which allows you to load any java jar you want--for use in THAT application (only). That wouldn't then require you to change your calls to the java object: you'd get the version you want. More at https://helpx.adobe.com/coldfusion/developing-applications/using-web-elements-and-external-objects/i....

 

Let us know how it goes.

 

BTW, I also find that while my CF2021 reports the 4.1.0 version, my CF2023 reports the 3.17 you found. That's curious, but I did not dig into that further. Perhaps someone from Adobe may offer more thoughts.


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
May 30, 2024 May 30, 2024

Copy link to clipboard

Copied

Good morning,

Thanks for your reply and help.

Yes, CF C:\ColdFusion2021\bundles\repo has the poi-4.1.2.jar file alone the other versions have three extra files to make all work.

"What's the concern?"  I was curious WHY in only this box the poi 4.1.2 version was not working as others using the embedded poi.

Solution: I downloaded the four poi-4.1.2 jar files from apache site repo, copy all into C:\ColdFusion2021\cfusion\runtime\lib and now it is getting the 4.1.2 version.

Let's see if anyone from Adobe explained this issue, as you said.

Have a great day, Johnny

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 29, 2024 May 29, 2024

Copy link to clipboard

Copied

After uninstalling the presentation package, restart ColdFusion 2021 Application Server.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
May 30, 2024 May 30, 2024

Copy link to clipboard

Copied

Thanks for your reply, the restart didn't work.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 08, 2024 Jun 08, 2024

Copy link to clipboard

Copied

Hi @jfb00 , it is futile to look for the POI version that ColdFusion 2021 uses. There is no such thing. Not at the moment at least.

 

That is because ColdFusion 2021 uses POI 3.1.7 as well as POI 4.1.2. Some packages that ColdFusion uses depend on POI 3.1.7 (for example, the "Presentation" package). Whereas other packages depend on POI 4.1.2 (such as the "PDF" package, and the "Spreadsheet" package pictured in your original post).

BKBK_0-1717851278571.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 08, 2024 Jun 08, 2024

Copy link to clipboard

Copied

To see the full list of ColdFusion 2021's POI dependencies, open {CF2021_HOME}/bundles/bundlesdependency.json in a text editor, and search for "poi" (including the quotes).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jun 10, 2024 Jun 10, 2024

Copy link to clipboard

Copied

LATEST

Okay, but why for most of the developers laptops shows as 4.1.2 and only for this laptop shows 3.1.7? 

We used the same CF installation exe file and do the same updates. 

For now we did the fix forcing the CF to use the 4.1.2 poi.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jun 10, 2024 Jun 10, 2024

Copy link to clipboard

Copied

Thanks for your reply and help. That explains the CF behavior.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation