Jasperreport customtag fails after update to lucee 5.1.0.34


#1

I´m using that CT since a few years with Railo3/4/Lucee4.
Now with Lucee 5 I get the following error:

java.lang.ClassNotFoundException
javax.swing.text.html.HTML$Tag not found by net.sf.jasperreports.engine 
[103] <br>The error occurred on line 216 in file /cfc/jasperreport.cfc.
line 216: jasperPrint = jasperFillManager.fillReport(jasperReport, 
parameters, drs);

Can anyone help me?

Stacktrace

lucee.runtime.exp.NativeException: javax.swing.text.html.HTML$Tag not found 
by net.sf.jasperreports.engine [103] at 
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1558) 
at 
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79) 
at 
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1998) 
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at 
net.sf.jasperreports.engine.util.JEditorPaneHtmlMarkupProcessor.convert(JEditorPaneHtmlMarkupProcessor.java:137) 
at 
net.sf.jasperreports.engine.fill.JRFillTextElement.processMarkupText(JRFillTextElement.java:911) 
at 
net.sf.jasperreports.engine.fill.JRFillStaticText.<init>(JRFillStaticText.java:52) 
at 
net.sf.jasperreports.engine.fill.JRFillObjectFactory.visitStaticText(JRFillObjectFactory.java:638) 
at 
net.sf.jasperreports.engine.base.JRBaseStaticText.visit(JRBaseStaticText.java:95) 
at 
net.sf.jasperreports.engine.JRAbstractObjectFactory.getVisitResult(JRAbstractObjectFactory.java:89) 
at 
net.sf.jasperreports.engine.fill.JRFillElementGroup.<init>(JRFillElementGroup.java:82) 
at 
net.sf.jasperreports.engine.fill.JRFillElementContainer.<init>(JRFillElementContainer.java:90) 
at net.sf.jasperreports.engine.fill.JRFillBand.<init>(JRFillBand.java:90) 
at 
net.sf.jasperreports.engine.fill.JRFillObjectFactory.getBand(JRFillObjectFactory.java:498) 
at 
net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:441) 
at 
net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:88) 
at 
net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:103) 
at 
net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:61) 
at 
net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:153) 
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:82) at 
net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:653) 
at 
net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:969) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:498) at 
lucee.runtime.reflection.pairs.MethodInstance.invoke(MethodInstance.java:55) 
at lucee.runtime.java.JavaObject.call(JavaObject.java:237) at 
lucee.runtime.java.JavaObject.call(JavaObject.java:259) at 
lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:753) 
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1599) at 
cfc.jasperreport_cfc$cf.udfCall1(/cfc/jasperreport.cfc:216) at 
cfc.jasperreport_cfc$cf.udfCall(/cfc/jasperreport.cfc) at 
lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:105) at 
lucee.runtime.type.UDFImpl._call(UDFImpl.java:337) at 
lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:210) at 
lucee.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:781) 
at 
lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:814) 
at 
lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1614) 
at cfc.jasperreport_cfc$cf.udfCall1(/cfc/jasperreport.cfc:60) at 
cfc.jasperreport_cfc$cf.udfCall(/cfc/jasperreport.cfc) at 
lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:105) at 
lucee.runtime.type.UDFImpl._call(UDFImpl.java:337) at 
lucee.runtime.type.UDFImpl.call(UDFImpl.java:224) at 
lucee.runtime.ComponentImpl._call(ComponentImpl.java:692) at 
lucee.runtime.ComponentImpl._call(ComponentImpl.java:575) at 
lucee.runtime.ComponentImpl.call(ComponentImpl.java:1898) at 
lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:753) 
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1599) at 
jasperreport_cfm$cf.call(/jasperreport.cfm:16) at 
lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:918) at 
lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:833) at 
lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:828) at 
lucee.runtime.tag.CFTag.doInclude(CFTag.java:324) at 
lucee.runtime.tag.CFTag.cfmlStartTag(CFTag.java:246) at 
lucee.runtime.tag.CFTag.doStartTag(CFTag.java:178) at 
module.beleg.formate.jasperreport_incl_cfm$cf.call(/kaufhaus/module/beleg/formate/jasperreport_incl.cfm:46) 
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:918) at 
lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:833) at 
lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:828) at 
lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:819) at 
module.beleg.formate.rg_normal_cfm$cf.call(/kaufhaus/module/beleg/formate/rg_normal.cfm:82) 
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:918) at 
lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:833) at 
lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:828) at 
lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:819) at 
module.beleg._formulareundaktionen.rechnungdaten_update_cfm$cf.call(/module/beleg/_formulareundaktionen/rechnungdaten_update.cfm:109) 
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:918) at 
lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:833) at 
lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:828) at 
lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:819) at 
module.beleg.rechnung_bearbeiten_cfm$cf.call(/module/beleg/rechnung_bearbeiten.cfm:27) 
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:918) at 
lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:833) at 
lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:828) at 
lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:819) at 
index_cfm$cf.call(/index.cfm:192) at 
lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:918) at 
lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:833) at 
lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:828) at 
lucee.runtime.listener.ClassicAppListener._onRequest(ClassicAppListener.java:62) 
at 
lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:44) 
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2293) at 
lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2284) at 
lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2252) at 
lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:891) at 
lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:102) 
at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:62) at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) 
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) 
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) 
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) 
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) 
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108) 
at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) 
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) 
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) 
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) 
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349) 
at 
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:784) 
at 
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) 
at 
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:802) 
at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1410) 
at 
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) 
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) 
at java.lang.Thread.run(Thread.java:745) Caused by: 
java.lang.ClassNotFoundException: javax.swing.text.html.HTML$Tag not found 
by net.sf.jasperreports.engine [103] ... 110 more

#2

javax.swing.text.html.HTML$Tag is part of standard java classes and
available to Lucee. Tested with:

<cfscript>
item = createObject("java", "javax.swing.text.html.HTML");
dump(item);
</cfscript>

But why is it not available for the ct?


#3

Hello

I’ve got the same problem. JasperReports isn’t running any more on Lucee 5.
That’s the only reason why I can’t use the new Lucee version.
Did you find a solution?

A few months ago I got the answer, that Lucee 5 has a plug OSGI
architecture which could have an impact on the java vm and the class
availability.

I receive the following error by generating a report on Lucee 5 (works fine
on Lucee 4.5):

Lucee 5.1.2.23-SNAPSHOT Error (net.sf.jasperreports.engine.JRException)
Message Errors were encountered when compiling report expressions class
file:

1. The type java.lang.CharSequence cannot be resolved. It is indirectly 
referenced from required .class files

/*
^
1 errors
.
Cause net.sf.jasperreports.engine.JRException
Stacktrace The Error Occurred in
*...\reports\reportSystemJasper.cfm: line 202* 

200: 
201: // Compile template
*202: jasReport = jasperCompileManager.compileReport(ReportTemplateFile);*
203: }
204: 

Bye


#4

Hello

For my Windows 10 developer workstation I found the following solution:

Copy all the JasperReports library jars and the file joda-time-2.4.jar from
the Joda-Time distribution https://sourceforge.net/projects/joda-time/ to
the Lucee lib directory in the Lucee installation directory.
e.g. c:\Program files\lucee\lib

Now the JasperReports engine works with Lucee 5. Great!

Bye


#5

Hi Christoph,

I just tried out your approach (Lucee 5 express / macOS), but had no luck… do you happen to have any additional hints what to try?

Regards,
Lutz


#6

Hello Lutz

I’m not using the JasperReport CustomTag. Instead I use a customized solution to integrate JasperReports with my ColdFusion application. But I think the problem is the same since I got the same error message.

In Lucee 4.5 I put the JasperReports Jars in the WEB-INF/lucee/lib directory of the domain. With Lucee 5 I have to put the jars in the lib directory of the Lucee Installation.

Besides my Windows workstation I use JasperReports on several CentOS webservers.

I use the JasperReports Library 6.2.
On the Linux server I copy all the JasperReports jars in /opt/lucee/lib
Delete xercesImpl-2.10.0.jar
Add joda-time-2.4.jar (download from https://sourceforge.net/projects/joda-time/ )
Add mysql-connector-java-5.1.41-bin.jar (download from https://dev.mysql.com/downloads/connector/j/ )

Regards,
Christoph