dynamic type invocation in applets across jars

J

Jonathan Shore

I have not been able to determine a solution to the following problem:

- have an applet sourced from two jars (a.jar, b.jar)
- one a class in one jar attempts to instantiate a type dynamically in
other jar
- "a" has infrastructural classes and "b" has application classes.
"b" depends on "a", but "a" has machinery to instantiate a class in
"b".
- the applet tag lists the jars as: archive='a.jar,b.jar'

In an object created from a class in a.jar:

class.forName(<typename in jar b>)

fails with a ClassNotFoundException. I think this the problem is that
classes in a.jar are using a class loader that does not have top-level
access to the "a" and "b" jars.

I can't get access to the system class loader as am in a privileged
environment. Any thoughts on how to solve this?

Thanks

Jonathan Shore
CTO
Derive Inc
 
V

VK

Are both jars in the same directory (and on the same server of course)?
This is the only way it works.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top