How to build a plugin correctly?

Hello everybody,

a friend asked me to write a plugin for his Jive-Server, so i said ok and didn’'t realized what kind of hell i was walking in ;).

I guess my problem is easy to solve, but i’‘ve seen java first time today so it’'s a little bit tricky for me.

So, i created a simple file like the example in the documentation


package org.example;

import org.jivesoftware.messenger.container.Plugin;

import org.jivesoftware.messenger.container.PluginManager;

import java.io.File;

class extUser implements Plugin {

public void initializePlugin(PluginManager arg0, File arg1) {

}

public void destroyPlugin() {

}

}


and put a plugin.xml into the “root”-folder



I’'m not pretty sure what to do now, so i said eclipse to export all the stuff into an .jar file an put this into the plugin directory of the jive installation.

I tried different ways i thought it could be better but every time the error.log is happy to tell me something like this:

2005.09.29 17:29:13 [org.jivesoftware.messenger.container.PluginManager.loadPlugin(PluginManager.ja va:341)

] Error loading plugin

java.lang.ClassNotFoundException: org.example.extUser

Maybe somebody can tell what i’'m doing wrong ? hope

thx

Finn

Hi Finn,

Your code and xml file look fine. To build your plugin and to have it deployed into the plugins directory use the “plugins” target in the ant build.xml file.

Hope that helps,

Ryan

Hi Ryan,

thanks for your reply. What is “Ant” ? (Silly question ?)

Finn

Message was edited by:

Galeon

Ah, found it ^^. Thank you very much Ryan

Message was edited by:

Galeon

Hi Finn,

To quote the url=http://ant.apache.org/Ant[/url] website, “Apache Ant is a Java-based build tool. In theory, it is kind of like Make, but without Make’'s wrinkles.”

Once you’‘ve url=http://ant.apache.org/bindownload.cgidownloaded[/url] and url=http://ant.apache.org/manual/installlist.htmlinstalled[/url] Ant you’'ll be able to build plugins properly.

If you’‘re still having trouble after you’'ve got Ant running let us know.

Thanks,

Ryan

Thanks, i’'ve found it in the same minute.

You’'re great