The other two examples provide examples showing that you need to assume your manifold is boundaryless. I want to show where the "usual" proof in the boundaryless case breaks down. So, here is the usual proof.
Exactness means $\omega = df$ for some smooth $f:M\rightarrow \mathbb{R}$. Because $M$ is compact, there is a $p\in M$ for which $f(p)$ is an absolute maximum.
We claim that $d_p f = 0$, so that $\omega = df$ is not non-vanishing. To show this, we pick $v\in T_p M$ and want to show that $(d_p f) v = 0$. To that end, let $\gamma:(-\epsilon, \epsilon)\rightarrow M$ be a smooth curve with $\gamma(0) = p$ and $\gamma'(0) = v$.
We want to show that $(d_p f) v = 0$, or, said another way, that $\frac{d}{dt}|_{t=0} f(\gamma(t)) = 0$. By definition of derivative, we need to show that $$\lim_{h\rightarrow 0} \frac{f(\gamma(h)) - f(\gamma(0))}{h} = 0.$$
First, the numerator is $f(\gamma(h) - f(p) \leq 0$ since $f(p)$ is a maximum of $f$. It follows that $\lim_{h\rightarrow 0^+} \frac{f(\gamma(h))- f(p)}{h} \leq 0$ and that $\lim_{h\rightarrow 0^-} \frac{ f(\gamma(h)) - f(p)}{h} \geq 0$.
By assumption, $\lim_{h\rightarrow 0} \frac{f(\gamma(h)) - f(p)}{h}$ exists, so the left and right hand limits must match. Since one is non-negative and the other is non-positive, the conclusion is that $\lim_{h\rightarrow 0} \frac{f(\gamma(h)) - f(p)}{h} = d_p f v = 0$. $\square$
$ \ $
So, where does this break down if $p\in \partial M$? Well, tangent vectors on the boundary are defined differently: you only need $\gamma$ to have a domain which is $(-\epsilon, 0]$ or $[0,\epsilon)$.
If we're in the case that the domain of $\gamma$ is $[0,\infty)$, then the one sided limit $\lim_{h\rightarrow 0^-} \frac{f(\gamma(h)) - f(p)}{h}$ no longer makes sense: $\gamma(h)$ doesn't make sense for negative $h$, so $f(\gamma(h))$ is meaningless.
Likewise, if the domain of $\gamma$ is $(-\epsilon, 0]$, then $\lim_{h\rightarrow 0^+} \frac{f(\gamma(h)) - f(p)}{h}$ no longer makes sense.
Thus, in either case, we lose one of the two inequalities. Without both, the proof no longer works to force $(d_p f) v = 0$. (And the other two answers show there is no way to "fix" the proof to handle the case where $p$ is a boundary point.)
Best Answer
By definition, the integral over a manifold of a top (volume) form must be positive. Thus, since we have that $\int_M \mu = 0$, this is the contradiction we are looking for and so we deduce that a volume form on a compact manifold is not exact.