  We show that there are harmonic functions on a ball ${\mathbb{B}_n}$ of
$\mathbb{R}^n$, $n\ge 2$, that are continuous up to the boundary (and even
H\"older continuous) but not in the Sobolev space $H^s(\mathbb{B}_n)$ for any
$s$ sufficiently big. The idea for the construction of these functions is
inspired by the two-dimensional example of a harmonic continuous function with
infinite energy presented by Hadamard in 1906. To obtain examples in any
dimension $n\ge 2$ we exploit certain series of spherical harmonics. As an
application, we verify that the regularity of the solutions that was proven for
a class of boundary value problems with nonlinear transmission conditions is,
in a sense, optimal.
