Problem running Spark

Hi everyone

I’'ve dowloaded sparkplug_kit_2_0_7.zip and I am trying to run the Spark that comes along with it. Either from my Eclipse IDE or the command line (running the startup.bat located in the spark/bin directory) I get the following:

MAIN_IMAGE not found.

Exception in thread “AWT-EventQueue-0” java.lang.NullPointerException

at org.jivesoftware.LoginDialog$ImagePanel.getPreferredSize(LoginDialog.java:815)

at java.awt.GridBagLayout.GetLayoutInfo(GridBagLayout.java:911)

at java.awt.GridBagLayout.getLayoutInfo(GridBagLayout.java:816)

at java.awt.GridBagLayout.preferredLayoutSize(GridBagLayout.java:636)

at java.awt.Container.preferredSize(Container.java:1558)

at java.awt.Container.getPreferredSize(Container.java:1543)

at javax.swing.JComponent.getPreferredSize(JComponent.java:1617)

at javax.swing.JRootPane$RootLayout.preferredLayoutSize(JRootPane.java:824)

at java.awt.Container.preferredSize(Container.java:1558)

at java.awt.Container.getPreferredSize(Container.java:1543)

at javax.swing.JComponent.getPreferredSize(JComponent.java:1617)

at java.awt.BorderLayout.preferredLayoutSize(BorderLayout.java:690)

at java.awt.Container.preferredSize(Container.java:1558)

at java.awt.Container.getPreferredSize(Container.java:1543)

at java.awt.Window.pack(Window.java:486)

at org.jivesoftware.LoginDialog.invoke(LoginDialog.java:155)

at org.jivesoftware.Spark.(Spark.java:39)

at org.jivesoftware.Spark$1.run(Spark.java:151)

at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java: 242)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:16 3)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

Does anybody have a clue about what’'s wrong?

Thanks,

Kiev

Try to add resources folder to the project.

Regrads,

Thiago

I had the same problem. The problem is caused because the MAIN_IMAGE key resolves to a classpath path of images/spark.png. Resources in the images/ path are contained in spark.jar. For some reason, the spark.jar in the sparkplugs toolkit is missing spark.png.

This resources is in the spark.jar that ships with Spark 2.0.7.

Unzip images/spark.png from the Spark 2.0.7 spark.jar int the sparkplugs/spark/resources/ directory. This directory should be on your classpath. You should end up with: sparkplugs/spark/resources/images/spark.png in the directory tree in which you installed the sparkplugs toolkit.

It’'s odd that this file would drop from spark.jar like that.

1 Like

thanks man that solved my problem