It may just be the lens -- sometimes the glue fails. Most likely you'll have to replace the whole carriage assembly. Either way -- not a DIY job unless you can get the parts yourself (it is possible for some brands) and have the required skills -- static damage being a particular hazard.
By the way, have you looked at the price of secondhand CD players on e-bay-- probably cheaper to replace the whole player than pay someone to repair it.
Thanks for your advice, much apprecited. I was not sure how the lens was held in position. I have the lens that fell down and it is fine. So it would be best for me to give it to local service shop for them to glue the lens in position and test it. This should not cost much as no replacement is required.