PDA

View Full Version : How do I load a Java Plugin?



piercer
05-04-2005, 07:30 PM
I have the following XML in my configuration file





<Name>MPHiLoPlugin</Name>
Java
<Scope>Room
<File>com.ntmedia.server.mphilo.MPHiLoElectroPlugin</File>
<Variables/>
</Plugin>
</Plugins>

ElectroServer starts up, it parses the XML without any noticeable problem (If I deliberately break the XML it throws an error). Then when it get sto the loading plugins part of the initialisation is outputs absolutely nothing


-=-=-=-=-=-=-=-=
Loading plugins

-=-=-=-=-=-=-=-=
Loading event handlers

So I do not know if it did or did not load the plugin successfully :-(

Then when I try to use the plugin in a room by (the *********'s are to hide company stuff)


var room:Object = new Object();
room.roomName = "************";
room.zone = "*************";
room.plugins = new Array();
var plugin:Object = new Object();
plugin.name = "MPHiLoPlugin";
room.plugins.push(plugin);
es.createRoom(room);

It throws the following error in the ElectroServer console window


SEVERE [10] (XmlHelper.BuildRoomFromXml): Errror building room level plugin. Message=Error instatantiating instance of Java plugin 'MPHiLoPlugin'

AAAAARRRRRRRRRRRRRRRRGGGGGGGGGGGGGGGGHHHHHHHHHHHHH HHH

I guess its a classpath thing, but there is no documentation on setting up the classpath correctly for this product.

I NEED to get this working, but its an incredibley frustrating experience. It would have been quicker to write my own server :-(

Any help gratefully appreciated

piercer
05-04-2005, 07:46 PM
Further info:

I have tried

jar file in my JDK's jre/lib/ext directory

jar file in my ElectroServer directory next to the ElectroServer jar

directory structur in both of the above

adding both of above to classpath

NOTHING WORKS, PLEASE HELP

webgeek
05-05-2005, 05:28 PM
Put the jar in the plugin folder of the server. It will be picked up automatically. You can also use the jre/lib/ext folder. I suspect you had the JDK installed already and used that one. The server installs it's own JDK. You need to be sure that you use the servers JDK to get the ext folder to work.