  The quantum-mechanical collapse (alias fall onto the center of particles
attracted by potential -1/r^2), or "quantum anomaly", is a well-known issue in
the quantum theory. We demonstrate that the mean-field repulsive nonlinearity
prevents the collapse and thus puts forward a solution to the quantum-anomaly
problem different from that previously developed in the framework of the linear
quantum-field theory. This solution may be realized in the 3D or 2D gas of
dipolar bosons attracted by a central charge, and in the 2D gas of magnetic
dipoles attracted by a current filament. In the 3D setting, the dipole-dipole
interactions are also taken into regard, in the mean-field approximation. In
lieu of the collapse, the cubic nonlinearity creates a 3D ground state (GS),
which does not exist in the respective linear Schroedinger equation (SE). The
addition of the harmonic trap gives rise to a tristability, in the case when
the SE still does not lead to the collapse. In the 2D setting, the cubic
nonlinearity is not strong enough to prevent the collapse; however, the quintic
term does it, creating the GS, as well as its counterparts carrying the angular
momentum (vorticity). Counter-intuitively, such self-trapped 2D modes exist
even in the case of a weakly repulsive potential 1/r^2. In the presence of the
harmonic trap, the 2D quintic model with a weakly repulsive central potential
1/r^2 gives rise to three confined modes, the middle one being unstable,
spontaneously developing into a breather. In both the 3D and 2D cases, the GS
wave functions are found in a numerical form, and also in the form of an
analytical approximation, which is asymptotically exact in the limit of the
large norm.
