sal
June 8, 2010, 8:58pm
#1
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
sal
June 8, 2010, 9:07pm
#3
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
sal
June 9, 2010, 4:56pm
#6
thanks Luis.
I may just call the loader via getPlugin().setup() rather than
injecting it...
cheers
sal
June 10, 2010, 10:27pm
#7
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