aspose file tools*
The moose likes Java in General and the fly likes Implementing class not recognized as implementer ( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Implementing class not recognized as implementer ("class identity crisis"?)" Watch "Implementing class not recognized as implementer ("class identity crisis"?)" New topic
Author

Implementing class not recognized as implementer ("class identity crisis"?)

Drews Clausen
Greenhorn

Joined: Jun 05, 2008
Posts: 6
Hey there,

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...
W Fay
Greenhorn

Joined: Feb 17, 2010
Posts: 3
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.

Drews Clausen
Greenhorn

Joined: Jun 05, 2008
Posts: 6
Hi again,

all tested environments are using Sun Java 6.

ubuntu: 1.6.0_15
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):
1.6.0_14
1.6.0_15
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. ;)

EDIT:
Just tested it with Windows 7 (64bit), which also doesn't work.
Version: 1.6.0_18
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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.
Drews Clausen
Greenhorn

Joined: Jun 05, 2008
Posts: 6
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.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Just put them on the class path and instantiate--I'm not sure what that doesn't do that you're trying to.
Drews Clausen
Greenhorn

Joined: Jun 05, 2008
Posts: 6
David Newton wrote:Just put them on the class path and instantiate--I'm not sure what that doesn't do that you're trying to.


The main problem is, that I don't really now the module folder's path before starting the program. Is there a way to "extend" the classpath AFTER starting the JVM? That might be really helpful. ;)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Implementing class not recognized as implementer ("class identity crisis"?)