Dishwasher fills then immediately drains

I have a GE dishwasher that when it fills with water it starts to drain soon after it begins to spray. So nothing gets washed because it is draining the water as soon as it starts to begin spraying. Is it a bad drain solenoid? I also have a leak in the middle at the bottom of the door. How do I fix this?