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

java.lang.NoClassDefFoundError: coldfusion/image/Image

New Here ,
Mar 21, 2024 Mar 21, 2024

Copy link to clipboard

Copied

I am reciveing the error

java.lang.NoClassDefFoundError: coldfusion/image/Image

when using the cfhtmltopdf tag 

I have tried

<cfhtmltopdf>
#variableContainingCleanedHTML#
</cfhtmltopdf>

I tried writing the HTML to a file and trying to convert it to PDF that way, same error.
 <cffile action="write" file="#expandpath('.')#/Certificate_#form.certNumber#.html" output="#variableContainingCleanedHTML#"> <!--- this worked --->
<!--- fails here --->
    <cfhtmltopdf
        source="#expandpath('.')#/Certificate_#form.certNumber#.html"
        destination="#expandpath('.')#/Certificate_#form.certNumber#.pdf"
    />
TOPICS
Advanced techniques

Views

181

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 ,
Mar 22, 2024 Mar 22, 2024

Copy link to clipboard

Copied

I got the same error after installing CF2021 Update 13:

 

Partial log from coldfusion-error.log:

 

SEVERE: Servlet.service() for servlet [CfmServlet] in context with path [] threw exception [ROOT CAUSE:
coldfusion.runtime.EventHandlerException: Event handler exception.

Caused by: java.lang.NoClassDefFoundError: coldfusion/image/Image

 

I had to reinstall the update, then it started working again.

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 ,
Mar 22, 2024 Mar 22, 2024

Copy link to clipboard

Copied

Given that reinstalling the update fixed things, it would imply there was a failure during the update, or during the process of cf updating packages on the restart after the update. In the latter case, it may be that reinstalling only some failed package update would have sufficed. 

 

As that may be what happened to James (or others who find this), and to help confirm if reinstalling either might be expected to work for them, let me elaborate.

 

1) As for the update, some may know that there's an update log in the cfusion/hf-updates folder, within the folder name for the update you applied. In that folder, it's a file with a very long name (not the hotfix-file list.log), which reflects the day and time the update was attempted. And there may be more than one such file, if you attempt to install multiple times. (There would also be an uninstall log, if you attempted that.) 

 

And in such a log file will be a table tracking the number of successes and fatalerrors in the update, which is found about 70-100 lines from the top. If that reports other than 0 fatalerrors or nonfatalerrors, there was an error in the update. There can be many reasons for that, some of which are not clear from other error lines in that log. I've done blog posts and presentations on dealing with update errors. I'll come back and add links later.

 

2) But even if there are 0 fatalerrors, when an update entails package updates (some do, some don't as indicated in a table at the bottom of the update's technote), then those package updates are applied on the next cf restart (which the update itself will trigger).

 

And the status of those package updates will be tracked in cf's logs, such as the coldfusion-out.log or coldfusion-error.log. You need to find in these logs the timeframe of the cf restart that happened when you applied the update (which time is indicated in the update install log discussed above, again even just in the name of that log file).

 

If the post update restart triggered cf to attempt to update any packages, you should see indications of it uninstalling and then reinstalling the affected packages during this next cf restart.

 

3) James, do you see anything of interest in any of the above logs at the time you applied the update? If the update log itself worked, maybe you'll see that during the first restart maybe only SOME package failed to install.

 

And Sireex, though you've reinstalled the update, you should still have the logs from your first attempt. It could be of value for others if you might confirm seeing anything like I've proposed above (or not).

 

4) As for installing or reinstalling package updates, that can be done (without need of reinstalling the entire update). That can be done either in the cf admin (the "package manager" page, new since cf2021--and NOT the "packaging and deployment" which is much older), or using the command line cfpm tool (also added in cf2021 and documented extensively by Adobe). 

 

Hope that may help someone. 


/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
Explorer ,
Mar 22, 2024 Mar 22, 2024

Copy link to clipboard

Copied

I checked logs from that date, there were rows like this in coldfusion-out.log :

Error [ajp-nio-127.0.0.1-8020-exec-10] - coldfusion/image/Image The specific sequence of files included or processed is: 

 

Update logs had no errors, and the only errors in coldfusion-error.log were like this:

 

Caused by: java.lang.NoClassDefFoundError: coldfusion/image/Image

Caused by: java.lang.ClassNotFoundException: coldfusion.image.Image not found by pdf [51]

 

We still haven't updated out production servers to update 13, so we'll see how that goes.

 

 

 

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 ,
Mar 22, 2024 Mar 22, 2024

Copy link to clipboard

Copied

LATEST
quote

I am reciveing the error

java.lang.NoClassDefFoundError: coldfusion/image/Image

when using the cfhtmltopdf tag 

 

By @James32764395oysv

 

Say what?

What happens wnen you run the following test?

<cfscript>
imageObj = createobject("java","coldfusion.image.Image");
writedump(imageObj);	
</cfscript>

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