What version of Gazebo are you using? I don't think there is a JointStatePtr type.
I assume you followed the Velodyne tutorial. If this is true, then the VelodynePlugin does not have aJointPointer function.