• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

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

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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. ;)
 
Climb the rope! CLIMB THE ROPE! You too tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic