A couple of things:
1) You need to reference the camera differently:
Code:
server.startAutomaticCapture("cam1");
2) You need to call setSize to specify resolution:
Code:
server.setSize(1); // force 320x240
You should also
use the roboRIO WebDashboard to double-check that the rio sees the camera and that it's really on the cam1 port. Note that the link assumes you're using the Lifecam-3000, but holds true for any USB camera.
Also, be sure to select USB Camera SW on the default dashboard.