Weierstrass simply observed that not every problem in the calculus of variations would have a solution. He considered the example $$D[y]=\int_{-1}^{1}x^2\left(\frac{d y}{dx}\right)^2dx\to \min,$$ where the functional $D[y]$ is minimized over continuous functions having piecewise continuous first derivatives in $[-1,1]$ and satisfying the boundary conditions $y(-1)=0$, $y(1)=1$. He proved that although there is a minimizing sequence $y_n=y_n(.)$ which makes $D[y_n]$ arbitrarily small, the minimal value of zero is never actually attained.
Weierstrass's result called into question the validity of Dirichlet's principle. However, it did not completely refute the specific applications of Dirichlet's principle to the boundary value problems for Laplace's equation developed by Green, Dirichlet, Riemann and others. For that reason some people refer to this result as Weierstrass's critique rather than Weierstrass's counterexample.