Door Ajar lamp comes on

I have a 1998 Subaru Outback Wagon with factory keyless entry, and the added factory security system. At times the drivers door ajar lamp comes on. I had first thought the door jamb switch was defective, si I replaced it but the problem still persists. I have found that if I turn the dome lamp off, then on the light goes out. Could there be a problem with the dome lamp jumper wire, the dome lamp itself, or something else all together?