Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Internal Servlet Error:

 
numan ahmad
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

i am new in jsp and making login system. when i execute my jsp page using tomcat i got an error i did not understand what kind of that error. some one please tell me what kind of that error and how can i remove it ..i excuse for my English because it is my 3rd language
thanks in advance

Error: 500
Internal Servlet Error:

org.apache.jasper.compiler.ParseException: D:\jsp\abc.jsp(0,4) Invalid directive
at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:170)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1027)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1002)
at org.apache.jasper.compiler.Parser.parse(Parser.java:998)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:154)
at org.apache.jasper.runtime.JspLoader.loadJSP(JspLoader.java:226)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:137)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:148)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:255)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:360)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
at org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java:403)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:224)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:347)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:144)
at org.apache.tomcat.service.TcpConnectionThread.run(TcpEndpoint.java:305)
at java.lang.Thread.run(Thread.java:662)
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
org.apache.jasper.compiler.ParseException: D:\jsp\abc.jsp(0,4) Invalid directive
at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:170)
a


Some text in your JSP is confusing the Jasper parser. Whatever it is, it looks like a directive and appears in the first line (0,4).

Bill
 
numan ahmad
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Respected sir now i got that error :(

org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
work\localhost_8080%2Fexamples\_0005cjsp_0005cabc_0002ejspabc_jsp_0.java:74: Ambiguous class: java.beans.Statement and java.sql.Statement
Statement st=con.createStatement();


ever there is nothing wrong in my statement .
 
Pete Nelson
Ranch Hand
Posts: 147
Debian Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That error tells me you have import statements like

The problem is, both of those packages have a class named "Statement". You have two options:
  • replace the wildcard imports with only the imports you need
  • specify the fully qualified class name (ie: java.sql.Statement rather than just 'Statement'))

  • The first option will give you better long-term results (and should be easy in a modern IDE), while the second option is a much quicker fix, but may leave you with similar problems in the future.
     
    Bear Bibeault
    Author and ninkuma
    Marshal
    Pie
    Posts: 64683
    86
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Or the best option of all: get the Java code out of the JSP. It has no business there. This isn't 2002!
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic