I am working on a simple java background process that handles data from socket connections and then uses the mysql connector JDBC driver to establish a connection to a database where this info is stored. I want to use upstart to use the program as a service, but after initializing my service the process will fail out after the first upload tries to access the JDBC driver to insert data into the database (doesn't fail on jdbc register, however this is my best assumption from monitoring the output although a stacktrace is never shown in my logs). If I remove the exit call from the catch statement in the program I can watch the process continually receive the uploads but no data will actually be stored in the mysql database.
When running the java program normally from the console it executes without any issues. The section of the upstart .conf below points to the same program I can run without any problems.
script
echo $$ > /var/run/uploadclient.pid
exec java -cp /user/server UploadProgram >> /home/user/upload.log
end script
Has anyone heard of a problem like this before?