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

Generating Excel files suddenly throws exceptions

LEGEND ,
Jul 08, 2025 Jul 08, 2025

Good morning, all.

 

I have code that has been in place for at least 6 or 7 years that generates Excel files.  Depending upon the app, the Excel file is either A) made available to the user via download, or B) emailed to a pre-determined email address, possibly CC'ing others, as well.  It has had no issues for all this time, and no changes to the code have been made.

 

Recently, while creating a new section of a public-facing website, I copied and modified Excel generating code from one of these older sections, expecting it to work.  I've been having all kinds of issues, from files not being saved to the server, to simple strings added to a cell coming up as garbage.  Exceptions are being thrown.  So, I decided to check one of the earlier pages on the public site that creates Excel files, and lo and behold it's throwing an exception when it comes to creating the Excel file.  I have no idea how long this has been breaking, no one ever reported anything to my department.  But it's clearly breaking.  (UPDATE:  Someone just now reported an issue.)

 

The errors that are being reported are all the same: 

Message: org/apache/xalan/processor/TransformerFactoryImpl
Type: java.lang.ClassNotFoundException
Provider org/apache/xalan/processor/TransformerFactoryImpl not found

I found forum messages indicating that the xalan.jar file was missing.  I asked my SA about it, and she stated that xalan was never part of the install of any of our CF Servers.  So, it doesn't make sense to me that it not being part of the install would trigger this error.

 

For years this code has worked with very few issues.  I'm thinking some kind of server config change is the cause, but have no idea where to start looking.

 

Has anyone ever experienced anything like this?

 

V/r,

 

WolfShade

923
Translate
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 2 Correct answers

Community Expert , Jul 10, 2025 Jul 10, 2025

Frustrating, of course. But there may be more to this than meets the eye. 

 

First, you say no updates were done. Let's not rely on what anyone says. What do you see in a dump of the server.coldfusion struct? I think it's the productversion key (am writing from my phone).

 

If it was updated, then some problems like this are solved if you delete the folders where cf saves compilation of cfml to Java (cfusion/wwwroot/WEB-INF/cfclasses) and where it saves package mgt artifacts (cfusion/bin/felix-c

...
Translate
Community Beginner , Jul 10, 2025 Jul 10, 2025

The update for CF2021u20 (https://helpx.adobe.com/coldfusion/kb/coldfusion-2021-update-20.html) lists an issue with xalan.jar in the "Known Issues in the Update" section. The gist is that what you're describing could be caused by a missing xalan.jar file in [your-CF-root]\cfusion\lib folder.   

Translate
Community Expert ,
Jul 21, 2025 Jul 21, 2025

I seem to recall you're in a restricted environment and have to wait for your administrator a lot. Is there a run book you can access and share?

 

Dave Watts, Eidolon LLC
Translate
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
LEGEND ,
Jul 21, 2025 Jul 21, 2025

Hi, Dave.

 

Yes, DoD restricted network.  What is a run book?

 

WolfShade

 

UPDATE:  Had to look that one up.  Sadly, no, we do not have a runbook.

Translate
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 ,
Jul 21, 2025 Jul 21, 2025
LATEST

Womp womp.

 

You might want to encourage him to start one, for future auditing as well as general problem solving.

 

Dave Watts, Eidolon LLC
Translate
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
LEGEND ,
Jul 21, 2025 Jul 21, 2025

Our SA got the image package installed, so the CAPTCHA is loading.

 

I have a try/catch on the CFC that is processing the form data.  Something threw an exception, and the error email that was generated says that Method writeDump with 3 arguments is not in class coldfusion.runtime.CFComponent.

 

WolfShade

UPDATE:  Might have found a fix for this.  I'll report if it works.

 

UPDATE2:  The issue was "return writeDump(var="#e#", format="html");"  Instead, I had to use "savecontent variable='testdump'{writeDump(var='#e#',format='html')}" and then return that.  And the result is that spreadsheet still isn't installed.  SA installed image only.

Translate
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 ,
Jul 21, 2025 Jul 21, 2025

Thanks for the update. So far, things seem to be picking up.

 

A suggestion with reference to:

return writeDump(var="#e#", format="html");

and

savecontent variable='testdump'{writeDump(var='#e#',format='html')}

Since dumping is mainly for debugging, and doesn't serve any other purpose as response, I would do the following (to reduce complexity):

  1.  Change the function's return type to boolean; then
  2.   Replace the return line with:
    /* Save the dump of 'e' as an HTML file in ColdFusion's logs directory */
    writeDump(
        var = e,
        label = "Dump of variable 'e'",
        format = "html",
        output = server.coldfusion.rootDir & "\logs\dump_of_e_from_xyz.html"
    );
    
    /* Return true or false as appropriate */
    return true;	​


 

 

Translate
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
LEGEND ,
Jul 21, 2025 Jul 21, 2025

Picking up.. very.. very.. very slowly.  Heh.. you'd think I'd be used to it, after 13 years.

 

The way this is set up is not as a standard form submit, but rather using AJaX to serialize the form, stringify it, and send it to the CFC on the backend.  What is returned is supposed to be either a success message (if all form validation and sanitization are successful), or a list of corrections that need to be addressed.  I'm using DevTools to view the response, for now.  When completed, the message/corrections should appear in a modal for the user to understand.

 

I do like your code suggestion, but that would place the .html file in an area that I do not have access to.  Only the SA and DBA have access to that area.  I could try to save it in the same folder as the CFC, of course.  And might try to do that, coz then I could just download it from the server and view it locally.


WolfShade

Translate
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 ,
Jul 21, 2025 Jul 21, 2025
quote

Picking up.. very.. very.. very slowly.  Heh.. you'd think I'd be used to it, after 13 years.

 


By @WolfShade

A sentiment I share. 🙂

Translate
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 ,
Jul 21, 2025 Jul 21, 2025

As ColdFusion itself has suggested, you can solve all the issues of type 

The xyz package is not installed.

by using ColdFusion's Package Manager tool (cfpm). You could pass the following steps on to your System Administrator:

  1.  Open the Command Prompt (cmd) as Administrator.
  2.  Use the CD command to navigate to C:\ColdFusion2021\cfusion\bin.
  3.  Type cfpm and press ENTER. You should get ColdFusion's package manager prompt cfpm
  4. Run the command install all.
    BKBK_0-1753123852809.png
  5. Keep running the command install all till the result is either an irreversible error or ColdFusion tells you that "All the packages are already installed".

    6. If the former, then share the error message with the forum. If the later, then restart ColdFusion in the usual way, and you're set to go.
    7.  If you need to remove any unnecessary packages, you can then do so in the Package Manager page in the ColdFusion Administrator.

Translate
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
LEGEND ,
Jul 21, 2025 Jul 21, 2025
quote
  1.  Open the Command Prompt (cmd) as Administrator.
  2.  Use the CD command to navigate to C:\ColdFusion2021\cfusion\bin.
  3.  Type cfpm and press ENTER. You should get ColdFusion's package manager prompt cfpm
  4. Run the command install all.
    BKBK_0-1753123852809.png
  5. Keep running the command install all till the result is either an irreversible error or ColdFusion tells you that "All the packages are already installed".

    6. If the former, then share the error message with the forum. If the later, then restart ColdFusion in the usual way, and you're set to go.
    7.  If you need to remove any unnecessary packages, you can then do so in the Package Manager page in the ColdFusion Administrator.


By @BKBK

 

Thank you for the instructions, but where I work the instructions for standing up a CF Server specify what can and cannot be installed.  They have a very strict and aggressive network security posture.

 

Our SA got the image package installed, I just have to wait for him to get the spreadsheet package installed (which I assumed he'd do before the image package.)

 

Another case of "hurry up and wait", for me.  I don't mind.. I keep busy, learning new things for either CF, Javascript, or jQuery.  🙂

 

WolfShade

Translate
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