Main Tutorials

ClassNotFoundException : com.thoughtworks.xstream.io.HierarchicalStreamReader

Problem

XML development in Spring MVC, via oxm , hit “HierarchicalStreamReader” class not found exception?


Caused by: java.lang.ClassNotFoundException: com.thoughtworks.xstream.io.HierarchicalStreamReader
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
	... 49 more

Solution

The class “HierarchicalStreamReader” class belong to “xstream.jar“. If you are using Maven, declares following dependency in your pom.xml file.


	<dependency>
		<groupId>com.thoughtworks.xstream</groupId>
		<artifactId>xstream</artifactId>
		<version>1.3.1</version>
	</dependency>
Note
For Ant user, just download the “xstream.jar” from http://xstream.codehaus.org/ directly.

About Author

author image
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

Subscribe
Notify of
4 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
PengYuyan
8 years ago

3Q

naveen
8 years ago

just add to the manifest.mf file in the related META-INF folder of projects.

Prateek
9 years ago

fyi – In my case by adding you suggested latest maven dependency not resolve issue, when I delete .m2 (local repository) and when I again import project, issue disappears.

sejing,lee
11 years ago

thanks!!!!^^;