Context: Metric type II bursts are the most direct diagnostic of shock waves in the solar corona. Aims: There are two main competing views about the origin of coronal shocks: that they originate in either blast waves ignited by the pressure pulse of a flare or piston-driven shocks due to coronal mass ejections (CMEs). We studied three well-observed type II bursts in an attempt to place tighter constraints on their origins. Methods: The type II bursts were observed by the ARTEMIS radio spectrograph and imaged by the Nanc{c}ay Radioheliograph (NRH) at least at two frequencies. To take advantage of projection effects, we selected events that occurred away from disk center. Results: In all events, both flares and CMEs were observed. In the first event, the speed of the shock was about 4200 km/s, while the speed of the CME was about 850 km/s. This discrepancy ruled out the CME as the primary shock driver. The CME may have played a role in the ignition of another shock that occurred just after the high speed one. A CME driver was excluded from the second event as well because the CMEs that appeared in the coronagraph data were not synchronized with the type II burst. In the third event, the kinematics of the CME which was determined by combining EUV and white light data was broadly consistent with the kinematics of the type II burst, and, therefore, the shock was probably CME-driven. Conclusions: Our study demonstrates the diversity of conditions that may lead to the generation of coronal shocks.