Results 1 to 5 of 5

Thread: error

  1. #1
    panny's Avatar
    panny is offline Member
    Join Date
    Mar 2011
    Posts
    4
    Rep Power
    0

    Default error

    can anyone explain to me about this error:confused:


    Mar 22, 2011 3:21:35 PM org.apache.catalina.core.StandardContext reload
    INFO: Reloading this Context has started
    Mar 22, 2011 3:21:36 PM org.apache.catalina.core.StandardContext reload
    INFO: Reloading this Context has started
    SQL = SELECT document FROM test1 WHERE doc_no = null

    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorEx ception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Construc tor.java:513)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:40 6)
    at com.mysql.jdbc.Util.getInstance(Util.java:381)
    at com.mysql.jdbc.SQLError.createSQLException(SQLErro r.java:1030)
    at com.mysql.jdbc.SQLError.createSQLException(SQLErro r.java:956)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja va:3491)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja va:3423)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:19 36)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java :2060)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionIm pl.java:2536)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionIm pl.java:2465)
    at com.mysql.jdbc.StatementImpl.executeQuery(Statemen tImpl.java:1383)
    at MyPackage.MySQLConnection.selectQuery2(MySQLConnec tion.java:75)
    at MyPackage.Token.tokenizer_document(Token.java:19)
    at org.apache.jsp.index_jsp._jspService(index_jsp.jav a:87)
    at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:374)
    at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:342)
    at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:267)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.netbeans.modules.web.monitor.server.MonitorFil ter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:849)
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:454)
    at java.lang.Thread.run(Thread.java:619)
    java.lang.NullPointerException
    at MyPackage.Token.tokenizer_document(Token.java:25)
    at org.apache.jsp.index_jsp._jspService(index_jsp.jav a:87)
    at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:374)
    at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:342)
    at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:267)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.netbeans.modules.web.monitor.server.MonitorFil ter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:849)
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:454)
    at java.lang.Thread.run(Thread.java:619)

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    The exception trace is trying to explain to you what the problem was.

    First, it says "You have an error in your SQL syntax; ...". That means the problem is happening when you interact with the database. It spit out the SQL that it tried to run as

    "SELECT document FROM test1 WHERE doc_no = null". This is not valid sql because if you want to select where doc_no is null you'd have to say "SELECT document FROM test1 WHERE doc_no is null".
    Then the trace tells you that is happening at at MyPackage.MySQLConnection.selectQuery2(MySQLConnec tion.java:75) which it turn is called by at MyPackage.Token.tokenizer_document(Token.java:19). Those are all lines in your code.


    Either
    1.) Ensure that you don't call that select when you don't have a doc_no or
    2.) Make sure that you always have a doc_no
    3.) Check if you have a doc_no or not before doing the select. If you don't have the doc_no then use the "is null" syntax.

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,009
    Rep Power
    20

    Default

    That is valid syntax, though.
    It may not give you the result you want, "= null" will return nothing since "null = null" returns false in SQL.

    You'll need to post the actual code being used to generate your SQL.

  4. #4
    only_java is offline Member
    Join Date
    Mar 2011
    Posts
    16
    Rep Power
    0

    Default post your whole code

    Kindly post your whole code so I can answer it.

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,009
    Rep Power
    20

    Default

    That was already requested.
    Over a week ago.
    If the OP hasn't replied by now it's a fairly safe bet they won't.

Similar Threads

  1. java out of memory error-heap space error
    By elsanthosh in forum NetBeans
    Replies: 4
    Last Post: 06-15-2010, 09:31 AM
  2. Replies: 1
    Last Post: 03-10-2010, 01:53 PM
  3. Replies: 1
    Last Post: 12-05-2009, 07:28 AM
  4. Replies: 1
    Last Post: 10-26-2009, 04:38 PM
  5. Replies: 3
    Last Post: 01-23-2009, 08:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •