<?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/"
		xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>Dan Walmsley &#187; maven2</title>
	<atom:link href="http://www.danwalmsley.com/tag/maven2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.danwalmsley.com</link>
	<description>Coding so you don&#039;t have to</description>
	<lastBuildDate>Mon, 02 Jan 2012 12:19:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<copyright>Copyright &#xA9; Dan Walmsley 2011 </copyright>
	<managingEditor>dan@danwalmsley.com (Dan Walmsley)</managingEditor>
	<webMaster>dan@danwalmsley.com (Dan Walmsley)</webMaster>
	<image>
		<url>http://www.danwalmsley.com/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
		<title>Dan Walmsley</title>
		<link>http://www.danwalmsley.com</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle></itunes:subtitle>
	<itunes:summary>Putting the nerd in comnerdedy</itunes:summary>
	<itunes:keywords></itunes:keywords>
	<itunes:category text="Society &#38; Culture" />
	<itunes:author>Dan Walmsley</itunes:author>
	<itunes:owner>
		<itunes:name>Dan Walmsley</itunes:name>
		<itunes:email>dan@danwalmsley.com</itunes:email>
	</itunes:owner>
	<itunes:block>no</itunes:block>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://www.danwalmsley.com/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<item>
		<title>Jackrabbit, Wicket, Tomcat, Maven2&#8230; hell.</title>
		<link>http://www.danwalmsley.com/2007/10/20/jackrabbit-wicket-tomcat-maven2-hell/</link>
		<comments>http://www.danwalmsley.com/2007/10/20/jackrabbit-wicket-tomcat-maven2-hell/#comments</comments>
		<pubDate>Sun, 21 Oct 2007 02:58:01 +0000</pubDate>
		<dc:creator>dan</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[jackrabbit]]></category>
		<category><![CDATA[jcr]]></category>
		<category><![CDATA[maven2]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[wicket]]></category>

		<guid isPermaLink="false">http://www.danwalmsley.com/2007/10/20/jackrabbit-wicket-tomcat-maven2-hell/</guid>
		<description><![CDATA[What follows is lessons learned migrating to the potentially magnificent Maven2 for dependency management. Put &#60;scope&#62;provided&#60;/scope&#62; on Tomcat shared resources in your pom.xml If you deploy jars as a shared &#8230; <a class="more" href="http://www.danwalmsley.com/2007/10/20/jackrabbit-wicket-tomcat-maven2-hell/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>What follows is lessons learned migrating to the potentially magnificent Maven2 for dependency management.</p>
<h2>Put &lt;scope&gt;provided&lt;/scope&gt; on Tomcat shared resources in your pom.xml</h2>
<p>If you deploy jars as a shared resource on Tomcat (i.e. put the jars in common/lib) then be sure to add the &lt;scope&gt;provided&lt;/scope&gt; to those dependencies in your project&#8217;s pom.xml. Otherwise, you&#8217;ll get absolutely daft class-cast errors on shared resources like:</p>
<p><code><br />
2007-10-21 12:42:19,425 ERROR 0-SNAPSHOT] - Servlet /myExample2-1.0-SNAPSHOT threw load() exception<br />
java.lang.ClassCastException: org.apache.jackrabbit.core.jndi.BindableRepository cannot be cast to org.apache.jackrabbit.core.jndi.BindableRepository<br />
</code></p>
<p>Hahahahahahaha I think I want to kill myself. The problem is that Tomcat&#8217;s shared libraries are loaded by a different classloader than your web-app&#8217;s shared libraries (which is nice in a way, because it means you can use different versions of log4j or whatever). </p>
<p>So the lesson here is: Anything you want created by Tomcat and loaded by name (e.g. &#8220;jcr/repository&#8221;), be sure to exclude from your WEB-INF/lib when you deploy.</p>
<h2>You can load the same shared resource by name for all apps</h2>
<p>Deploying a Maven2-enabled app using Codehaus Mojo is a breeze&#8230; unless you want to deploy a context with it. And a context is the only way to load up named shared resources like a Jackrabbit repository. The solution? </p>
<p>$TOMCAT_HOME/conf/Catalina/$HOSTNAME/context.xml.shared</p>
<p>The contents are loaded for all contexts. Brilliant.</p>
<h2><i>Class blahblah</i> violates loader constraints</h2>
<p>Oh no. This was awful. For me it was: </p>
<p><code><br />
2007-10-21 13:16:26,331 ERROR 0-SNAPSHOT] - Exception starting filter DataServlet<br />
java.lang.LinkageError: Class org/slf4j/ILoggerFactory violates loader constraints<br />
</code></p>
<p>I needed to scour the dependencies that Maven was loading into my webapp automatically and explicitly label them as provided.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danwalmsley.com/2007/10/20/jackrabbit-wicket-tomcat-maven2-hell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

