Friday 24 April 2009

HIbernate equals/hashCode

Just to write this down:
When implementing equals() or hashCode() methods wich will be used in Hibernate, you should always use properties with real "business value" (keep your hands off the ID).
See also: http://www.hibernate.org/109.html

Eclipse fails to recognise tomcat startup

Some time ago i had a problem with starting tomcat from Eclipse. First time i couldn't solve this problem, but few months ago i run into it again.
Brief introduction to problem:
  1. Start tomcat
  2. Console says "Server startup in ...ms"
  3. Server's state still is "Starting..."
  4. After timeout it says "Server ... failed to start"
My problem was that first page (http://localhost/) contains a redirect. So Ecipse did receive status code 30x (instead of 200 OK). When I removed the redirect, it started working.
Of course, check WTP Tomcat FAQ for other possible problems.