Cancerous tissue (in most cases) kills by growing uncontrolled and leaving no space for other cells. If the creature can control cell growth, cancer should not be an issue as it is in humans. If no cell can grow uncontrolled, it does not matter whether the cell is cancerous or not.
However, mutations, could be a problem, which leads to cells just not doing what they are supposed to be. You could solve this by using long-living stem cells which are in a frozen-like state, have a slow metabolism and don't do anything except replicating every hundred years. Then these stem cells could be a way to conserve the original genetic information.
Another option would be to just select the fittest cells for survival. The creature would then evolve over hundreds of years. Only the mechanism, which selects and controls cell growth and thus shape shifting has to be preserved and has to be able to perform this task over million of years. Maybe this is controlled by cells that have a slower growth rate than the rest of the tissue.
EDIT: If cancer means that the control of cell growth and shape shifting doesn't work for cancerous cells, cancer could be a problem. The shapeshifter could grow a layer of healthy cells around the cancerous tissue which does not allow any nutrients to enter inside the cancerous tissue, which lets the cancer cells die of hunger. (Note that cancer cells usually grow very fast and need a lot more nutrients than healthy cells). If the shapeshifter can controll the growth of cells into any shape, he can probably easilly detect if cells don't grow the way he wants and can thus detect the cancer cells.