Everyone dies, except Marius, Cosette, and the Thenardiers. That's about as happy an ending as Hamlet. ;)
More seriously, the main story is about the redemption of Jean Valjean, set against the misery of post-restoration France. Why should the ending not be uplifting? In the end, Valjean is fully redeemed and dies practically a saint, after being a hardened criminal to start.
RE: after being a hardened criminal to start.
19 YEARS FOR A LOAF OF BREAD !! I wonder how many years a few crumbs would be worth...