Problems setting up the camera [Solved]

Hello i followed the 13th tutorial of the wiki to set the camera but i am having problems. The example works fine but if i copy the portion i need to my project it does not work, this is my code:

private Camera cam;
private DisplaySystem display;

public void setCamera(){
         display= DisplaySystem.getDisplaySystem();
         cam = display.getRenderer().createCamera(display.getWidth(),
      } catch (JmeException e) {
         System.out.println("Could not create displaySystem");
      cam.setFrustumPerspective(45.0f, (float) display.getWidth()
            / (float) display.getHeight(), 1, 1000);
      Vector3f loc = new Vector3f(0.0f, 0.0f, 25.0f);
      Vector3f left = new Vector3f(-1.0f, 0.0f, 0.0f);
      Vector3f up = new Vector3f(0.0f, 1.0f, 0.0f);
      Vector3f dir = new Vector3f(0.0f, 0f, -1.0f);
      /** Move our camera to a correct place and orientation. */
      cam.setFrame(loc, left, up, dir);
      /** Signal that we've changed our camera's location/frustum. */
      /** Assign the camera to this renderer. */
      /** Create a basic input controller. */
      FirstPersonHandler firstPersonHandler = new FirstPersonHandler(cam);
      /** Signal to all key inputs they should work 10x faster. */
      input = firstPersonHandler;      

And this is the error:

07-jul-2010 0:08:34 com.jme.renderer.AbstractCamera <init>
INFO: Camera created.
Exception in thread "main" java.lang.NullPointerException
   at org.lwjgl.opengl.GL11.glMatrixMode(
   at com.jme.scene.state.lwjgl.records.RendererRecord.switchMode(
   at com.jme.renderer.lwjgl.LWJGLCamera.doFrustumChange(
   at com.jme.renderer.lwjgl.LWJGLCamera.apply(
   at com.jme.renderer.lwjgl.LWJGLRenderer.setCamera(
   at gamestates.GameState.setCamera(
   at gamestates.GameState.<init>(
   at main.Compas.main(

The problem becomes from this line:

What could be the problem?

I solved the problem adding this to code:
GameTaskQueueManager.getManager () .update(new Callable<Void>() {
    public Void call() {
        return null;
I read that the problem could come from the opengl thread and the java concurrency.