In Ecclesiastes 3, Solomon turned his expression of frustration on God who made him, concluding, “He has put eternity into man’s heart”. He understood what we come to realize eventually: our life is a constant longing for something better and when the better comes it doesn’t deliver what it promised. Solomon got it. On his own, he could not build satisfaction that would endure beyond the momentary.
Where true joy is found is in Christ and his forgiveness. Paul says in Romans 15 – May the God of hope fill you with all joy and peace in believing, so that by the power of the Holy Spirit you may abound in hope.