Sparkplug development error

When i type “ant run” into the command line, myplugin.jar is built successfully.

However, when the script tries to deploy the plugin within spark to test out its functionality, i get the following error.

run:

Copying 1 file to /Users/michaelbotsakos/Desktop/spark/target/sparkplugs/spark/plugins

Exception in thread “main” java.lang.NoSuchMethodError: main

Java Result: 1

Any ideas…

Cheers,

Michael

Hi Michael,

Without seeing your build.xml file it’‘s hard to know exactly what the problem is but I would suspect that the classname you’'re pointing to does not have the main method for Spark. Below is the target we use for our sparkplug development:

<target name="run" depends="jar" description="Makes a plugin jar and starts Spark with that plugin">
       <copy todir="${basedir}/../spark/plugins"
           file="${plug.dir}/${plugin.name}"></copy>        <property name="sparklib" value="${basedir}/../spark/lib"></property>
       <java fork="true" classname="org.jivesoftware.launcher.Startup" dir="${basedir}/../spark/bin">
           <classpath>
               <fileset dir="${sparklib}">
                   <include name="**/*.jar"></include>
                   <include name="**/*.exe"></include>
                   <include name="**/*.dll"></include>
               </fileset>
               <pathelement location="${basedir}/../spark/resources"></pathelement>
            <fileset dir="${spark.home}/lib" includes="**/*.jar, **/*.zip"></fileset>
                        <!-- for OSX
               <pathelement location="/System/Library/Java" />
            -->
           </classpath>
           <jvmarg value="-Dappdir=${basedir}/../spark"></jvmarg>
       </java>
   </target>

Hope that helps,

Ryan

1 Like