views:

679

answers:

2

I'm setting up my first job in Hudson, and I'm running into some problems. The job monitors two repositories, one containing our DB setup files, the other a bit of code that validates and tests the DB setup files.

Part of the code that runs will throw the validated setup files at PostgreSQL, using the psql command line tool, using Runtime.exec(). This code works perfectly on my machine, but when Hudson executes it (different machine) I get the following error:

java.io.IOException: Cannot run program "psql": CreateProcess error=2, The system cannot find the file specified

psql.exe is on the path, and I can execute it by typing the whole thing at the command line, from the same place Hudson is executing the code. The file that's meant to be passed into psql exists.

Any ideas?

+3  A: 

I find that you need to have the programme in the path when you launch hudson or the slave. Despite having the ability to set the path in hudson it doesn't seem to work. You could also put the full path in the command, which is really a good idea from a security perspective anyway.

stimms
I restarted the severlet container and it seems to be working (in that it's not saying it can't find psql). Cheers
rjohnston
A: 

Are both machines using the same OS ? Perhaps you need psql.exe on windows.

Tom