Please check 2 things
1) Appropriate permissions has to be provided everything under wily folder.
2) Please check if the path is correct do following
cd /opt/local/appname/wily
cd /opt/local/appname/wily/core/config
Make sure Agent.jar and Agent profile file is exist under wily and config folder and has right permission.
let me know