JB Weld can work wonders. I had a cousin that owned a Marina at St. Helens, Oregon, on the Columbia, and he even used it to mend outboard motor driveshafts.
That said, however, you have to use it properly, like Gerald said, or it won't work. My experience has taught me to thoroughly clean the area, and then roughen each bonding surface with coarse sandpaper or a file first; this exponentially expands the area the epoxy contacts, and gives it some "bite" to resist coming loose or failing. Take into account when applying the stuff that it will sag, especially on vertical surface application; in that instance, I apply the epoxy in thin amounts in multiple applications, so each layer dries and sets up a bit and doesn't sag much before applying the next one. A popsickle stick makes a handy applicator. A heavy application spread over a large roughened area and allowed to cure adequately should hold well for awhile.
But like David commented, eventually you'll want to reweld or rivet the repair to give yourself peace of mind down the road. A bay door coming off on the road could play havoc with following or adjoining traffic, not to mention bay contents coming out, so don't consider epoxy a permanent fix.