<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JSF Blog &#187; exceptions</title>
	<atom:link href="http://www.jsfblog.info/tag/exceptions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jsfblog.info</link>
	<description>Discussion on all things Java and JSF</description>
	<lastBuildDate>Fri, 03 Feb 2012 20:24:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Maven site generation error: DTDDVFactoryImpl does not extend from DTDDVFactory</title>
		<link>http://www.jsfblog.info/2010/04/maven-site-generation-error-dtddvfactoryimpl-does-not-extend-from-dtddvfactory/</link>
		<comments>http://www.jsfblog.info/2010/04/maven-site-generation-error-dtddvfactoryimpl-does-not-extend-from-dtddvfactory/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 11:35:01 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[exceptions]]></category>
		<category><![CDATA[maven-site-plugin]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[xerces]]></category>

		<guid isPermaLink="false">http://www.jsfblog.info/?p=197</guid>
		<description><![CDATA[When generating a site with Maven, we encountered the following exception when a particular reporting plugin was executed: This basically meant that an incompatible version of xerces was trying to be run. We have everything set to use Java 1.6, which ships with its own version of xerces. After some debugging, it was tracked down [...]]]></description>
			<content:encoded><![CDATA[<p>When generating a site with Maven, we encountered the following exception when a particular reporting plugin was executed:</p>
<pre class="brush: plain; title: ; notranslate">
org.apache.xerces.impl.dv.DVFactoryException:
DTD factory class org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl does not extend from DTDDVFactory.
</pre>
<p>This basically meant that an incompatible version of xerces was trying to be run. We have everything set to use Java 1.6, which ships with its own version of xerces. After some debugging, it was tracked down to the <a title="Maven Site Plugin" href="http://maven.apache.org/plugins/maven-site-plugin/">maven-site-plugin</a> which we had recently upgraded to use version 2.1 of the plugin by specifying it in our pom file like so:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;pluginManagement&gt;
	&lt;plugins&gt;
		&lt;plugin&gt;
			&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
			&lt;artifactId&gt;maven-site-plugin&lt;/artifactId&gt;
			&lt;version&gt;2.1&lt;/version&gt;
		&lt;/plugin&gt;
	&lt;/plugins&gt;
&lt;/pluginManagement&gt;
</pre>
<p>The maven-site-site plugin has the following dependency structure:</p>
<ul>
<li>org.apache.maven.plugins:maven-site-plugin:maven-plugin:2.1
<ul>
<li>org.apache.maven.doxia:doxia-module-xhtml:jar:1.1.2 (compile)
<ul>
<li>org.apache.maven.doxia:doxia-core:jar:1.1.2 (compile)
<ul>
<li>xerces:xercesImpl:jar:2.8.1 (compile)</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>It is the dependency of the xercesImpl jar 2.8.1 that is the problem. To get around this issue, you can tell the maven-site-plugin to exclude a particular dependency. This can be done like so:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;pluginManagement&gt;
	&lt;plugins&gt;
		&lt;plugin&gt;
			&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
			&lt;artifactId&gt;maven-site-plugin&lt;/artifactId&gt;
			&lt;version&gt;2.1&lt;/version&gt;
			&lt;dependencies&gt;
				&lt;dependency&gt;
					&lt;groupId&gt;org.apache.maven.doxia&lt;/groupId&gt;
					&lt;artifactId&gt;doxia-core&lt;/artifactId&gt;
					&lt;version&gt;1.1.2&lt;/version&gt;
					&lt;exclusions&gt;
						&lt;exclusion&gt;
							&lt;groupId&gt;xerces&lt;/groupId&gt;
							&lt;artifactId&gt;xercesImpl&lt;/artifactId&gt;
						&lt;/exclusion&gt;
					&lt;/exclusions&gt;
				&lt;/dependency&gt;
			&lt;/dependencies&gt;
		&lt;/plugin&gt;
	&lt;/plugins&gt;
&lt;/pluginManagement&gt;
</pre>
<p>There are a couple of maven reporting plugins that we found produced this exception when run with maven-site-plugin 2.1. These plugins are:</p>
<ul>
<li><a title="DocFlax XML Maven Plugin" href="http://www.filigris.com/downloads/view/docflex_xml/maven/index.html">DocFlex/XML Maven Plugin</a></li>
<li><a title="Canoo Webtest Maven Plugin" href="http://people.apache.org/~sgoeschl/download/maven-plugins/webtest-maven-plugin/site/index.html">Canoo Webtest Maven Plugin</a></li>
</ul>
<p>If you use an older version of the maven-site-plugin then the above mentioned reporting plugins should work ok. It is only when specifying a version of 2.1 or above that the exception occurs.</p>
<p>Some of the solutions suggested on the net didn&#8217;t work for us, like adding the xercesImpl jar as a dependency to the actual reporting plugin in question, so hopefully the solution mentioned in this post is helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jsfblog.info/2010/04/maven-site-generation-error-dtddvfactoryimpl-does-not-extend-from-dtddvfactory/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

