Yanzi

Spark plugin problem

Discussion created by Yanzi on Aug 26, 2006
Latest reply on Aug 28, 2006 by Yanzi

I am trying to learn a simple plugin which is going to add new menu item,

++++++++++++++++++

package org.jivesoftware.sparkimpl.plugin.locgroups;

public void initialize() {

     JMenu locPluginMenu = new JMenu("New Menu");

        SparkManager.getMainWindow().getJMenuBar().add(locPluginMenu);

        //final JMenu actionsMenu = SparkManager.getMainWindow().getMenuByName("Spark");

        JMenuItem locGroupsMenu = new JMenuItem("My Profile", SparkRes.getImageIcon(SparkRes.MEGAPHONE_16x16));

        ResourceUtils.resButton(locGroupsMenu , "&My Profile");

        locPluginMenu.add(locGroupsMenu );

 

}

++++++++++++++++++

My src file is under

Spark\target\sparkplugs\builder\src\org\jivesoftware\sparkimpl\plugin\locroups

 

My plugin.xml is,

++++++++++++++++++

 

++++++++++++++++++

Then I tried to use spark to build the plugin, it is compiled. If I run the .\Spark\target\sparkplugs\spark\bin\startup I will get the ClassNotFound error when loading my plugin class.

Aug 27, 2006 2:36:03 AM org.jivesoftware.spark.util.log.Log error

SEVERE: Unable to load plugin org.jivesoftware.sparkimpl.plugin.locgroups.

java.lang.ClassNotFoundException: org.jivesoftware.sparkimpl.plugin.locgroups

     at java.net.URLClassLoader$1.run(Unknown Source)

     at java.security.AccessController.doPrivileged(Native Method)

     at java.net.URLClassLoader.findClass(Unknown Source)

     at java.lang.ClassLoader.loadClass(Unknown Source)

     at java.lang.ClassLoader.loadClass(Unknown Source)

     at org.jivesoftware.spark.PluginManager.loadPublicPlugin(PluginManager.java:241)

     at org.jivesoftware.spark.PluginManager.loadPlugins(PluginManager.java:171)

     at org.jivesoftware.spark.Workspace$4.finished(Workspace.java:258)

     at org.jivesoftware.spark.util.SwingWorker$2$1.run(SwingWorker.java:139)

     at java.awt.event.InvocationEvent.dispatch(Unknown Source)

     at java.awt.EventQueue.dispatchEvent(Unknown Source)

     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

     at java.awt.EventDispatchThread.run(Unknown Source)

 

If I use the build file ANT run I got the following,

 

     Exception in thread "Thread-2" java.lang.UnsatisfiedLinkError: no tray in java.library.path

     at java.lang.ClassLoader.loadLibrary(Unknown Source)

     at java.lang.Runtime.loadLibrary0(Unknown Source)

     at java.lang.System.loadLibrary(Unknown Source)

     at org.jdesktop.jdic.tray.internal.impl.GnomeSystemTrayService.(Unknown Source)

     at org.jdesktop.jdic.tray.internal.impl.ServiceManagerStub.getService(Unknown Source)

     at org.jdesktop.jdic.tray.internal.ServiceManager.getService(Unknown Source)

     at org.jdesktop.jdic.tray.SystemTray.(Unknown Source)

     at org.jivesoftware.spark.component.Notifications.(Notifications.java:86)

     at org.jivesoftware.spark.SparkManager.getNotificationsEngine(SparkManager.java:20 6)

     at org.jivesoftware.spark.Workspace.buildLayout(Workspace.java:191)

     at org.jivesoftware.LoginDialog.startSpark(LoginDialog.java:711)

     at org.jivesoftware.LoginDialog.access$600(LoginDialog.java:72)

     at org.jivesoftware.LoginDialog$LoginPanel$1.construct(LoginDialog.java:490)

     at org.jivesoftware.spark.util.SwingWorker$2.run(SwingWorker.java:132)

     at java.lang.Thread.run(Unknown Source)

 

Please help,

Thanks,

Outcomes