Here I will provide you some basic information regarding fixing Xbox 360 DVD disc tray that keeps ejecting. But before proceeding I would like to remind you that if your Xbox 360 is within the warranty period then opening it will void the warranty. So keep this in mind before going for the fixing procedure.
To fix the disc tray that keeps ejecting first of all you need to switch off
your Xbox 360 and disconnect the cables that are attached with it. Now you will have to remove the front cover of the Xbox 360 to open up the disc tray. If you have any disk on the tray then remove it. Now push the DVD tray very gently inside in such a way so that half of the tray remains outside of the drive. This way you will be able to identify the rail easily.
When you have a clear view of the rail, you will need to insert a plastic ring within the rail. It will work like a cushion for the laser. Make sure that the ring sticks with the rail properly.
After this is done, you can give your Xbox 360 another shot to see whether the DVD disc tray keeps ejecting. Normally this easy trick works quite effectively to fix the DVD disc tray. To do the whole thing properly, I would recommend you to buy an Xbox 360 repair guide. You will find a very useful guide here at http://www.dtheatre.com/Xbox360Fixer/ which is not only effective to fix Xbox 360 DVD disc tray but has detail instruction about all kind of Xbox fix.