How do I fix sticky, sweet smelling areas on a pine cabinet I am repainting?

The sticky areas are most likely pitch (Sap) from the pine. The smell has a distinctively sweet, pine odor. There is nothing that will stop the pitch from coming through over the years. At best you can spot prime in areas but overall the pine will win.