Not sure if its the entire problem, but from the first post it looks like when the server is starting it deploys an app, which loads a class that executes SQL which has a problem. Correct that and see if the issue is resolved.
Hope this helps.
Don't get me started about those stupid light bulbs.