CFPDF error (intermittent)

Have been running into this issue for the last year or so and cannot find a solution as yet.
Intermittent issue when using CFPDF tag will suddenly throw the below error. Have tried to debug using fusion reactor, but to no avail (trial has now run out).

Message
string Provider for class javax.xml.parsers.DocumentBuilderFactory cannot be created
StackTrace
string lucee.runtime.exp.NativeException: Provider for class javax.xml.parsers.DocumentBuilderFactory cannot be created at java.xml/javax.xml.parsers.FactoryFinder.findServiceProvider(Unknown Source) at java.xml/javax.xml.parsers.FactoryFinder.find(Unknown Source) at java.xml/javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source) at com.lowagie.text.xml.xmp.XmpReader.(Unknown Source) at com.lowagie.text.pdf.PdfStamperImp.close(Unknown Source) at com.lowagie.text.pdf.PdfStamper.close(Unknown Source) at org.lucee.extension.pdf.tag.PDF.doActionSetInfo(PDF.java:1385) at org.lucee.extension.pdf.tag.PDF.doActionWrite(PDF.java:739) at org.lucee.extension.pdf.tag.PDF.doEndTag(PDF.java:686) at edde.quote4.inc_email_partner_cfm$cf$3d.call(/edde/Quote4/inc_Email_Partner.cfm:88) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1034) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:926) at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:907) at edde.quote4.proposal_cfm$cf$33.call(/edde/Quote4/proposal.cfm:19) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1034) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:926) at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:907) at application_cfc$cf.udfCall(/application.cfc:134) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:217) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:684) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:572) at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1911) at lucee.runtime.listener.ModernAppListener.call(ModernAppListener.java:437) at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:216) at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:44) at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2460) at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2450) at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2421) at lucee.runtime.engine.Request.exe(Request.java:45) at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1179) at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1125) at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97) at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51) at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at jdk.internal.reflect.GeneratedMethodAccessor60.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:134) at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doNext(FusionReactorRequestHandler.java:772) at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doHttpServletRequest(FusionReactorRequestHandler.java:344) at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doFusionRequest(FusionReactorRequestHandler.java:207) at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.handle(FusionReactorRequestHandler.java:809) at com.intergral.fusionreactor.j2ee.filter.FusionReactorCoreFilter.doFilter(FusionReactorCoreFilter.java:36) at jdk.internal.reflect.GeneratedMethodAccessor59.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:71) at jdk.internal.reflect.GeneratedMethodAccessor58.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at com.intergral.fusionreactor.agent.filter.FusionReactorStaticFilter.doFilter(FusionReactorStaticFilter.java:54) at com.intergral.fusionreactor.agent.pointcuts.NewFilterChainPointCut$1.invoke(NewFilterChainPointCut.java:42) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:764) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357) at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:433) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Unknown Source) Caused by: javax.xml.parsers.FactoryConfigurationError: Provider for class javax.xml.parsers.DocumentBuilderFactory cannot be created … 77 more Caused by: java.lang.RuntimeException: Provider for class javax.xml.parsers.DocumentBuilderFactory cannot be created … 77 more Caused by: java.util.ServiceConfigurationError: javax.xml.parsers.DocumentBuilderFactory: Error accessing configuration file at java.base/java.util.ServiceLoader.fail(Unknown Source) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.parse(Unknown Source) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(Unknown Source) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(Unknown Source) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(Unknown Source) at java.base/java.util.ServiceLoader$2.hasNext(Unknown Source) at java.base/java.util.ServiceLoader$3.hasNext(Unknown Source) at java.xml/javax.xml.parsers.FactoryFinder$1.run(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Native Method) … 77 more Caused by: java.io.FileNotFoundException: C:\lucee\tomcat\temp\com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl (The system cannot find the file specified) at java.base/java.io.FileInputStream.open0(Native Method) at java.base/java.io.FileInputStream.open(Unknown Source) at java.base/java.io.FileInputStream.(Unknown Source) at java.base/java.io.FileInputStream.(Unknown Source) at java.base/sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source) at java.base/sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source) … 85 more

Don’t forget to tell us about your stack!

OS: Windows Server 2019 (10.0) 64bit
Java Version: 11.0.11 (AdoptOpenJDK) 64bit
Tomcat Version: Apache Tomcat/9.0.46
Lucee Version: Lucee 5.3.8.206
**PDF Extension: 1.1.0.7

@pelfed Can you please provide some more info like the version of pdf extension & sample code to repro this issue ( if it is very frequent )?

Hi - Currently on PDF extension version 1.1.0.7.

The issue occurs very infrequently. The last time it happened between events (which requires a lucee restart to clear the issue) was 5 days. Sometimes it can be okay for weeks, then it will fail.

The code is pretty straight forward:

<cfset attachdoc="PRQ_#dateformat(now(),'ddmmyyyy')#_#timeformat(now(),'hhmmss')#">

<cfpdfform action="populate" source="#docpathroot#\pdf_forms\CRMInfo.pdf"
  destination="#docpath#\temp\#attachdoc#.pdf" overwrite="yes">  
<cfpdfformparam name="Company Name" value="#CompanyName#">
<cfpdfformparam name="Contact Name" value="#ContactName#">
<cfpdfformparam name="Date" value="#dateformat(Datesent,"dd/mm/yy")#">
<cfpdfformparam name="Equipment Type" value="#EquipmentType#">
<cfpdfformparam name="Notes" value="#newnote#">
</cfpdfform>

<cfpdf action="write" 
	source="#docpath#\temp\#attachdoc#.pdf" 
	destination="#docpath#\#attachdoc#.pdf" 
	flatten="yes"  
	overwrite = "true" >
</cfpdf>

checked the issue with above mentioned code in PDF extension version 1.1.0.7. it didn’t throw an “string Provider for class javax.xml.parsers.DocumentBuilderFactory cannot be created” error.

@pelfed Can you please check the latest PDF extension?

I have 2 servers (load balanced) one running latest version and one using 1.1.0.7.
I had forgot I had updated one of the servers, but the issue still remains (both servers eventually have an issue). Difficult to test since it is intermittent.

I’m having a similar problem. Not with this extension, but when working with Java objects. I’ll get the following error:

Error Type: javax.xml.parsers.FactoryConfigurationError
Error Message: Provider for class javax.xml.parsers.DocumentBuilderFactory cannot be created

This issue is intermittent, I’ll restart a server and it will work without issue for several days and then it will resurface. I apologize for not having more information to share. I’m unable to replicate consistently. I’m on commandbox using lucee 5.3.9+141

@bdeline Can you tell which extension you encountered this problem with? Also please share the full stack trace.