Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Accessing Java Methods In ColdFusion

11 views
Skip to first unread message

hycel

unread,
Jan 25, 2005, 12:11:12 PM1/25/05
to
Hello,

I?m considering using Cold Fusion for developing the web front-end for a large
application whose back-end has been developed using java. I?m wondering if
Cold Fusion will interface well with the java back-end code and if so how would
I implement it in Cold Fusion.

All calls to the back-end are made by calling a service factory that returns a
delegate object for the requested service. For example, in order to find a
specific Person object I would use the following code:

Person service = null;
try {
service = (Person) ServiceFactory.getInstance().getService(?Person?);
person = service.findByPersonId(person.getPersonId());
} catch (ServiceException e) {
return false;
} catch (RequestNotFoundException e) {
return false;
}
return person;
}

Person is an interface.
ServiceFactory is a singleton, thus the need for the public method,
getInstance.

So, to be clear, having not used Cold Fusion, but hearing that Cold Fusion
integrates well with Java, I would greatly appreciate it if anyone could answer
whether it is possible for ColdFusion to directly access Java objects and use
there methods. And, if possible, also provide a brief example snippet of Cold
Fusion code accessing the ServiceFactory to find and return a Person object as
I have described above.

Thank you in advance for any help,

Hycel :confused;

Dross.2

unread,
Feb 4, 2005, 3:44:41 PM2/4/05
to
<cfset service = createObject('java','full.type.name.of.ServiceFactory').getInstance().getService('person')/>

<cfset person = service.findByPersonId(some_personID)/>

anikanch

unread,
Sep 14, 2005, 1:57:58 PM9/14/05
to
I have same problem while calling a methos from CF. Below error is thrown
in CF

Either there are no methods with the specified method name and argument
types, or the method CheckMember is overloaded with arguments types that
ColdFusion can't decipher reliably. If this is a Java object and you
verified that the method exists, you may need to use the javacast
function
to reduce ambiguity

please.......... HELP!!!!!

0 new messages