Missing Java Class javax/swing/text/html/HTML

Hello

Lucee 5 doesn’t execute a JasperReports call in a cfscript-tag.

jasperPrint = jasFillManager.fillReport(jasReport, parameters,
*  CreateObject("java", 
"net.sf.jasperreports.engine.data.JsonDataSource").init(inputStreamUTF8, 
getJSONRoot(ReportParamArray)));*

Lucee 4.5 works fine. Luce 5+ throws the following error:

Lucee 5.1.1.23-SNAPSHOT Error (java.lang.NoClassDefFoundError)
Message javax/swing/text/html/HTML$Tag
Cause java.lang.NoClassDefFoundError

The same error appears on developer machines with Windows 10 an 7.

Isn’t the javax/swing/text class in the Java Core Library?
I think it is in the rt.jar in the java lib directory.
So I tried to put the rf.jar in the WEB-INF/lucee/lib directory. But the
same error appears.

If someone has a hint how to solve it, I would appreciate your help.
Thanks
Christoph

Not sure how to solve it but lucee now has a plug OSGI in architecture rather than having general way so jars are not shared by everyone.

javax.swing should be part of the standard distribution (just tested it and it is) but having said that , HTML$TAG is an inner class so not sure if there are some access issues.

I tried this code:

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

And it seems to work ok?

you can do item.getAllTags() and those are $TAG classes.

Hello Mark

Thank you for your answer.
I’m also quite sure that the class is present in the used java virtual
machine (jvm). Lucee 4.5 and 5 use the same settings and class paths. Tried
also to change to oracle’s jvm. But the same error appears.

Bye

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 Joda - Time download | SourceForge.net 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

1 Like