Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

Collector Studio Throws NullPointerException When New Collector button is pressed

Created: 20 Dec 2011 • Updated: 10 May 2012 | 1 comment
This issue has been solved. See solution.

I am writing code for a new sensor.  I have followed the instructions provided in the documentation, built the .jar file with the correct manifest entries, etc.  When I run Collector Studio 2.46 I get the following exception w/ stack trace when I click the "New Collector" button.  Also, my new sensor type is not listed in step 4 of the wizard. 

The exception is thrown outside of my sensor code so I don't really have a good place to start looking for problems.  Obviously, I have paid special attention to the annotations section at the top of my sensor class (see below) but as far as I can tell it looks okay (just like the one given in the SampleSensor.java code).  Any tips on where to start on this one would be much appreciated.  Thanks in advance.

java.lang.NullPointerException
    at com.symantec.cas.ucf.configtool.datamodel.sensor.AnnotationsSensorLoader.listAnnotations(AnnotationsSensorLoader.java:103)
    at com.symantec.cas.ucf.configtool.datamodel.sensor.AnnotationsSensorLoader.initializeSensors(AnnotationsSensorLoader.java:68)
    at com.symantec.cas.ucf.configtool.datamodel.SensorModel.getSensorLoader(SensorModel.java:529)
    at com.symantec.cas.ucf.configtool.ui.SensorTypeChooserPanel.initComponents(SensorTypeChooserPanel.java:80)
    at com.symantec.cas.ucf.configtool.ui.SensorTypeChooserPanel.<init>(SensorTypeChooserPanel.java:64)
    at com.symantec.cas.ucf.configtool.CollectorWizard.initWizard(CollectorWizard.java:104)
    at com.symantec.cas.ucf.configtool.CollectorWizard.<init>(CollectorWizard.java:63)
    at com.symantec.cas.ucf.configtool.ConfigToolFrame$NewCollectorAction.actionPerformed(ConfigToolFrame.java:1632)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.java:6373)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
    at java.awt.Component.processEvent(Component.java:6138)
    at java.awt.Container.processEvent(Container.java:2085)
    at java.awt.Component.dispatchEventImpl(Component.java:4735)
    at java.awt.Container.dispatchEventImpl(Container.java:2143)
    at java.awt.Component.dispatchEvent(Component.java:4565)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4621)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4282)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
    at java.awt.Container.dispatchEventImpl(Container.java:2129)
    at java.awt.Window.dispatchEventImpl(Window.java:2478)
    at java.awt.Component.dispatchEvent(Component.java:4565)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:679)
    at java.awt.EventQueue.access$000(EventQueue.java:85)
    at java.awt.EventQueue$1.run(EventQueue.java:638)
    at java.awt.EventQueue$1.run(EventQueue.java:636)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
    at java.awt.EventQueue$2.run(EventQueue.java:652)
    at java.awt.EventQueue$2.run(EventQueue.java:650)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:649)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Annotations from .java sensor code;

@ConfigurableSensor(name = "NewSensor",
                                configurableProperties = { @ConfigurableProperty(name = "host",
                                                                                                          description = "Host Name",
                                                                                                          type = TYPE.STRING, required = true),
                                                                       @ConfigurableProperty(name = "port",
                                                                                                             description = "Port Number",
                                                                                                             type = TYPE.INT, required = true) })

Comments 1 CommentJump to latest comment

AlexanderVs's picture

Latest Studio version is 2.47, please use this version. If you get just exact the SampleSensor code from the Latest Enablement Pack, then build it and put senor jar into <Studio>/configtool/resource/sensor/lib then you will see it in the the list of the available sensors when create a new collector. Make sure you restarted the studio when put a new sensor. I just replaced annotations in Sample sensor with your annotations and it works. Recommendation is to use "New Sensor" (with space) instead of  "NewSensor"
@ConfigurableSensor(name = "New Sensor",         <= this is how it will be displayed in CS
 but again it is not the reason for your error.

Most probably you have problems with generating sensor jar, please make sure MANIFEST.MF is like this

Manifest-Version: 1.0
Name: UCF
Sensor-Version: 2.00.00
Product-Name: NewSensor                 <=use same name for the main sensor class,i.e.NewSensor.java
Product-Display-Name: New Sensor    <=how it will be displayed in SSIM/LU

Make sure they are under the section named "UCF"

SOLUTION