If I manually shuffle the contents of classpath.txt, I can make the
error go away, but I don't know any way to change the order of the
frameworks in that file at build time.
I've had to do this before. Add a shell script build phase as the
last phase in the application target (not application server). Use
perl or something similar to munge the classpath. For example, I have
some code that fails unless /System/Library/Java/ is at the top of
the classpath: