2. Let $a$, $b$, and $c$ be the lengths of the sides of $\triangle ABC$, and
$$
|b-c| \cos \frac{A}{2}=8,(b+c) \sin \frac{A}{2}=15 \text {. }
$$

Then $a=$
2. 17 .

From the cosine theorem, we get
$$
\begin{aligned}
a^{2}= & b^{2}+c^{2}-2 b c \cos A \\
= & \left(b^{2}+c^{2}\right)\left(\sin ^{2} \frac{A}{2}+\cos ^{2} \frac{A}{2}\right)- \\
& 2 b c\left(\cos ^{2} \frac{A}{2}-\sin ^{2} \frac{A}{2}\right) \\
= & (b+c)^{2} \sin ^{2} \frac{A}{2}+(b-c)^{2} \cos ^{2} \frac{A}{2} \\
= & 15^{2}+8^{2}=17^{2} .
\end{aligned}
$$

Therefore, $a=17$.