how to get the viewplatform's location?

i do like this:
ViewingPlatform vp = u.getViewingPlatform();
vp.setCapability(ViewingPlatform.ALLOW_LOCAL_TO_VWORLD_READ);
Vector3d vpVect=new Vector3d();
Transform3D vpTrans=new Transform3D();
vp.getLocalToVworld(vpTrans);
vpTrans.get(vpVect);

it can be compiled,but has error information at runtime:

javax.media.j3d.RestrictedAccessException: Cannot modify capability bits on a li
ve or compiled object
at javax.media.j3d.SceneGraphObject.setCapability(SceneGraphObject.java:
101)
at ViewChangBehavior.processStimulus(ViewChangBehavior.java:44)
at javax.media.j3d.BehaviorScheduler.doWork(BehaviorScheduler.java:172)
at javax.media.j3d.J3dThread.run(J3dThread.java:250)