coldfusion / java performance integration

29 views
Skip to first unread message

Brettski

unread,
Jul 25, 2011, 7:52:56 AM7/25/11
to javaloader-dev
Hi,

Just using a java pdf lib, just getting started with java / CF
integration.

running my simple test app from eclipse / java is instant i.e < 1 sec,
when I run using:

<cfscript>
test = createObject("java", "Test").init();
</cfscript>

or javaloader

<cfscript>
loader = createObject("component",
"javaloader.JavaLoader").init(paths);
</cfscript>

It takes 5 seconds to deliver the page to browser (same local dev box,
no other page content).

Any ideas why? Am I making a newbie mistake?

Marc Esher

unread,
Jul 25, 2011, 8:27:24 AM7/25/11
to javaloa...@googlegroups.com
the first time you create a javaloader instance it'll take a while. 5
seconds seems excessive, however.

You should create the javaloader instance in a shared scope,
preferably the server scope. Read the docs on this one as they're
pretty clear if I recall correctly.

After that, calling server.myjavaloader.create("whatever") should be
pretty fast.

Marc

Brett Herford-Fell

unread,
Jul 25, 2011, 5:08:37 PM7/25/11
to javaloa...@googlegroups.com
Great thanks :)

That worked, turned out when I turned execution times on there was a local DNS hang of up to 5 sec, but javaloader does it's thing very quickly.. Your suggestion fixed another issue I had, related to below..

If I want to change the array JARS, do I just call the following code again?

server.loader = createObject("component", "javaloader.JavaLoader").init(paths); 

I had some issues saying JAR already existed, don't know if there is a clean way to re-init the javaloader?

b

Mark Mandel

unread,
Jul 25, 2011, 7:41:32 PM7/25/11
to javaloa...@googlegroups.com
Yep, that looks like correct code to me.

Without knowing what the error was, can't say for sure what your issue is though.

Mark
--
E: mark....@gmail.com
T: http://www.twitter.com/neurotic
W: www.compoundtheory.com

cf.Objective(ANZ) + Flex - Nov 17, 18 - Melbourne Australia
http://www.cfobjective.com.au

Reply all
Reply to author
Forward
0 new messages