In 1840 France wanted to extend the Eastern frontier, which United Germany as a country. It was the first time after Napoleon had invaded 'Germany'.
Many nationalists did not like the idea of the French in their country and wanted them out.
The German princes stirred up nationalistic feelings in the German population to help raise armies to drive Napoleon's forces out of German territory. This was aided by the development of nationalist societies within the German universities.