In the book `Measures, Integrals and Martingales' of René L. Schilling, pages 125-126, Jensen's inequality is stated in the following way:
"Recall that a function $V:[a,b]\rightarrow\mathbb R$ on an interval $[a,b]\subset\overline{\mathbb R}$ is $convex$ if $$V(tx+(1-t)y)\leq tV(x)+(1-t)V(y),\qquad0<t<1,$$ holds for all $x,y\in[a,b]$.
$\dots$
If $V:[0,\infty)\rightarrow\mathbb R$ is convex, then the extension $V:[0,\infty]\rightarrow(-\infty,\infty]$, where $V(\infty):=+\infty$ is again convex.
Theorem 13.13 (Jensen's inequality) Let $(X,\mathcal{A},\mu)$ be a measure space and $\mu$ a probability measure.
(i) Let $V:[0,\infty)\rightarrow[0,\infty)$ be a convex function and extend it to $[0,\infty]$ as above: $$V\left(\int ud\mu\right)\leq\int V(u)d\mu\quad\forall u\in\mathcal{M}(\mathcal{A}),u\geq0.$$ In particular, if $V(u)\in\mathcal{L}^1(\mu)$, $u\geq0$, then $u\in\mathcal{L}^1(\mu)$.
$\dots$
"
Now the following case seems to violate this statement:
Consider the following measure space: $X:=(0,1]$, $\mathcal{A}:=\mathcal{B}((0,1])$, $\mu:=\lambda^1$. Also, define $u(x):=\frac{1}{x^2}$ for all $x\in(0,1]$. Now $u$ is measurable.
Let $V(x):=e^{-x}$ for $x\in[0,\infty)$, and let $V(\infty):=\infty$. Then $V$ is convex.
This seems to satisfy the requirements of Jensen's inequality. However, we get $$V\left(\int ud\mu\right)=V\left(\int_0^1\frac{1}{x^2}dx\right)=V(\infty)=\infty$$ while $$\int V(u)d\mu=\int_0^1 e^{-\frac{1}{x^2}}dx<\int_0^11dx=1.$$ Is there a mistake in my reasoning? Or is there a mistake in the book? Of course, the function $u$ is not in $\mathcal L^1(\mu)$ in this case. However, this is not a requirement in Theorem 13.13.
The result is wrong as stated: Just take $V\equiv 0$ and non-integrable $u$.
But it can be repaired in the following way.
We only have to look into the case $\int u \ d \mu=+\infty$.
If $V(+\infty) < +\infty$ then $V(+\infty) = \inf_{x\in \mathbb R} V(x)$ by convexity, and the Jensen's inequality is fulfilled trivially.
Now assume $V(+\infty)=+\infty$. Then there are $x_1<x_2$ such that $V(x_1) < V(x_2) <+\infty$. Then the line through $(x_1,V(x_1))$ and $(x_2,V(x_2))$ is below the graph of $V$ for all $x>x_2$. And there are $a>0$ and $b$ such that $V(x)\ge \max(0, ax+b)$ for all $x$. Then $$ \int V(u) \ d \mu \ge \int_{\{x: \ u(x) > -b/a\}} V(u(x)) \ d\mu(x) \ge \int_{\{x: \ u(x) > -b/a\}} (au(x)+b) \ d\mu(x). $$ Since $\int u \ d\mu=+\infty$, we have $$ +\infty = a\int u\ d\mu = \int_{\{x: \ u(x) > -b/a\}} (au(x)+b) \ d\mu(x) + \underbrace{ \int_{\{x: \ u(x) \le -b/a\}} (au(x)+b) \ d\mu(x)}_{ \in \mathbb R}. $$ As $\mu$ is finite, it follows $\frac1a \int_{\{x: \ u(x) > -b/a\}} au(x)+b \ d\mu(x)=+\infty$, and which implies $\int V(u) \ d\mu=+\infty$, and the inequality is true.