Generic error: “Error uploading to the iTunes Store” in submission

When I try to upload the new version of an app to the iTunes Store with Xcode I get error: "Error uploading to the iTunes Store". So I tried with the Application Loader and the information was slightly more specific:

/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/itms/bin/iTMSTransporter: line 171: [: Loader.app/Contents/itms/java/lib/rt.jar: integer expression expected


Error occurred during initialization of VM java/lang/ClassNotFoundException: error in opening JAR file /Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/itms/java/lib/rt.jar

What should I do to fix it?

I managed to fix the former problem by "debugging" the Apple software, by namely deleting the offending block at line 171 of iTMSTransporter. Unfortunately the latter problem is more irksome as the file correctly sits in the seached location.

Generic error: “Error uploading to the iTunes Store” in submission
 
 
Q