Piracy 'cannot be solved at sea'