Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2007

Tip: Looking for answers? Try searching our database.

Set classloader (classpath?) at runtime

Thread view: 
cyberco - 22 Oct 2007 15:16 GMT
I"m not sure if my understanding of classloading is correct, but I get
the feeling that it is where my problems lie.

I have a class that receives an object that uses a different
classloader/classpath. The incoming object knows nothing about classes
in the classpath of the receiving class. It should though. How can I
set the classloader of the incoming object so that it can find classes
(in the classpath) of the receiving class?

I hope I'm making sense :)
Daniel Pitts - 22 Oct 2007 15:44 GMT
> I"m not sure if my understanding of classloading is correct, but I get
> the feeling that it is where my problems lie.
[quoted text clipped - 6 lines]
>
> I hope I'm making sense :)

If the class loader of one class is the parent of the class loader of
the other path, I think you should be okay.  If not, you'll need to have
at least one interface that is loaded by a mutual parent in order for
the two classes to communicate without using reflection.

So, why exactly are you having this problem? Its not a common problem,
so I take it you have an unusual set up. It might help us to help you if
you tell us what your set up is and why.  We might be able to tell you
how to "fix" you setup or tell you a different approach to what you're
trying to do.

HTH,
Daniel.

Signature

Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.