How to read Codebase URL (e.g. from JavaSpaces entry)

11 views
Skip to first unread message

Dawid Loubser

unread,
Sep 14, 2015, 7:40:32 AM9/14/15
to Rio Users Group
Hi all,

I'm trying to de-bug a complex classpath problem with regards to Entry objects that were written to a JavaSpace, only to incur unusual classloading problems upon reading them.
Based on my knowledge of how Rio class resolving works, everything looks fine to me in my opstrings, so I need to figure out how to, given an object, list its codebase URL - which I expect to be a rather long list of Maven artifact URLs in my particular case.

For the life of me, I cannot find a standard way of obtaining this codebase URL, given only the object (i.e. after creating in a Rio Service, but before writing it to a JavaSpace, or in a worker that has just taken the object out of a JavaSpace).

Does anybody know of a useful method? Or do I go through the ClassLoader (i.e. casting the class loader to some expected implementation, i.e. as used in Rio services).

assistance appreciated -
Dawid

Dennis Reedy

unread,
Sep 15, 2015, 3:39:57 PM9/15/15
to rio-...@googlegroups.com
Hi Dawid,

Given an object, get it’s ClassLoader, cast it to URLClassLoader, and invoke the getURLs() method. That should return what you’re looking for.

HTH

Dennis

--
You received this message because you are subscribed to the Google Groups "Rio Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rio-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages