<?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>crossedstreams.com &#187; maven</title>
	<atom:link href="http://blog.crossedstreams.com/tag/maven/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.crossedstreams.com</link>
	<description>Total protonic reversal!</description>
	<lastBuildDate>Sat, 21 Jan 2012 20:10:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Running Apache MyFaces on Tomcat 5.5.x and below</title>
		<link>http://blog.crossedstreams.com/java/running-apache-myfaces-on-tomcat-55x-and-below/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=running-apache-myfaces-on-tomcat-55x-and-below</link>
		<comments>http://blog.crossedstreams.com/java/running-apache-myfaces-on-tomcat-55x-and-below/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 22:14:20 +0000</pubDate>
		<dc:creator>Paul Brabban</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[javaserver faces]]></category>
		<category><![CDATA[jsf]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[myfaces]]></category>
		<category><![CDATA[tomcat 5.5.x]]></category>

		<guid isPermaLink="false">http://blog.crossedstreams.com/?p=44</guid>
		<description><![CDATA[I&#8217;ve recently been looking at JavaServer Faces (specifically Apache&#8217;s MyFaces), playing about on my home Tomcat 5.5.27 installation, using Maven2 to do my dependency management, builds etc&#8230; &#8230;largely unsuccessfully. I just could not get the darned example app to start, with exceptions along the lines of: 20-Apr-2009 22:27:04 org.apache.catalina.core.StandardContext listenerStart SEVERE: Exception sending context initialized [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently been looking at <a href="http://www.ibm.com/developerworks/java/library/j-jsf1/index.html?S_TACT=105AGX02&amp;S_CMP=EDU" title="IBM Article on JSF">JavaServer Faces</a> (specifically Apache&#8217;s <a href="http://myfaces.apache.org/" title="Apache MyFaces">MyFaces</a>), playing about on my home Tomcat 5.5.27 installation, using <a href="http://maven.apache.org/" title="Apache Maven">Maven2</a> to do my dependency management, builds etc&#8230;</p>
<p>&#8230;largely unsuccessfully. I just could <em>not</em> get the darned example app to start, with exceptions along the lines of:</p>
<blockquote><p> 20-Apr-2009 22:27:04 org.apache.catalina.core.StandardContext listenerStart<br />
SEVERE: Exception sending context initialized event to listener instance of class org.apache.myfaces.webapp.StartupServletContextListener<br />
<strong>java.lang.NoClassDefFoundError: javax/el/ExpressionFactory</strong><br />
at org.apache.myfaces.webapp.StartupServletContextListener.getFacesInitializer&#8230;</p></blockquote>
<p>appearing in the tomcat localhost log files.<br />
<span id="more-44"></span></p>
<p>Solving the problem is easy when you know how, but it still took me a while to figure it out. There&#8217;s two versions of JSF and MyFaces, and by default when you set up your Maven project, you get the latest, greatest version, 1.2.x &#8211; which is incompatible with Tomcat versions below version 6.0. That&#8217;s what causes the exceptions above.</p>
<p>If you want to use Tomcat 5.5x or below, you&#8217;ll need MyFaces 1.1.x to get things working. If you&#8217;re using Maven, update the versions of myfaces-api and myfaces-impl in your pom.xml to refer to the 1.1.6 versions as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependencies<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.apache.myfaces.core<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>myfaces-api<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1.1.6<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;scope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>compile<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/scope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/dependencies<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.apache.myfaces.core<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>myfaces-impl<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1.1.6<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;scope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>compile<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/scope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  ...more stuff</pre></div></div>

<p>When I made these updates, the older versions were downloaded, and everything started working just fine.</p>
<div class="disclaimer">These are my thoughts and opinions and do not reflect
those of anyone else. Read the <a href="disclaimer">disclaimer</a> for more verbal
teflon.</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.crossedstreams.com/java/running-apache-myfaces-on-tomcat-55x-and-below/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

