That's the problem. You need to shoot the boat in EU territorial waters and then refugees will not. All crimes committed solely because of the fact that there is no proper punishment. The violence in this case is justified.
I think that's what Australia does, but it may be ineffective. From what I know many illegal immigrants (aka the "refugees") especially from Somalia would sink their boats on purpose as soon as they see the coast guard, leaving the coast guard no choice but to rescue them (and later provide a shelter etc) or let them drown/swim to the shore on their own. So it's more complicated than just not letting them in.
On top of that there are some legit refugees among them (ie oppressed Christian minorities from islamic countries etc.) whose lives are under real threat and those probably should be given some sort of asylum.
I don't know what's the plausible solution to the problem ('kill them all with fire' doesn't count as such), but I know that if your asylum application is pending or rejected, you should be kept under surveillance in a locked centre and not be allowed to wander freely.