Do you ever initialize the encoder objects?
For example:
leftEncoder = new Encoder(0, 1, false, Encoder.EncodingType.k4X);
http://first.wpi.edu/FRC/roborio/rel...j/Encoder.html
Also for future reference, it would be helpful to post the entire error you get in addition to your code