• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to compile class for JSP

 
prashan dassanayake
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can access few pages from the web program while most of pages cannot be accessed.This web program is currently successfully run in another server in usa.So i think there is no errors in codings.But there must be some needed library missing or something else missing as i feel.Please help me to find a solution for errors in program.This is the error i got when trying to access some pages of website.

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 316 in the jsp file: /pages/order/viewOrders.jsp
Generated servlet error:
The method setAttribute(String, Object) in the type HttpSession is not applicable for the arguments (String, boolean)

An error occurred at line: 375 in the jsp file: /pages/order/viewOrders.jsp
Generated servlet error:
Type mismatch: cannot convert from Object to BranchModel

An error occurred at line: 397 in the jsp file: /pages/order/viewOrders.jsp
Generated servlet error:
Type mismatch: cannot convert from Object to FacilityModel


org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1062)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


root cause

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 316 in the jsp file: /pages/order/viewOrders.jsp
Generated servlet error:
The method setAttribute(String, Object) in the type HttpSession is not applicable for the arguments (String, boolean)

An error occurred at line: 375 in the jsp file: /pages/order/viewOrders.jsp
Generated servlet error:
Type mismatch: cannot convert from Object to BranchModel

An error occurred at line: 397 in the jsp file: /pages/order/viewOrders.jsp
Generated servlet error:
Type mismatch: cannot convert from Object to FacilityModel


org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1062)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


please tel me what is the library im missing and where should be it included or the error something different from i'm believing.
 
Satish Chilukuri
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please do not start multiple threads for the same question.

There are some compilation errors in your JSP. One is the same as your earlier problem. Other two seem to be class cast issues.

 
prashan dassanayake
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for replying.I'm a beginner of programming.I didn't understand what is class cast issues.How can i solve that error.Help me please
 
vanlalhmangaiha khiangte
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Type mismatch: cannot convert from Object to BranchModel


Do you have a class called BranchModel ?
In your file apparently you are trying to convert a higher class i.e Object into your class .. This is not allowed in java ..
 
Abhijit Rai
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are three focus points :
---
1-
An error occurred at line: 316 in the jsp file: /pages/order/viewOrders.jsp
Generated servlet error:
The method setAttribute(String, Object) in the type HttpSession is not applicable for the arguments (String, boolean)
2-
An error occurred at line: 375 in the jsp file: /pages/order/viewOrders.jsp
Generated servlet error:
Type mismatch: cannot convert from Object to BranchModel
3-
An error occurred at line: 397 in the jsp file: /pages/order/viewOrders.jsp
Generated servlet error:
Type mismatch: cannot convert from Object to FacilityModel
---

check the corresponding servlet created for viewOrders.jsp @ 316 ,375 & 397 .
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!