I have come across this error a second time and so decided to blog about it to avoid scratching my head again.
While using variable substitution in PI inbound file adapter, ensure that your variables are written in lowercase to prevent the following error:
Error during variable substitution: java.text.ParseException: Variable 'XXXXXX' not found in variable substitution table
The variable substitution table is found in the advanced tab in your file adapter settings in the Integration Directory.
Hope this helps someone.