LWJGL GL_INVALID_ENUM reason

I’m having a problem with [icode]org.lwjgl.opengl.GL11.glDrawElements(int mode, int count, int type, long indicesOffset)[/icode].

According to the documentation of OpenGL it gives a GL_INVALID_ENUM if the mode variable is not correct. But I’m sure the variable is correct:


		int err;
		while((err = GL11.glGetError()) != GL11.GL_NO_ERROR) {
			System.out.println("2.1:" + err);
		}
		glDrawElements(GL11.GL_TRIANGLES, ebo.getCapacity(), ebo.getType().glType,
				offset);
		while((err = GL11.glGetError()) != GL11.GL_NO_ERROR) {
			System.out.println("2.2:" + err);
		}

The output of the console: [icode]2.2:1280[/icode] which is GL_INVALID_ENUM

Did I miss something important in the documentation?