Registering controller class

Hey guys,

recently I came upon small problem.

I have defined myself a control in my xml file that has a controller class defined.

I used it in a popup and everything works fine except for the controller class.

My application is based on OSGI and all nifty is located in a different bundle than where the controller is defined.

That is why the instantiation of my controller class fails (java.class.ClassNotFoundException is being thrown).

Is there a way to inform nifty that such controller class exists ??

I can do that with ScreenControllers only and it works great. I can define screen controller in the xml file and it is being loaded.



The reason is OSGI, read up on how it handles classloaders. Its the same as the NetBeans modules, they are separated per plugin.

My nifty bundle is completely independent on the game bundle. The game bundle requires nifty bundle to start but not the other way.

So in game bundle I can load every class exported from nifty bundle but not the other way. Even if my game bundle exports the class.

At least this is how I understand this, but maybe I am wrong and I missed something.

If I am wrong then please give me some clues to allow nifty bundle classloader to load my class.

And if I am correct then I see no workaround to that.

I have had this problem before but then registering screen controllers saved the day :slight_smile:

I don’t know, as said, its specific to OGSI, it has nothing to do with jme. I could tell you how to do it with NetBeans modules but I fail to see the point to use such a system (osgi, netbeans modules, maven) for a games libraries anyway?