Planting goldfish tanks can be tough... I recently gave up on doing it with my 55g goldfish tank
Uprooting is definitely the main problem, although those flexible metal root anchors can help. Algae is huge in my tank, b/c I leave the back and one side covered, so I think that it was overwhelming my plants.
Aside from algae, the goldfish left alone a few plants that may be considered safe. These included spade leaf, dwarf Sagittarius, varigated onion plant, and floating pennywort.
I'm sure java fern would probably work, as it is a tough plant, can be tied to driftwood (therefore not being picked out of the gravel by fish), and is supposed to be poor tasting.
Feeding your goldfish lettuce and veggies will also help keep them away from your plants.
Goldfish produce lots of nitrates, so the plants should like that
http://thegab.org/Articles/GoldfishPlantsLowTech.html