It is possible to carry out the reaction either in organic solvents, such as ethers, for example tetrahydrofuran and dioxane, or alcohols, for example ethanol and propanol, or ketones, for example acetone or methyl ethyl ketone, or in dimethylformamide, ethyl acetate or pyridine, or in mixtures of these solvents with one another and/or with water.