When I add these tools to a non-REST handler the JsoupTools load just fine and the TextTrim function that uses the Jsoup library object executes with no issue.
var _cleanedText = JsoupTools.parse(_originalText).text();
When I add these utilities to a REST handler and I try to use the TextTrim funciton I get this error: variable [JsoupTools] doesn’t exist
var JsoupTools = createObject("java","org.jsoup.Jsoup");
in the utilities model file. I also had to add JavaSettings to my Application.cfc file so that I did not have to put the .jar file in the server lib directory.
That’s avoiding the dependency injection and mixing concerns. Question would be, how are you calling your rest handler? Also, you didn’t put any code for the rest handler or how you are calling it. Can you provide it please.