tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allistair Crossley" <Allistair.Cross...@QAS.com>
Subject RE: Java 1.4.2_08 and up breaks Jstl
Date Mon, 22 Aug 2005 09:21:52 GMT
If you do have com.jatse.api.User.getLanguage() then the problem is that language is null.
Test with

<c:if test="${empty person.language}">
  language is null
</c:if>

Allistair.

> -----Original Message-----
> From: Allistair Crossley 
> Sent: 22 August 2005 10:19
> To: Tomcat Users List
> Subject: RE: Java 1.4.2_08 and up breaks Jstl
> 
> 
> Ensure that your class members all have getters, since 
> person.language.localeName will call
> 
> person.getLanguage().getLocaleName()
> 
> Allistair.
> 
> > -----Original Message-----
> > From: Martyn Hiemstra [mailto:martyn@awfs.nl]
> > Sent: 22 August 2005 09:55
> > To: Tomcat Users List
> > Subject: Re: Java 1.4.2_08 and up breaks Jstl
> > 
> > 
> > Hi All
> > 
> > First of all my jsp file looks like this
> > 
> > Contents Jsp File:
> > <%@ page language="java" %>
> > <%@ page contentType="text/html; charset=UTF-8" %>
> > <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
> > <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
> > 
> > <c:out value="${person.language.localeName}" />
> > 
> > The error occures on the line with the person.language.localeName. 
> > Person is a object in the session. The code prints the locale 
> > name the 
> > person has chosen.
> > 
> > System
> > Debian Sarge
> > 
> > Tomcat:
> > Tomcat 5.0.27 (I have also tried 5.0.28)
> > 
> > Java
> > I have Java j2sdk 1.4.2_05 installed under 
> /opt/j2sdk1.4.2_05. I have 
> > created a sym link from /opt/java to /opt/j2sdk1.4.2_05.
> > I have JAVA_HOME point to /opt/java.
> > 
> > 
> > This runs perfectly. I then install j2sdk 1.4.2_08 under /opt 
> > and then 
> > have /opt/java point to /opt/j2sdk1.4.2_08.
> > 
> > I stop tomcat. Wait and check to see that no occurance is 
> > running in the 
> > memory anymore. I then start up tomcat. When calling the same 
> > jsp file 
> > that worked with the previous version of Java I get this 
> error in the 
> > catalina.out:
> > 2005-08-11 11:37:06 StandardWrapperValve[jsp]: 
> Servlet.service() for 
> > servlet jsp threw exception
> > javax.servlet.jsp.JspException: An error occurred while evaluating 
> > custom action attribute "value" with value 
> > "${person.language.localeName}": Unable to find a value for 
> > "language" 
> > in object of class "com.jatse.api.User" using operator "." (null)
> >     at 
> > org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evalu
> > ator.java:146)
> >     at 
> > org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evalu
> > ator.java:166)
> >     at 
> > org.apache.taglibs.standard.lang.support.ExpressionEvaluatorMa
> > nager.evaluate(ExpressionEvaluatorManager.java:112)
> >     at 
> > org.apache.taglibs.standard.tag.el.fmt.SetLocaleTag.evaluateEx
> > pressions(SetLocaleTag.java:141)
> >     at 
> > org.apache.taglibs.standard.tag.el.fmt.SetLocaleTag.doStartTag
> > (SetLocaleTag.java:101)
> >     at 
> > org.apache.jsp.index_jsp._jspx_meth_fmt_setLocale_0(index_jsp.
> > java:146)
> >     at org.apache.jsp.index_jsp._jspService(index_jsp.java:100)
> >     at 
> > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
> >     at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> >     at 
> > org.apache.jasper.servlet.JspServletWrapper.service(JspServlet
> > Wrapper.java:324)
> >     at 
> > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet
> > .java:292)
> >     at 
> > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
> >     at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> >     at 
> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilt
> > er(ApplicationFilterChain.java:237)
> >     at 
> > org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli
> > cationFilterChain.java:157)
> >     at 
> > 
> com.jatse.website.filters.PersonFilter.doFilter(PersonFilter.java:42)
> >     at 
> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilt
> > er(ApplicationFilterChain.java:186)
> >     at 
> > org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli
> > cationFilterChain.java:157)
> >     at 
> > com.jatse.website.filters.SetCharacterEncodingFilter.doFilter(
> SetCharacterEncodingFilter.java:128)
> >     at 
> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilt
> > er(ApplicationFilterChain.java:186)
> >     at 
> > org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli
> > cationFilterChain.java:157)
> >     at 
> > org.apache.catalina.core.StandardWrapperValve.invoke(StandardW
> > rapperValve.java:214)
> >     at 
> > org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> > ardValveContext.java:104)
> >     at 
> > org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> > ine.java:520)
> >     at 
> > org.apache.catalina.core.StandardContextValve.invokeInternal(S
> > tandardContextValve.java:198)
> >     at 
> > org.apache.catalina.core.StandardContextValve.invoke(StandardC
> > ontextValve.java:152)
> >     at 
> > org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> > ardValveContext.java:104)
> >     at 
> > org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> > ine.java:520)
> >     at 
> > org.apache.catalina.core.StandardHostValve.invoke(StandardHost
> > Valve.java:137)
> >     at 
> > org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> > ardValveContext.java:104)
> >     at 
> > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReport
> > Valve.java:117)
> >     at 
> > org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> > ardValveContext.java:102)
> >     at 
> > org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> > ine.java:520)
> >     at 
> > org.apache.catalina.core.StandardEngineValve.invoke(StandardEn
> > gineValve.java:109)
> >     at 
> > org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> > ardValveContext.java:104)
> >     at 
> > org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> > ine.java:520)
> >     at 
> > 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
> >     at 
> > org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.
> > java:160)
> >     at 
> > 
> org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
> >     at 
> > org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
> >     at 
> > org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
> > 
> > I see a blank page in the browser by the way.
> > 
> > You might thing ok there is something wrong with the User 
> class. So I 
> > added some extra lines before the jstl call:
> > 
> > <%
> >     // Person is a super class of User so casting the object 
> > to a Person 
> > object will do.
> >     Person person = (Person)session.getAttribute("person");
> >     System.out.println("Language = " + 
> > person.getLanguage().getLocaleName());
> > %>
> > 
> > Language = EN appears in the catalina out, so you can 
> > conclude that the 
> > jsp code can read the Language locale name in User but jstl cant.
> > 
> > I then had /opt/java point back to /opt/j2sdk1.4.2_05 and restarted 
> > tomcat. I then call the same webpage and the now the page works.
> > 
> > My conclusion is that jstl in combination with  j2sdk 
> > 1.4.2_08 or higher 
> > is impossible. For some reason they wont work together.
> > 
> > Thanks in advance for any help you could offer,
> > Martyn
> > 
> > 
> > > It would probably help, if you would describe what you did 
> > (i.e. what 
> > > is your source code, your environment, tomcat version , 
> > etc.) and what 
> > > does mean "the bug happens" (i.e. error messages, stack 
> > traces, etc.)
> > >
> > > Now we have just the analogue of "My car works on road a 
> but not on 
> > > road b. Do you know what is wrong?"
> > >
> > > Christoph
> > >
> > > Martyn Hiemstra wrote:
> > >
> > >> Hi
> > >>
> > >>
> > >>> Do you have a link to a Sun Bugparade entry describing 
> > the problem?
> > >>
> > >>
> > >> No I don't.
> > >>
> > >> I have performed a test of my own.
> > >>
> > >> I have installed j2sdk 1.4.2_05 and j2sdk 1.4.2_08 and 
> > j2sdk 1.4.2_09.
> > >> I have installed these to the /opt directory. I have my 
> JAVA_HOME 
> > >> pointed
> > >> to /opt/java.
> > >>
> > >> First I point /opt/java to /opt/j2sdk1.4.2_09 and restart 
> > tomcat. The 
> > >> bug
> > >> happens again. I then point /opt/java to 
> > /opt/j2sdk1.4.2_08. I restart
> > >> tomcat and the same bug occures. I then point 
> /opt/j2sdk1.4.2_05 to
> > >> /opt/java, restart tomcat and BINGO no bug. Apparently 
> > versions java 
> > >> 2 sdk
> > >> 1.4.2_09 and java 2 sdk 1.4.2_08 cause the bug to occure 
> > just as in the
> > >> forum thread.
> > >>
> > >> I have tried a different tomcat version but no luck.
> > >>
> > >> Any ideas anybody? Maybe a configuration change that has 
> > occured in the
> > >> new java versions?
> > >>
> > >> Martyn
> > >>
> > >>
> > >>> Hi,
> > >>>
> > >>> I'm not convinced by that forum thread.
> > >>> It's very hard to believe that there is such a severe 
> bug in Java
> > >>> 1.4.2_06 *that isn't fixed yet*
> > >>>
> > >>> Do you have a link to a Sun Bugparade entry describing 
> > the problem?
> > >>>
> > >>>
> > >>> Christoph
> > >>>
> > >>> Martyn Hiemstra wrote:
> > >>>
> > >>>> Hi All
> > >>>>
> > >>>> I have found a Bug in Java 1.4.2_08 and Java 1.4.2_09.
> > >>>>
> > >>>> Goto this address to read about it:
> > >>>> http://forum.java.sun.com/thread.jspa?threadID=599301&tstart=0
> > >>>>
> > >>>> The new versions will break your jstl code and create 
> > errors in the 
> > >>>> log
> > >>>> and create blank pages.
> > >>>>
> > >>>> I have tried a new Tomcat version, no luck. I had it 
> running on 
> > >>>> another
> > >>>> server but that server is running on Java 1.4.2_05.
> > >>>>
> > >>>> So just a tip. Dont install Java 1.4.2_08 or higher. It 
> > will kill your
> > >>>> application if your using jstl.
> > >>>>
> > >>>> Martyn
> > >>>>
> > >>>>
> > >>>> 
> > 
> ---------------------------------------------------------------------
> > >>>> To unsubscribe, e-mail: 
> > tomcat-user-unsubscribe@jakarta.apache.org
> > >>>> For additional commands, e-mail: 
> > tomcat-user-help@jakarta.apache.org
> > >>>>
> > >>>
> > >>>
> > >>> 
> > 
> ---------------------------------------------------------------------
> > >>> To unsubscribe, e-mail: 
> tomcat-user-unsubscribe@jakarta.apache.org
> > >>> For additional commands, e-mail: 
> > tomcat-user-help@jakarta.apache.org
> > >>>
> > >>>
> > >>
> > >>
> > >>
> > >>
> > >> 
> > 
> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: 
> tomcat-user-unsubscribe@jakarta.apache.org
> > >> For additional commands, e-mail: 
> > tomcat-user-help@jakarta.apache.org
> > >>
> > >
> > >
> > > 
> > 
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: 
> tomcat-user-help@jakarta.apache.org
> > >
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> > 
> > 
> 
> 
> <FONT SIZE=1 FACE="VERDANA,ARIAL" COLOR=BLUE> 
> -------------------------------------------------------
> QAS Ltd.
> Registered in England: No 2582055
> Registered in Australia: No 082 851 474
> -------------------------------------------------------
> </FONT>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message