• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error in JSP java.lang.ClassCastException  RSS feed

Neeraj jain
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using a bean class to insert a record inside the database (Ms-access) but getting an error

Error 500--Internal Server Error

at jsp_servlet.__student._jspService(__student.java:127)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6291)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:97)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3575)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2573)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)

Student.jsp is below

StudentBean.java is below

Index.html is

Resolve this issue
Mudit Shukla
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

This ClassCastException is coming because of the error in code


Here marks is coming as String and the method accept integer. you need to write it as following :


This will cast the value in integer.

Hope this resolve your problem.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!