You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Paul Dermody <pa...@gmail.com> on 2007/08/03 20:58:41 UTC
A serious bug in MyFaces?
I have a project that uses MyFaces 1.2.0, Servlets API 2.5, Tiles 2.0.4,
Hibernate 3.2.0, Tomcat 6. Now, I have only recently upgraded to MyFaces
1.2.0 and the new Servlep API.
Recently I tried to start using immediate JSP EL expressions but I am
getting an odd behaviour which I would like to know if anyone else has seen.
In my mfaces-config.xml I have the following Managed bean defined:
<managed-bean>
<managed-bean-name>myDate</managed-bean-name>
<managed-bean-class>java.util.Date</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
I have a JSP that contains the following:
<f:view>
<h:panelGrid columns="1">
<h:outputText value="myDate=#{myDate}" />
<h:outputText value="myDate.time=#{myDate.time} " />
<f:verbatim>
myDate = ${myDate}<br>
myDate.time = ${myDate.time}
</f:verbatim>
</h:panelGrid>
</f:view>
The output I am getting for this code is as follows:
myDate=Fri Aug 03 11:52:31 CST 2007
myDate.time=1186163551316
myDate = Fri Aug 03 11:52:31 CST 2007
myDate.time =
This behaviour is clearly wrong. For some reason the immediate EL expression
is not resolving the time property correctly.
I debugged this in Eclipse and I found that the "time" segment of the EL
expression is being resolved to 'null' via a sequence of calls that
eventually leads to the following stack trace:
date.jsp line: 10
org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(String,
Class, javax.servlet.jsp.PageContext,
org.apache.jasper.runtime.ProtectedFunctionMapper, boolean) line: 923
org.apache.el.ValueExpressionImpl.getValue(javax.el.ELContext) line:
186
org.apache.el.parser.AstValue.getValue(
org.apache.el.lang.EvaluationContext) line: 97
javax.el.CompositeELResolver.getValue( javax.el.ELContext, Object,
Object) line: 53
org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue
(javax.el.ELContext, Object, Object) line: 104
org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.invoke (
org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.ResolverInvoker<T>)
line: 148
org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver$4.invoke()
line: 108
org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.access$301 (
org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver,
javax.el.ELContext, Object, Object) line: 46
org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver(
javax.el.CompositeELResolver).getValue( javax.el.ELContext, Object, Object)
line: 53
org.apache.myfaces.el.convert.PropertyResolverToELResolver.getValue(
javax.el.ELContext, Object, Object) line: 106
org.apache.myfaces.el.convert.PropertyResolverToELResolver.invoke (
javax.el.ELContext, Object, Object,
org.apache.myfaces.el.convert.PropertyResolverToELResolver.ResolverInvoker<T>)
line: 193
org.apache.myfaces.el.convert.PropertyResolverToELResolver$3.invoke(Object,
Object) line: 115
org.apache.myfaces.el.DefaultPropertyResolver.getValue(Object, Object)
line: 64
The source of the deepest function is as follows:
public Object getValue(Object base, Object property) throws
EvaluationException, PropertyNotFoundException
{
updatePropertyResolved();
return null;
}
The updatePropertyResolved() function looks like this:
private void updatePropertyResolved()
{
FacesContext.getCurrentInstance
().getELContext().setPropertyResolved(false);
}
This function is setting the propertyResolved flag to false in the "current"
ELContext. This is necessary since the propertyResolved flag is set to true
before every call to each resolver. The current ELContext is of type
org.apache.myfaces.el.unified.FacesELContext and eclipse says it's id is
313.
However, when I look further up the stack it turns out that the
FacesCompositeELResolver checks to see if the "time" segment was resolved by
checking the value of the propertyResolved flag in a context object of type
org.apache.el.lang.EvaluationContext with id 266. Confusingly, this context
object delegates it's work to a different context object of type
org.apache.jasper.el.ELContextImpl with id 259. The point here is that it
seems to me that the wrong context object is being used somewhere - the
propertyResolved flag is being set in one object but check in a different
object!!
I may be way of track here - but this seems to be a bug or possibly a bad
combination of JARs in my classpath.
Can anyone confirm that this behaviour is a bug or that the problem lies
elsewhere?
Thanks,
Paul Dermody
Re: MyFaces 1.2.0, Trinidad-1.2.1, facelets-1.1.11
Posted by Duong BaTien <du...@gmail.com>.
Thanks. Yes, it needs jstl-1.2 for those who may have the same problem.
I manually get it from sun server.
On Sun, 2007-08-05 at 13:08 +0200, Matthias Wessendorf wrote:
> hi,
>
> myfaces api/impl says
> <dependency>
> <groupId>jstl</groupId>
> <artifactId>jstl</artifactId>
> <scope>provided</scope>
> </dependency>
>
> and the inherited version (from core's pom) is 1.2
>
> Greetings,
> Matthias
>
> On 8/5/07, Duong BaTien <du...@gmail.com> wrote:
> > On Sat, 2007-08-04 at 23:53 +0200, Matthias Wessendorf wrote:
> > > jstl 1.2 ?
> > >
> >
> > Thanks Matthias. Probably yes. I do not see it in the pom of your
> > facesgoodies. Do you have maven dependency of jstl-1.2 at hand?
> >
> > Thanks
> >
> > Duong BaTien
> > DBGROUPS and BudhNet
> >
> >
> > > On 8/4/07, Duong BaTien <du...@gmail.com> wrote:
> > > > Hello:
> > > >
> > > > Besides myfaces-api and myfaces-impl, what else do i need here?
> > > >
> > > > environment: Tomcat-6.0.14, myfaces-1.2. trinidad-1.2.1 (api and impl),
> > > > jsf-facelets-1.1.11, shale-core,view-1.0.4, toplink-2.41, ojdbc14_g,
> > > > spring-tomcat-waever-2.1, xcercesImpl-2.8.1, spring-jpa, web,aop-2.0.5
> > > >
> > > > Tomcat-6.0.14 has servlet-api, jsp-api and el-api in its lib. Do i need
> > > > el-impl? I use maven-2.0.7
> > > >
> > > > Thanks
> > > >
> > > > SEVERE: Servlet.service() for servlet faces threw exception
> > > > java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
> > > > at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView
> > > > (JspViewHandlerImpl.java:249)
> > > > at org.apache.shale.validator.faces.ValidatorViewHandler.renderView
> > > > (ValidatorViewHandler.java:130)
> > > > at org.apache.shale.view.faces.ViewViewHandler.renderView
> > > > (ViewViewHandler.java:147)
> > > > at javax.faces.application.ViewHandlerWrapper.renderView
> > > > (ViewHandlerWrapper.java:45)
> > > > at
> > > > org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:174)
> > > > at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute
> > > > (RenderResponseExecutor.java:41)
> > > > at org.apache.myfaces.lifecycle.LifecycleImpl.render
> > > > (LifecycleImpl.java:132)
> > > > at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
> > > > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > > > (ApplicationFilterChain.java:290)
> > > > at org.apache.catalina.core.ApplicationFilterChain.doFilter
> > > > (ApplicationFilterChain.java:206)
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Has anyone used inputHTML?
Posted by SO...@austin.rr.com.
Has anyone successfully used t:inputHTML? It doesn't seem to work for
me. Any suggestions for another HTML editor?
Re: MyFaces 1.2.0, Trinidad-1.2.1, facelets-1.1.11
Posted by Matthias Wessendorf <ma...@apache.org>.
hi,
myfaces api/impl says
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<scope>provided</scope>
</dependency>
and the inherited version (from core's pom) is 1.2
Greetings,
Matthias
On 8/5/07, Duong BaTien <du...@gmail.com> wrote:
> On Sat, 2007-08-04 at 23:53 +0200, Matthias Wessendorf wrote:
> > jstl 1.2 ?
> >
>
> Thanks Matthias. Probably yes. I do not see it in the pom of your
> facesgoodies. Do you have maven dependency of jstl-1.2 at hand?
>
> Thanks
>
> Duong BaTien
> DBGROUPS and BudhNet
>
>
> > On 8/4/07, Duong BaTien <du...@gmail.com> wrote:
> > > Hello:
> > >
> > > Besides myfaces-api and myfaces-impl, what else do i need here?
> > >
> > > environment: Tomcat-6.0.14, myfaces-1.2. trinidad-1.2.1 (api and impl),
> > > jsf-facelets-1.1.11, shale-core,view-1.0.4, toplink-2.41, ojdbc14_g,
> > > spring-tomcat-waever-2.1, xcercesImpl-2.8.1, spring-jpa, web,aop-2.0.5
> > >
> > > Tomcat-6.0.14 has servlet-api, jsp-api and el-api in its lib. Do i need
> > > el-impl? I use maven-2.0.7
> > >
> > > Thanks
> > >
> > > SEVERE: Servlet.service() for servlet faces threw exception
> > > java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
> > > at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView
> > > (JspViewHandlerImpl.java:249)
> > > at org.apache.shale.validator.faces.ValidatorViewHandler.renderView
> > > (ValidatorViewHandler.java:130)
> > > at org.apache.shale.view.faces.ViewViewHandler.renderView
> > > (ViewViewHandler.java:147)
> > > at javax.faces.application.ViewHandlerWrapper.renderView
> > > (ViewHandlerWrapper.java:45)
> > > at
> > > org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:174)
> > > at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute
> > > (RenderResponseExecutor.java:41)
> > > at org.apache.myfaces.lifecycle.LifecycleImpl.render
> > > (LifecycleImpl.java:132)
> > > at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
> > > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > > (ApplicationFilterChain.java:290)
> > > at org.apache.catalina.core.ApplicationFilterChain.doFilter
> > > (ApplicationFilterChain.java:206)
> > >
> > >
> > >
> >
> >
>
>
--
Matthias Wessendorf
further stuff:
blog: http://matthiaswessendorf.wordpress.com/
mail: matzew-at-apache-dot-org
Re: MyFaces 1.2.0, Trinidad-1.2.1, facelets-1.1.11
Posted by Duong BaTien <du...@gmail.com>.
On Sat, 2007-08-04 at 23:53 +0200, Matthias Wessendorf wrote:
> jstl 1.2 ?
>
Thanks Matthias. Probably yes. I do not see it in the pom of your
facesgoodies. Do you have maven dependency of jstl-1.2 at hand?
Thanks
Duong BaTien
DBGROUPS and BudhNet
> On 8/4/07, Duong BaTien <du...@gmail.com> wrote:
> > Hello:
> >
> > Besides myfaces-api and myfaces-impl, what else do i need here?
> >
> > environment: Tomcat-6.0.14, myfaces-1.2. trinidad-1.2.1 (api and impl),
> > jsf-facelets-1.1.11, shale-core,view-1.0.4, toplink-2.41, ojdbc14_g,
> > spring-tomcat-waever-2.1, xcercesImpl-2.8.1, spring-jpa, web,aop-2.0.5
> >
> > Tomcat-6.0.14 has servlet-api, jsp-api and el-api in its lib. Do i need
> > el-impl? I use maven-2.0.7
> >
> > Thanks
> >
> > SEVERE: Servlet.service() for servlet faces threw exception
> > java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
> > at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView
> > (JspViewHandlerImpl.java:249)
> > at org.apache.shale.validator.faces.ValidatorViewHandler.renderView
> > (ValidatorViewHandler.java:130)
> > at org.apache.shale.view.faces.ViewViewHandler.renderView
> > (ViewViewHandler.java:147)
> > at javax.faces.application.ViewHandlerWrapper.renderView
> > (ViewHandlerWrapper.java:45)
> > at
> > org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:174)
> > at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute
> > (RenderResponseExecutor.java:41)
> > at org.apache.myfaces.lifecycle.LifecycleImpl.render
> > (LifecycleImpl.java:132)
> > at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
> > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > (ApplicationFilterChain.java:290)
> > at org.apache.catalina.core.ApplicationFilterChain.doFilter
> > (ApplicationFilterChain.java:206)
> >
> >
> >
>
>
Re: MyFaces 1.2.0, Trinidad-1.2.1, facelets-1.1.11
Posted by Matthias Wessendorf <ma...@apache.org>.
jstl 1.2 ?
On 8/4/07, Duong BaTien <du...@gmail.com> wrote:
> Hello:
>
> Besides myfaces-api and myfaces-impl, what else do i need here?
>
> environment: Tomcat-6.0.14, myfaces-1.2. trinidad-1.2.1 (api and impl),
> jsf-facelets-1.1.11, shale-core,view-1.0.4, toplink-2.41, ojdbc14_g,
> spring-tomcat-waever-2.1, xcercesImpl-2.8.1, spring-jpa, web,aop-2.0.5
>
> Tomcat-6.0.14 has servlet-api, jsp-api and el-api in its lib. Do i need
> el-impl? I use maven-2.0.7
>
> Thanks
>
> SEVERE: Servlet.service() for servlet faces threw exception
> java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
> at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView
> (JspViewHandlerImpl.java:249)
> at org.apache.shale.validator.faces.ValidatorViewHandler.renderView
> (ValidatorViewHandler.java:130)
> at org.apache.shale.view.faces.ViewViewHandler.renderView
> (ViewViewHandler.java:147)
> at javax.faces.application.ViewHandlerWrapper.renderView
> (ViewHandlerWrapper.java:45)
> at
> org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:174)
> at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute
> (RenderResponseExecutor.java:41)
> at org.apache.myfaces.lifecycle.LifecycleImpl.render
> (LifecycleImpl.java:132)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> (ApplicationFilterChain.java:290)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter
> (ApplicationFilterChain.java:206)
>
>
>
--
Matthias Wessendorf
further stuff:
blog: http://matthiaswessendorf.wordpress.com/
mail: matzew-at-apache-dot-org
Re: MyFaces 1.2.0, Trinidad-1.2.1, facelets-1.1.11
Posted by Duong BaTien <du...@gmail.com>.
Hello:
Besides myfaces-api and myfaces-impl, what else do i need here?
environment: Tomcat-6.0.14, myfaces-1.2. trinidad-1.2.1 (api and impl),
jsf-facelets-1.1.11, shale-core,view-1.0.4, toplink-2.41, ojdbc14_g,
spring-tomcat-waever-2.1, xcercesImpl-2.8.1, spring-jpa, web,aop-2.0.5
Tomcat-6.0.14 has servlet-api, jsp-api and el-api in its lib. Do i need
el-impl? I use maven-2.0.7
Thanks
SEVERE: Servlet.service() for servlet faces threw exception
java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView
(JspViewHandlerImpl.java:249)
at org.apache.shale.validator.faces.ValidatorViewHandler.renderView
(ValidatorViewHandler.java:130)
at org.apache.shale.view.faces.ViewViewHandler.renderView
(ViewViewHandler.java:147)
at javax.faces.application.ViewHandlerWrapper.renderView
(ViewHandlerWrapper.java:45)
at
org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:174)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute
(RenderResponseExecutor.java:41)
at org.apache.myfaces.lifecycle.LifecycleImpl.render
(LifecycleImpl.java:132)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
Re: A serious bug in MyFaces?
Posted by Martin Marinschek <ma...@gmail.com>.
I wouldn't bet against a bug - handling the el-resolver chain is the
most complicated issue in JSF 1.2.
Can you file an issue?
regards,
Martin
On 8/3/07, Paul Dermody <pa...@gmail.com> wrote:
> I have a project that uses MyFaces 1.2.0, Servlets API 2.5, Tiles 2.0.4,
> Hibernate 3.2.0, Tomcat 6. Now, I have only recently upgraded to MyFaces
> 1.2.0 and the new Servlep API.
>
> Recently I tried to start using immediate JSP EL expressions but I am
> getting an odd behaviour which I would like to know if anyone else has seen.
>
> In my mfaces-config.xml I have the following Managed bean defined:
>
> <managed-bean>
> <managed-bean-name>myDate</managed-bean-name>
> <managed-bean-class>java.util.Date</managed-bean-class>
> <managed-bean-scope>session</managed-bean-scope>
> </managed-bean>
>
> I have a JSP that contains the following:
>
> <f:view>
> <h:panelGrid columns="1">
> <h:outputText value="myDate=#{myDate}" />
> <h:outputText value="myDate.time=#{myDate.time} " />
> <f:verbatim>
> myDate = ${myDate}<br>
> myDate.time = ${myDate.time}
> </f:verbatim>
> </h:panelGrid>
> </f:view>
>
> The output I am getting for this code is as follows:
>
> myDate=Fri Aug 03 11:52:31 CST 2007
> myDate.time=1186163551316
> myDate = Fri Aug 03 11:52:31 CST 2007
> myDate.time =
>
> This behaviour is clearly wrong. For some reason the immediate EL expression
> is not resolving the time property correctly.
>
> I debugged this in Eclipse and I found that the "time" segment of the EL
> expression is being resolved to 'null' via a sequence of calls that
> eventually leads to the following stack trace:
>
> date.jsp line: 10
>
> org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(String,
> Class, javax.servlet.jsp.PageContext,
> org.apache.jasper.runtime.ProtectedFunctionMapper, boolean)
> line: 923
>
> org.apache.el.ValueExpressionImpl.getValue(javax.el.ELContext)
> line: 186
>
> org.apache.el.parser.AstValue.getValue(org.apache.el.lang.EvaluationContext)
> line: 97
> javax.el.CompositeELResolver.getValue(
> javax.el.ELContext, Object, Object) line: 53
>
> org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(javax.el.ELContext,
> Object, Object) line: 104
>
> org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.invoke
> (org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.ResolverInvoker<T>)
> line: 148
>
> org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver$4.invoke()
> line: 108
>
> org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.access$301
> (org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver,
> javax.el.ELContext, Object, Object) line: 46
>
> org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver(javax.el.CompositeELResolver).getValue(
> javax.el.ELContext, Object, Object) line: 53
>
> org.apache.myfaces.el.convert.PropertyResolverToELResolver.getValue(javax.el.ELContext,
> Object, Object) line: 106
>
> org.apache.myfaces.el.convert.PropertyResolverToELResolver.invoke
> (javax.el.ELContext, Object, Object,
> org.apache.myfaces.el.convert.PropertyResolverToELResolver.ResolverInvoker<T>)
> line: 193
>
> org.apache.myfaces.el.convert.PropertyResolverToELResolver$3.invoke(Object,
> Object) line: 115
>
> org.apache.myfaces.el.DefaultPropertyResolver.getValue(Object,
> Object) line: 64
>
> The source of the deepest function is as follows:
>
> public Object getValue(Object base, Object property) throws
> EvaluationException, PropertyNotFoundException
> {
> updatePropertyResolved();
> return null;
> }
>
> The updatePropertyResolved() function looks like this:
>
> private void updatePropertyResolved()
> {
>
> FacesContext.getCurrentInstance().getELContext().setPropertyResolved(false);
> }
>
> This function is setting the propertyResolved flag to false in the "current"
> ELContext. This is necessary since the propertyResolved flag is set to true
> before every call to each resolver. The current ELContext is of type
> org.apache.myfaces.el.unified.FacesELContext and eclipse
> says it's id is 313.
>
> However, when I look further up the stack it turns out that the
> FacesCompositeELResolver checks to see if the "time" segment was resolved by
> checking the value of the propertyResolved flag in a context object of type
> org.apache.el.lang.EvaluationContext with id 266.
> Confusingly, this context object delegates it's work to a different context
> object of type org.apache.jasper.el.ELContextImpl with id
> 259. The point here is that it seems to me that the wrong context object is
> being used somewhere - the propertyResolved flag is being set in one object
> but check in a different object!!
>
> I may be way of track here - but this seems to be a bug or possibly a bad
> combination of JARs in my classpath.
>
> Can anyone confirm that this behaviour is a bug or that the problem lies
> elsewhere?
>
> Thanks,
>
> Paul Dermody
--
http://www.irian.at
Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German
Professional Support for Apache MyFaces