I'm currently working on a small program which loads additional modules dynamically on startup from a specific "module folder".
To handle jar-loading I'm using "JCL" (Jar Class Loader), a framework which seems to use the system class loader. Every "module"-jar must contain a class which implements a "Starter" interface.
So, what's my problem?
The Windows XP-JVM does'nt recognize the "Starter" classes as implementers of the "Starter" interface (the instanceof-test returns false). The odd thing is, that the same program with exactly the same jars works fine when running on Windows Vista or ubuntu Linux (I haven't tried on other platforms yet).
Does anyone know why the JVM is behaving like this and how to solve this problem?
I'm asking here because to me this seems to be a Java problem, not a problem with the framework...
Saying "Windows XP JVM" and Vista or Ubuntu JVM is not sufficient -- what specific version of the JVM (JRE) do you have installed in the various environments? If the versions are different, there may be very good reasons why this works in one place and not another.
You can get this by typing "java -version" at the command prompt.
Joined: Jun 05, 2008
all tested environments are using Sun Java 6.
Can't tell the Vista version, because I recently installed Windows 7 instead, but I think it was 1.6 Update 14 or above
Windows XP (tested on several different machines):
and another 1.6-Version, which I can't tell because I ran it on a colleague's machine. I'll be able to post his Java-Version tomorrow. ;)
Just tested it with Windows 7 (64bit), which also doesn't work.
Without any real details it's going to be impossible to help. Right now it seems like there might be an issue with the loader you're using, but it's hard to say.
Joined: Jun 05, 2008
When I'm back home I can post the method I'm using if this would be helpful.
Anyway, maybe I'm just thinking in the wrong direction.
Is there a way someone of you would recommend to dynamically load modules in a plugin-like way? If there is an easy-to-implement way using JavaSE classes I of course would prefer that rather than using a third party framework like the Jar Class Loader.