aspose file tools*
The moose likes JSP and the fly likes Is it necessary to restart the server each time before running , when using JSTL? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Is it necessary to restart the server each time before running , when using JSTL?" Watch "Is it necessary to restart the server each time before running , when using JSTL?" New topic
Author

Is it necessary to restart the server each time before running , when using JSTL?

Vic Hood
Ranch Hand

Joined: Jan 05, 2011
Posts: 477

Hi Folks,
I've been trying to use JSTL to write JSP pages .However I noticed something,whenever I make any changes to my page , try to save and run the page without restarting the page throws an error as below.

exception

javax.servlet.ServletException: java.lang.NoSuchFieldError: deferredExpression
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:268)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717

However when I save the page and restart the server it works fine. Any idea why this could be happening?
Thanks.

Learning and Learning!-- Java all the way!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61612
    
  67

No, you do not need to restart anything when making a change to a JSP page, with the JSTL or not.

The reason for the problem is impossible to say without more information.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Vic Hood
Ranch Hand

Joined: Jan 05, 2011
Posts: 477

Thanks for replying Bear!
Hmm, but somehow I face the same error each time I try to run the page without restarting. What further information could help you analyze the case better ? I'm attaching the entire stacktrace below, if that's of any help.

HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: java.lang.NoSuchFieldError: deferredExpression
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:268)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause

java.lang.NoSuchFieldError: deferredExpression
org.apache.taglibs.standard.tag.common.core.ForEachSupport.release(ForEachSupport.java:196)
org.apache.jasper.runtime.TagHandlerPool.release(TagHandlerPool.java:166)
org.apache.jsp.POC_jsp._jspDestroy(POC_jsp.java:48)
org.apache.jasper.runtime.HttpJspBase.destroy(HttpJspBase.java:61)
org.apache.jasper.servlet.JspServletWrapper.destroy(JspServletWrapper.java:437)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:338)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.30 logs.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61612
    
  67

You'll need to show the reference to the bean property in the JSP, and the bean definition. Please use code tags. Please post only relevant code sections.
Vic Hood
Ranch Hand

Joined: Jan 05, 2011
Posts: 477

Thanks for the reply and Sorry about that.
Here's the relevant portion of the JSP.


And as for the bean definition are you talking about the bean class that defines the above beans?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61612
    
  67

Yes, need the bean code.

And I see no reference to deferredExpression in your JSP code.
Vic Hood
Ranch Hand

Joined: Jan 05, 2011
Posts: 477

Bear Bibeault wrote:Yes, need the bean code.

And I see no reference to deferredExpression in your JSP code.

Okay.I've pasted the entire code fragment as a paste's , as I'm not sure what could be causing the problem.
Well As for the bean code .
Here's the consumer .bean
And the DAO bean

And the entire JSP
Thank you for your time.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61612
    
  67

There is no reference I can find anywhere in that code to deferredExpression. Where is that coming from?
Vic Hood
Ranch Hand

Joined: Jan 05, 2011
Posts: 477

Bear Bibeault wrote:There is no reference I can find anywhere in that code to deferredExpression. Where is that coming from?

That is all I'm using right now. Could it be coming from some jar file in the class path?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18887
    
    8

Curiously, the error seems to be thrown when the container is trying to destroy the old version of the JSP...



or am I guessing wrong about what is happening there?
Vic Hood
Ranch Hand

Joined: Jan 05, 2011
Posts: 477

Paul Clapham wrote:Curiously, the error seems to be thrown when the container is trying to destroy the old version of the JSP...



or am I guessing wrong about what is happening there?

Old version of the jsp?I'm sorry but I'm completely lost on that one :x
However, I did notice from the stacktrace that the error is consistent, ie. when I try to run a different page under similar conditions , w/o restarting the server, I get the same error with the destroy method of the auto generated servlet of that page .
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18887
    
    8

Vic Hood wrote:Old version of the jsp?I'm sorry but I'm completely lost on that one :x


I thought you said you were replacing a JSP. That would have to mean that there was an old version which you were replacing by a new version, no?
Vic Hood
Ranch Hand

Joined: Jan 05, 2011
Posts: 477

Sorry, didn't get your question initially.
Uh , I was trying to run the same jsp , after making changes BUT without restarting the server, yes so that would be mean replacing it with a new version .
Vic Hood
Ranch Hand

Joined: Jan 05, 2011
Posts: 477

Hi Folks,
My vague guess about the problem coming from jar files, seemed to be true . Earlier, I was referencing three jar files related to jstl . jstl.jar, jstl1.1.2.jar and standard.jar however when I removed the reference to jstl 1.1.2 .jar , the problem seems to have solved itself.
Hope this helps anyone who faces the same problem in the future.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Is it necessary to restart the server each time before running , when using JSTL?