createObject('java') / Javaloaders

106 views
Skip to first unread message

Todd Rafferty

unread,
Jan 15, 2010, 2:42:35 PM1/15/10
to ra...@googlegroups.com
If you are all too familiar with Mark Mandel's Javaloader or createObject('java'), you may want to read this blog post:
http://www.railo.ch/blog/index.cfm/2010/1/15/Railo-Tip-CreateObjectjava

--
~Todd Rafferty ** Volunteer Railo Open Source Community Manager ** http://getrailo.org/

denstar

unread,
Jan 15, 2010, 4:33:23 PM1/15/10
to ra...@googlegroups.com
Is compiling of java files and spring support hidden inside already too?

Mad props to Mandel and his Javaloader. Excellent work.

Sweet little tidbit there, Todd, thanks.

--
I am called a dog because I fawn on those who give me anything, I yelp
at those who refuse, and I set my teeth in rascals.
Diogenes

James Holmes

unread,
Jan 16, 2010, 3:51:11 AM1/16/10
to ra...@googlegroups.com
Does the railo implementation memory leak like an ACF classloader does?

mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/

2010/1/16 Todd Rafferty <to...@getrailo.org>:

Gert Franz

unread,
Jan 16, 2010, 5:29:46 AM1/16/10
to ra...@googlegroups.com
Well we haven't replicated that bug, but you could add it to Uservoice :-)

Greetings from Switzerland
Gert Franz

Railo Technologies       Professional Open Source
skype: gert.franz            ge...@getrailo.com
+41 76 5680 231              www.getrailo.com


-----Ursprüngliche Nachricht-----
Von: ra...@googlegroups.com [mailto:ra...@googlegroups.com] Im Auftrag von
James Holmes
Gesendet: Samstag, 16. Januar 2010 09:51
An: ra...@googlegroups.com
Betreff: Re: [railo] createObject('java') / Javaloaders

Michael Offner-Streit

unread,
Jan 18, 2010, 5:38:37 AM1/18/10
to ra...@googlegroups.com
Railo use a regular URLClassLoader for this.

/micha

James Holmes schrieb:

Tom Chiverton

unread,
Jan 18, 2010, 10:33:14 AM1/18/10
to ra...@googlegroups.com
2010/1/18 Michael Offner-Streit <michael...@railo.ch>:

> Railo use a regular URLClassLoader for this.

So can I load multiple (conflicting) .jar versions or not ?

--
Tom

Michael Offner-Streit

unread,
Jan 18, 2010, 11:50:24 AM1/18/10
to ra...@googlegroups.com
not so easy to answer.
classloaders in java are organized hierarchical, in other words every classloader first ask for the parent classoader for a class, when that class already exists in the parent classloader, the classloader return this class and does not overwrite that class.
in other word, you can not overwrite a class from parent classloader.

what you can do, you can load different versions of the same jar on the same level
example:
// this loads different version of the same class
obj1=createObject('java',...,'...my-1-0-0.jar')
obj2=createObject('java',...,'...my-1-0-1.jar')

we have think about for a long time to manage all jars used by railo inside railo, this bring different benefits:
- we can update jars whitin a patch release
- we can load jars only when needed.
- we have no conflicts with jars loaded in the servlet engine

/micha



Tom Chiverton schrieb:
-- 
Michael Offner-Streit
CTO
Railo Technologies GmbH

Adam Haskell

unread,
Jan 18, 2010, 2:40:32 PM1/18/10
to ra...@googlegroups.com
So because i am too lazy too look, what is the parent classloader for createObject? Why not allow that to be configured (Javaloader does this btw) so if I don;t want anything except for what I am configuring then I set the parent to null.

Adam

Michael Offner-Streit

unread,
Jan 19, 2010, 5:01:12 PM1/19/10
to ra...@googlegroups.com
if you set parent classloader to null, the SystemClassloader is invoked

/micha

Adam Haskell schrieb:

>> 2010/1/18 Michael Offner-Streit <michael...@railo.ch> <mailto:michael...@railo.ch>:


>>
>>> Railo use a regular URLClassLoader for this.
>>>
>> So can I load multiple (conflicting) .jar versions or not ?
>>
>>
>
>
> --
> Michael Offner-Streit
> CTO
> Railo Technologies GmbH

> michael...@railo.ch <mailto:michael...@railo.ch>
> www.getrailo.com <http://www.getrailo.com> Mailing List (english):

Reply all
Reply to author
Forward
0 new messages