Pete,
Thanks. Using an Iterator Wrapper worked. Not really sure why I can't call
those functions directly?
Dave,
Sorry, I was doing some servlet work related to this, but it's not relevent
to this problem. I didn't need to specify that I was using JRun.
Thanks,
-Barry
-----Original Message-----
From: Pete Freitag [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 15, 2001 3:25 PM
To: JRun-Talk
Subject: RE: CFOBJECT and Jrun
Barry,
Maybe try defining myIterator with CFOBJECT... You might need to
make a
class MyIterator that implements Iterator so you can instantiate it. And
have MyHelper.getExtensionLastNames() return an iterator of type MyIterator.
<CFOBJECT ACTION="CREATE" TYPE="Java" CLASS="MyIterator" NAME="myIterator">
Pete Freitag ([EMAIL PROTECTED])
CFDEV.COM
ColdFusion Developers Resources
http://www.cfdev.com/
-----Original Message-----
From: Barry Jones [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 15, 2001 1:55 PM
To: JRun-Talk
Subject: CFOBJECT and Jrun
Does any have good experience using CFOBJECT with Java?
Having a problem calling methods from an Object of type Iterator. The
MyHelper class in the below example has a method called
getExtensionListNames() that returns an Iterator (actually, it returns
list.keySet().iterator() where list is a TreeMap). When I try to access any
methods on the Iterator (e.g. myIterator.hasNext()) it bombs with
java.lang.IllegalAccessException.
Any suggestions would be appreciated.
Using: CF 5.0 & JRun 3.1
====
CFML
====
<CFOBJECT ACTION="CREATE" TYPE="Java" CLASS="MyHelper" NAME="myObj">
<cfscript>
myObj.init();
myObj.loadDataFromModel(); <!--- Loads data into TreeMap --->
myIterator = myObj.getExtensionListNames();
</cfscript>
<cfset bool = myIterator.hasNext()>
======
Result
======
Error Diagnostic Information
Unhandled System exception !
java.lang.IllegalAccessException: java/util/TreeMap$Iterator. Java exception
occurred in call to method.
The error occurred while processing an element with a general identifier of
(CFSET), occupying document position (26:1) to (26:35) in the template file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/jrun-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists