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.

4 comments on “ClassNotFoundException : com.thoughtworks.xstream.io.HierarchicalStreamReader

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

    Reply
  2. 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.

    Reply

Leave a Comment

Your email address will not be published. Required fields are marked *