Javaloader model dependency

All,

How does one use the javaloader in a model?

<cfproperty name="JavaLoader" type="coldbox:plugin:javaloader"
scope="instance" />

#instance.JavaLoader.getVersion()#

gives me the following error...

Element cbox-javaloader-B2D119035A9F6CDD06AA0C928816B0B5 is undefined
in a Java object of type class coldfusion.runtime.ProtectedScope.

do I need to setup a config setting that I don't know about for
JavaLoader.cfc plugin?

any thoughts?

Coldbox version: 2.6.4
ColdFusion 8

ColdBox 2.6.4 plugin retrievals where case sensitive so it must match the plugin’s physical file name.

This is fixed in 3.0

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

nope. not that case.

<cfproperty name="JavaLoader" type="coldbox:plugin:JavaLoader"
scope="instance" />

<cfdump var="#instance.JavaLoader.getVersion()#" expand="false" />

still same problem.

any thoughts?

Ok, the issue is that the component is not intialized. JavaLoader works by calling its setup() method with an array of locations to search for jars/classes to load. So you need a mechanism to initialize the javaloader library. i recommend doing this in your application start handler or in coldbox 3 you can use the settings to set a path load on application start.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

The name of the setting is “javaloader_libpath”

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

thanks Luis.

I may just call the loader via getPlugin().setup() rather than
injecting it...

cheers

example of using the javaloader plugin?

can't seem to get it working...

thx

There is a sample app in the samples.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

ack! duh.

sorry and thanks!