A solenoid may bounce back and forth because there isn't enough power to hold the solenoid in its cranking position, so it's just at the point between kicking out the pinion clutch but not quite enough to crank. I'd bet battery cables, check that they were pushed down enough on terminals, terminals are slightly tapered for a good fit and good contact. Battery could of course be bad, what type of battery is it? If conventional, they are stored dry, check the cells if possible. If its any other type it's probably just been sitting too long, make sure its been fully charged, they will discharge over time sitting.