What green flavors are you getting? What is your fermentation temp schedule? 4 wks is a long time in primary for a pale ale, so you shouldn't need to let it sit even longer warm in the keg. I'd look at your yeast/fermentation practices as mentioned by folks above - pitch rate, temp control, etc.