Ok I finally found the mistake I made. It has neither something to do with Cayenne nor with Tomcat nor whatever. When building my project I use Ant and I had a build file with a copy statement and a filter token expression which was also applied to the binary class files...
http://ant.apache.org/manual/CoreTypes/filterset.html Note: When a filterset is used in an operation, the files are processed in text mode and the filters applied line by line. This means that the copy operations will typically corrupt binary files. When applying filters you should ensure that the set of files being filtered are all text files. It tooks me quite long, original file and filtered file had exactly the same length. There was only one different byte value... (BTW: I never intended to replace filter text in binaries ;-) Andreas.