Wirebox injection not working when accessed from a REST handler

I have a model that contains some utility functions that I use in a couple places. That model injects the Jsoup JAVA lib through cbjavaloader:

 component name="myUtilities"  singleton{

	// Properties
	property name="HEREClient" inject="id";
	property name="JsoupTools" inject="javaloader:org.jsoup.Jsoup";

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

I am using Lucee 5.3.8.201, CB 6.5.2+37, and cbjavaloader 2.0.0+49

I ended up having to use:

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.

// JAVA settings
	this.javaSettings = {
		LoadPaths = [".\libs\"],
		loadColdFusionClassPath = true,
		reloadOnChange= true,
		watchInterval = 100,
		watchExtensions = "jar,class,xml"
	}

This then worked for both REST and non-REST handlers.

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.

I will load more code tomorrow when I am back in the office!

Thanks!