powered by Jive Software

Plugin could not install

I’ve downloaded Sparkplug and Spark SVN and compiled the ExamplePlugin (From SparkPlug Docs). But when I copied myplugin.jar file into Spark installation plugin directory it doesn’t works. Following Error log into error.log

Jul 16, 2010 12:15:48 PM org.jivesoftware.spark.util.log.Log error
SEVERE: Unable to load plugin ExamplePlugin due to no minSparkVersion.
Jul 16, 2010 12:25:12 PM org.jivesoftware.spark.util.log.Log error
SEVERE: Unable to load plugin ExamplePlugin due to no minSparkVersion.
Jul 16, 2010 1:02:43 PM org.jivesoftware.spark.util.log.Log error
SEVERE: Unable to load plugin ExamplePlugin due to no minSparkVersion.
Jul 16, 2010 1:12:57 PM org.jivesoftware.spark.util.log.Log error
SEVERE: Unable to load plugin ExamplePlugin due to no minSparkVersion.
Jul 16, 2010 1:12:57 PM org.jivesoftware.spark.util.log.Log error
SEVERE: Unable to load plugin com.mypackage.MyPlugin.
java.lang.ClassNotFoundException: com.mypackage.MyPlugin
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:266)
at org.jivesoftware.spark.PluginManager.loadPublicPlugins(PluginManager.java:532)
at org.jivesoftware.spark.PluginManager.loadPlugins(PluginManager.java:170)
at org.jivesoftware.spark.Workspace$4.run(Workspace.java:257)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Jul 17, 2010 3:41:38 AM org.jivesoftware.spark.util.log.Log error
SEVERE: Unable to load plugin com.mypackage.ExamplePlugin.
java.lang.ClassNotFoundException: com.mypackage.ExamplePlugin
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:266)
at org.jivesoftware.spark.PluginManager.loadPublicPlugins(PluginManager.java:532)
at org.jivesoftware.spark.PluginManager.loadPlugins(PluginManager.java:170)
at org.jivesoftware.spark.Workspace$4.run(Workspace.java:257)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Does any one help me.

Thanks

you can debug PluginManager.loadPublicPlugins()。Spark first update the classpath(add public jars), then read plugin.xml in each jar, and load the plugin class.

Thank you very much but I am quit new to Java. I have done following steps.

(1) I install Java and Ant. (JAVA_HOME = C:\Program Files\Java\jdk1.6.0_21)

(2) Download Sparkplug kit (C:\Users\oldboy\Downloads\sparkplug_kit_2_0_7\sparkplugs)

(3) Download Spark SVN (C:\Spark)

(4) CLASSPATH = C:\Spark\src\java;C:\Users\oldboy\Downloads\sparkplug_kit_2_0_7\sparkplugs\spar k\lib;C:\Users\oldboy\Downloads\sparkplug_kit_2_0_7\sparkplugs\spark\lib\windows ;C:\Users\oldboy\Downloads\sparkplug_kit_2_0_7\sparkplugs\spark\resources

(5) Copy ExamplePlugin code from Sparplug kit Developers Guide, 1st example.

(6) Complie with javac

(7) Then place ExamplePlugin.class in Sparkplug\builder\lib and ExamplePlugin.java in Sparkplug\builder\src

(8) Edite plugin.xml with org.jivesoftware.Spark.plugins.myplugin

(9) Ant Run create ExamplePlugin.jar.

(10) Copy ExamplePlugin.jar into Spark installation plugin directory.

Any thing which I did wrong? For you reference I attached files here with.

Thanks for your time.
plugin.xml.zip (371 Bytes)
ExamplePlugin.java.zip (634 Bytes)
ExamplePlugin.jar (1900 Bytes)

your plugin class’s package is not right.

package org.jivesoftware.spark.examples; // this is your plugin class’s package.

org.jivesoftware.Spark.plugins.ExamplePlugin // this is in plugin.xml that locate the plugin class

they are different, so java says ClassNotFound!

when you have fixed this, Spark will unzip ExamplePlugin.jar to a dir, and read the plugin.xml.

Thanks hwxia, it was helpfull. furhter what I did make directories org.jivesoftware.Spark.examples in my sparkplug src directory. then create jar.

Thanks