Skip to main content
WolfShade
Legend
July 8, 2025
Answered

Generating Excel files suddenly throws exceptions

  • July 8, 2025
  • 6 replies
  • 1429 views

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

    Correct answer matthew_0510

    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.   

    6 replies

    spcooney
    Inspiring
    July 14, 2025

    Thanks so much for the thread. Updated one of our test environments and we ran across this issue while testing the patch.

     

    We were getting a 500 error followed by a Caused by: java.lang.ClassNotFoundException: com.zaxxer.sparsebits.SparseBitSet not found by poi-5.4.1 [49].

     

    Found this post and was able to go in and clear the cf classes as suggested (which has started to feel like the catch all solution post patches):

    1. Stop the CF services.
    2. Navigate to ColdFusion2023\cfusion\wwwroot\WEB-INF\cfclasses and remove all files (would be regenerated)
    3. Navigate to ColdFusion2023\cfusion\bin\felix-cache and remove all files. (would be regenerated)
    4. Start CF services and check the scenario.

    I can confirm that in our case this worked.  After stopping, removing and restarted all tiers the export to excel and download work again as expected.

     

    Thanks all for the input on this thread.

    (Running: ColdFusion 2023 HF 15 on Windows)

     

    spcooney
    Inspiring
    July 14, 2025

    Potentially premature update on my part.  Though the class clear appears to have worked for one of our calls another similar call is broken and throws a different error after the initial 500.

    Caused by: coldfusion.runtime.JSONUtils$JSONParseOverflowException: JSON parsing failure: Unexpected end of JSON string

    The call of course works as expected on another yet to be patched tier.  Just thought I would update that the class clear may not have been a cure all.  Apologies again for the possible premature fix confirmation.

    WolfShade
    WolfShadeAuthor
    Legend
    July 15, 2025

    Unexpected end of JSON string.  I've seen that, before.  I'm assuming the string is being generated by CF.  Could be truncated data causing this?  Have you done a cfdump of the value?  Are you encoding the content so quotation marks and the like cannot break the string?

     

    Still waiting to hear back from my SA on Charlie's suggested actions.

     

    WolfShade

    Participant
    July 14, 2025

    I'm seeign a similar problem with generating spreadsheets, but a with a different error message. Ths only started happening after CF 2021 Update 21 was installed.

     

    java.lang.NoClassDefFoundError: com/zaxxer/sparsebits/SparseBitSet at org.apache.poi.ddf.EscherDggRecord.findNewDrawingGroupId(EscherDggRecord.java:304)

     

    Ray

    matthew_0510Correct answer
    Participating Frequently
    July 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.   

    WolfShade
    WolfShadeAuthor
    Legend
    July 10, 2025

    Hi, @matthew_0510 .

     

    I did speak with my SA about that, and she said that xalan was never part of the installation of any of our CF Servers.

     

    Do you think that just by pasting the xalan.jar file in its proper place will fix this?  I was of the impression that xalan was being deprecated/phased out.

     

    WolfShade

    Participating Frequently
    July 11, 2025

    It's worth a shot; I do see that xalan.jar file in my environments and we are generating Excel files without issue. 

    Charlie Arehart
    Community Expert
    Community Expert
    July 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-cache). You can stop cf, delete those, and cf will recreate them (without performance impact). 

     

    Even if cf was not updated, it's possible a package was. And someone may also have updated the Java that Cf uses, which can also call for these actions.

     

    Finally, if these steps don't solve the problem, a next concern would be that there was a failure during updating of cf packages (again, whether anyone "knows" that was attempted or not). There are logs that could be explored to confirm things, but let's hear what you find about the above first (especially the reported version number). 

    /Charlie (troubleshooter, carehart. org)
    WolfShade
    WolfShadeAuthor
    Legend
    July 10, 2025

    Thank you, Charlie.  I will start doing that, and report back.

     

    WolfShade

     

    UPDATE:  Product Version is 2021,0,20,330407

    WolfShade
    WolfShadeAuthor
    Legend
    July 10, 2025

    Is there some sort of java -D entry in CF Admin that can fix this?  I cannot figure this out.

    WolfShade
    WolfShadeAuthor
    Legend
    July 9, 2025

    I just read about a new patch that is coming out.  I wonder if the following might be related?  Even though I'm told xalan was not part of the install process.

    After installing and then uninstalling the last update, the cfspreadsheet function no longer works. The C:\ColdFusion2021\cfusion\lib\xalan.jar was removed during the uninstallation process, even though this JAR file was not added or modified as part of the original installation.

     

    Just a thought.

     

    WolfShade

    WolfShade
    WolfShadeAuthor
    Legend
    July 9, 2025

    I was recently informed that no patches have been uninstalled, so that's not it.