In 1815 Germany was a confederation which consists of 39 small states and was ruled by the two great powers Prussia and Austria. After the French Revolution the Vienna Congress decides to make the German Confederation to a "power vacuum" and a buffer state to prevent another revolution in Europe. The great powers, Great Britain, Prussia, Austria and Russia wanted to build up a new order in Europe with a balance of power so there wouldn't be any country that has the chance to rule on others.
At the same time the example of Napoleon spread out in Germany and the wish to have a unified Germany grew up in the heads of liberal aristocrats and the middle classes. There were different reasons why they wanted to have a unified country: Firstly they thought that if they had been unified they could have resisted Napoleon because they would have a strong army. Secondly they wanted to be like the other countries around which were unified, too, to make e.g. more profit by a common market. Thirdly they wanted to be independent from Austria because Metternich made up laws to keep his dominancy in the country.
But there was number of reasons why the idea of German Nationalism didn't make any effort between 1815 and 1847.
A very strong opponent of German Nationalism was Fürst von Metternich, who was the chancellor of Austria and the dominating person in the German Confederation. He wanted to keep his power and influence on Germany and a unified Germany would have its own leadership. To achieve his objectives he let the lower classes out of politics by let them live as they want and as they did before the French Revolution. Another thing he did was to make up laws on censorship and close down societies and clubs to prevent groups of young men as the "Burschenschaft" (founded 1817) talking about their national ideas and to spread these ideas to others. If teachers taught their pupils...