I’ve run into a persistent VerifyError when trying to call clone() on a jSoup (1.21.2) Element from CFML. This happens on a fresh Lucee 6.2.2.91 install (Tomcat 11.0.9, Java 21.0.8 Eclipse Adoptium 64-bit) using Windows installer.
The same code works as expected in the previously installed Lucee 5.4 (Tomcat/9.0.98, Eclipse 11.0.25), but fails inside Lucee 6.2.
I’ve worked around the issue using a custom function, but I’d rather use the native methods provided by the component. Thoughts?
Example:
<cfset element = createObject("java","org.jsoup.Jsoup")
.parseBodyFragment("<p><b>x</b></p>")
.selectFirst("p")>
<!--- This line throws the VerifyError --->
<cfset dup = element.clone()>
Result:
Bad access to protected data in invokevirtual Exception Details: Location: lucee/invoc/wrap/v4/org/jsoup/nodes/Element/clone.apply(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; @1: invokevirtual Reason: Type ‘java/lang/Object’ (current frame, stack[0]) is not assignable to ‘lucee/invoc/wrap/v4/org/jsoup/nodes/Element/clone’
Stack Excerpt:
Caused by: java.lang.VerifyError: Bad access to protected data in invokevirtual
Location: lucee/invoc/wrap/v4/org/jsoup/nodes/Element/clone.apply…