Discussion

Exception 'htmltopdf' OOTB activity

'htmltopdf' OOTB activity is used to generate PDF from XML. But getting below exception. Can some one tell me the solution for this.

Exception :
Caused by: java.lang.NoClassDefFoundError: org/zefer/pd4ml/PD4Constants
at com.pega.pegarules.util.PDFUtilsImpl.generatePDF(PDFUtilsImpl.java:136)
at com.pegarules.generated.activity.ra_action_htmltopdf_0dae6f1670d4d6133e5e5ad98472d9f6.step3_circum0(ra_action_htmltopdf_0dae6f1670d4d6133e5e5ad98472d9f6.java:335)

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

April 16, 2012 - 11:22pm

can u please let me know what are the parameters you are passing to htmltopdf call.

Pega
April 16, 2012 - 11:47pm

What is the prpc version being used?

September 14, 2012 - 12:57pm

We are getting below exception while calling "HTMLtoPDF" activity through agents. When we are running the activity through requestor it is working fine. Issue identified only when it is running through agent. Please advice.

Version: PRPC 6.1 SP2
App Server: Weblogic 10.3.6

Exception:

Exception at 20120914T163614.926 GMT: java.lang.NoClassDefFoundError: sun/awt/X11/XToolkit at java.lang.Class.forName(Class.java:169) at java.awt.Toolkit$2.run(Toolkit.java:834) at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:826) at org.zefer.font.c.<init>(Unknown Source) at org.zefer.cache.ResourceCache.getFontMetrics(Unknown Source) at org.zefer.html.doc.o.float(Unknown Source) at org.zefer.html.doc.t.<init>(Unknown Source) at org.zefer.html.doc.PD4MLHtmlParser.buildDocument(Unknown Source) at org.zefer.pd4ml.PD4ML.o00000(Unknown Source) at org.zefer.pd4ml.PD4ML.render(Unknown Source) at com.pega.pegarules.integration.engine.internal.util.PDFUtilsImpl.generatePDF(PDFUtilsImpl.java:177) at com.pega.pegarules.integration.engine.internal.util.PDFUtilsImpl.generatePDF(PDFUtilsImpl.java:233) at com.pegarules.generated.activity.ra_action_htmltopdf_d2ede3852eef3e8f1a794379f5888f49.step3_circum0(ra_action_htmltopdf_d2ede3852eef3e8f1a794379f5888f49.java:337) at com.pegarules.generated.activity.ra_action_htmltopdf_d2ede3852eef3e8f1a794379f5888f49.perform(ra_action_htmltopdf_d2ede3852eef3e8f1a794379f5888f49.java:105) at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3520) at com.pegarules.generated.activity.ra_action_generatejournalreport_5c65dc71bbd8f8a55ab787919eadaa83.step10_circum0(ra_action_generatejournalreport_5c65dc71bbd8f8a55ab787919eadaa83.java:1016) at com.pegarules.generated.activity.ra_action_generatejournalreport_5c65dc71bbd8f8a55ab787919eadaa83.perform(ra_action_generatejournalreport_5c65dc71bbd8f8a55ab787919eadaa83.java:257) at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3520) at com.pega.pegarules.session.internal.async.agent.QueueProcessor.runActivity(QueueProcessor.java:699) at com.pega.pegarules.session.internal.async.agent.QueueProcessor.execute(QueueProcessor.java:580) at com.pega.pegarules.session.internal.async.BatchRequestorTask.run(BatchRequestorTask.java:765) at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:989) at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:698) at com.pega.pegarules.session.internal.async.BatchRequestorTask.run(BatchRequestorTask.java:537) at com.pega.pegarules.session.internal.async.Agent.queueBatchActivityForAgent(Agent.java:1284) at com.pega.pegarules.session.internal.async.Agent.queueBatchActivityForAgent(Agent.java:1105) at com.pega.pegarules.session.internal.async.AgentQueue.run(AgentQueue.java:683) at com.pega.pegarules.session.internal.async.Agent.runAgentTask(Agent.java:807) at com.pega.pegarules.session.internal.engineinterface.etier.impl.AsyncServant.processAsyncTask(AsyncServant.java:191) at com.pega.pegarules.session.internal.engineinterface.etier.impl.AsyncServant.invoke(AsyncServant.java:151) at com.pega.pegarules.session.internal.engineinterface.etier.impl.EngineImpl._invokeEngine_privact(EngineImpl.java:315) at com.pega.pegarules.session.internal.engineinterface.etier.impl.EngineImpl.invokeEngine(EngineImpl.java:266) at com.pega.pegarules.session.internal.engineinterface.etier.ejb.EngineBean.invokeEngine(EngineBean.java:239) at sun.reflect.GeneratedMethodAccessor151.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.pega.pegarules.internal.bootstrap.PRBootstrap.invokeMethod(PRBootstrap.java:348) at com.pega.pegarules.internal.bootstrap.PRBootstrap.invokeMethodPropagatingThrowable(PRBootstrap.java:389) at com.pega.pegarules.internal.bootstrap.PRBootstrap.invokeMethodPropagatingException(PRBootstrap.java:411) at com.pega.pegarules.internal.etier.ejb.EngineBeanBoot.invokeEngine(EngineBeanBoot.java:171) at com.pega.pegarules.internal.etier.ejb.EngineBMT_h449u3_ELOImpl.__WL_invoke(Unknown Source) at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(SessionLocalMethodInvoker.java:39) at com.pega.pegarules.internal.etier.ejb.EngineBMT_h449u3_ELOImpl.invokeEngine(Unknown Source) at com.pega.pegarules.session.internal.engineinterface.etier.mdb.PRAsync.processRequest(PRAsync.java:154) at com.pega.pegarules.session.internal.engineinterface.etier.mdb.PRAsync.onMessage(PRAsync.java:111) at sun.reflect.GeneratedMethodAccessor150.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.pega.pegarules.internal.bootstrap.PRBootstrap.invokeMethod(PRBootstrap.java:348) at com.pega.pegarules.internal.bootstrap.PRBootstrap.invokeMethodPropagatingThrowable(PRBootstrap.java:389) at com.pega.pegarules.internal.bootstrap.PRBootstrap.invokeMethod(PRBootstrap.java:438) at com.pega.pegarules.internal.etier.mdb.PRAsyncBoot.onMessage(PRAsyncBoot.java:94) at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:583) at weblogic.ejb.container.internal.MDListener.run(MDListener.java:902) at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256) at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

October 23, 2012 - 8:58pm

@NKKOWSIK : Is the issue got resolved?

I had similar issue few months back. But I found a work arround. Once you deploy the code on test env/live env, execute the agent activity MANUALLY first time so that the PDF file is generated.

Thereafter let the agent run as per the schedule.  It worked for me in this way and hope it works for you too :)

Cheers!

Ramakrishna