Tomcat 6 and JSF 1.2

I am trying to get one the sample web apps that came with JSF 1.2to work in Tomcat 6 alpha. I saw this

http://forums.java.net/jive/thread.jspa?messageID=168287

and I added the files as suggested by "smlp" in that thread. That removed the first error. But it produces a call loop. Now I get the following error.

java.lang.StackOverflowError

java.lang.ThreadLocal.get(ThreadLocal.java:125)

com.sun.faces.config.ConfigureListener.getExternalContextDuringInitialize(ConfigureListener.java:318)

com.sun.faces.application.ApplicationAssociate.<init>(ApplicationAssociate.java:142)

com.sun.faces.application.ApplicationImpl.<init>(ApplicationImpl.java:136)

com.sun.faces.application.ApplicationFactoryImpl.getApplication(ApplicationFactoryImpl.java:96)

com.sun.faces.context.FacesContextImpl.getApplication(FacesContextImpl.java:166)

com.sun.faces.util.MessageFactory.getApplication(MessageFactory.java:210)

com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:101)

com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:80)

com.sun.faces.util.MessageUtils.getExceptionMessageString(MessageUtils.java:276)

com.sun.faces.application.ApplicationAssociate.<init>(ApplicationAssociate.java:144)

com.sun.faces.application.ApplicationImpl.<init>(ApplicationImpl.java:136)

com.sun.faces.application.ApplicationFactoryImpl.getApplication(ApplicationFactoryImpl.java:96)

com.sun.faces.context.FacesContextImpl.getApplication(FacesContextImpl.java:166)

com.sun.faces.util.MessageFactory.getApplication(MessageFactory.java:210)

com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:101)

[1748 byte] By [w234a] at [2007-10-3 8:54:54]
# 1
same error...
dev_0a at 2007-7-15 4:04:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Have you tried to see if you get the same error using JSF 1.1?I had problems using JSF1.2 and Tomcat 5.5, so i reverted to using JSF1.1 and it somehow worked. I dunno give a try...
Helltech83a at 2007-7-15 4:04:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
dev_0Thanks for the confirmation.Hopefully someone will help.Helltech831.1 works ok. But we want to learn 1.2
w234a at 2007-7-15 4:04:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
The RI team will take a look and report back here.
rlubkea at 2007-7-15 4:04:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
I replied to a few of the questions on the original thread that was quoted by the OP.I've just tried the latest Tomcat 6 alpha with 1.2_03 RC2 and didn't have any issues. What version of JSF are you trying when you get his error?
rlubkea at 2007-7-15 4:04:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
Thanks for your time, rlubke.I am using jsf-1.2_02-b03-FCSBut maybe I should try what you are using.
w234a at 2007-7-15 4:04:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7
I'll give 1.2_02 a shot as well.
rlubkea at 2007-7-15 4:04:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 8
IsJSF 1.2_03 RC2available by itself ? Link ?
w234a at 2007-7-15 4:04:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 9
https://javaserverfaces.dev.java.net Can't miss it - big orange button at the top of the page.
rlubkea at 2007-7-15 4:04:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 10

Thanks for your time, rlubke.

Ok, now I am working with Tomcat 6.0.0with JSF 1.2.03 . Here is what I did.

I copied the samples (jsf-cardemo.war jsf-guessNumber.war) into Tomcat's webapps folder.

I started and stopped Tomcat(to unpack the web apps).

I copied the contents of the lib folder of the JSF distribution into the lib folder of each web app(the two jars and the six dtds).

I created a META-INF folder as described by "smlp" at the first link I posted at the top of this.

Still same error as top of this.

w234a at 2007-7-15 4:04:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 11
You need to clear the cache when deploying a new library (at least that is my experience). Delete everything under TOMCAT_HOME/work, start the server, and try again.
rlubkea at 2007-7-15 4:04:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 12

Thanks, rlubke, deleting the work folders for the two web apps and starting again did get rid of my original error message.

Now the cardemo app comes up but I see the following message in console.

INFO: Initializing Sun's JavaServer Faces implementation (1.2_03-b04-FCS) for context '/jsf-cardemo'

Nov 7, 2006 2:50:50 PM com.sun.faces.spi.InjectionProviderFactory createInstance

WARNING: JSF1033: Resource injection is DISABLED.

Nov 7, 2006 2:50:50 PM com.sun.faces.config.ConfigureListener registerELResolver

AndListenerWithJsp

SEVERE: Error Instantiating ExpressionFactory

java.lang.ClassNotFoundException: com.sun.el.ExpressionFactoryImpl

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa

der.java:1354)

and when I click on the "more" button on the car image page I get this message

java.lang.NullPointerException

com.sun.faces.renderkit.html_basic.MenuRenderer.renderOption(MenuRenderer.java:503)

com.sun.faces.renderkit.html_basic.MenuRenderer.renderOptions(MenuRenderer.java:734)

com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:788)

com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:304)

javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:829)

com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:279)

com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:242)

javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:810)

javax.faces.component.UIComponent.encodeAll(UIComponent.java:884)

javax.faces.render.Renderer.encodeChildren(Renderer.java:137)

javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:810)

javax.faces.component.UIComponent.encodeAll(UIComponent.java:884)

javax.faces.component.UIComponent.encodeAll(UIComponent.java:890)

com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:247)

com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:171)

com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:134)

com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:248)

com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)

javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)

When I try to access the guessNumber app, I get a file download dialog box offering to download a file named jsf-guessNumber.

w234a at 2007-7-15 4:04:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 13
I stripped down the guessNumber app and created a very simple test app. It works with my present combination( Tomcat 6.0.0 with JSF 1.2.03 ). I will keep working.Thanks for the help.
w234a at 2007-7-15 4:04:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 14
Read my post at: http://forum.java.sun.com/thread.jspa?threadID=5156242
IMIa at 2007-7-15 4:04:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...