I have a process in ColdFusion [2023] that gets the contents of a .msg file (Microsoft email message) so that I can use said contents to create a PDF version of the message. This process has been working fine for the past two+ years. I used the code from the following accepted answer in stackoverflow: ColdFusion: Extract information from a .msg file.
As of yesterday (to the best of our knowledge as this part of the system is not used daily) the process has stopped working in that it errors out. I am using the Java POI object to gain access to the MAPIMessage object. This line...
MAPIMessage = createObject("java", "org.apache.poi.hsmf.MAPIMessage");
..is producing the following error:
org.apache.poi.POIReadOnlyDocument not found by poi [93]
Does anyone have any ideas of what might be happening or how to investigate the issue? I can access other objects via the POI object. For example, I am able to execute
<cfset MAPIMessage = createObject("java", "org.apache.poi.POIDocument")>
which, in viewing the cfdump
returns a list of methods.
Our CF Administrator is out, but once available I will check with him to see if there were any recent updates to the CF servers. This issue is happening on our dev, test, and production servers. We upgraded to CF2023 over the summer, and I am told by the end user that they have used this part of the application recently, though I am not completely ruling out the upgrade as the culprit.
I am open to do this a different way but it would need to be via ColdFusion. My thought is that there should be a way to use CFPDF / DDX to convert the .msg to a PDF, but I am not seeing any documentation on how to do so.
As it turned out, the supporting poi jar
files were missing from the [servername]\lib folder. The jar files were:
poi-3.17
poi-contrib
poi-ooxml-3.17
poi-ooxml-schemas-3.17
poi-scratchpad
poi-scratchpad-3.17
I am just sure if the files were part of the initial 2018 install, and not included with 2023; or if we installed them separately in 2018 and forgot what we did. Either way, this seems to have resolved the issue.
Note that there is likely a newer version of poi available.