I would not recommend "canning" bread or cakes in jars. There are health risks in this process.
Here's some information from the National Center for Home Food Preservation:
Can I can bread or cake in a jar?
These products are not recommended for canning; choose recipes that you can freeze. In fact, most of these products are not really "canned." The directions call for baking in the jar and then closing with a canning lid. Many recipes for quick breads and cakes are low-acid and have the potential for supporting the growth of a bacteria like Clostridium botulinum if it is present inside the closed jar. One university's research showed a high potential for problems. You will see these products made commercially; however, additives, preservatives and processing controls not available for home recipes are used. Canning jar manufacturers also don't endorse baking in their canning jars.