solve this my sql exception in jsp

<%@ page language = "java" import ="java.sql.*" %>
<html>
<body>
<%

Connection con = null;

try
{
       Class.forName("com.mysql.jdbc.Driver");
    con = DriverManager.getConnection("jdbc:mysql://localhost:3306/javatest");

     Statement st = con.createStatement();
     ResultSet rs = st.executeQuery("select * from counter");
%>
     <table border =2>

     <%
     while(rs.next())
     {
     %>
          <tr>
          <td><%= rs.getString(1)%></td>

          <td><%= rs.getString(2)%></td>

          <td><%= rs.getString(3)%></td>

          </tr>

    <%
     }
    %>
    </table>
<%
}
catch(Exception d)
{
   out.println("can not display the records");

}

finally
{
    if(con != null)
    {
        try
        {
            con.close();
        }
        catch(SQLException e)
        {
            out.println("Error closing the connection");
        }
    }
}
%>
</body>
</html>


i got exception for this code


ype Exception report

message

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

exception

org.apache.jasper.JasperException: org/aspectj/lang/Signature
      org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
      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:802)

root cause

javax.servlet.ServletException: org/aspectj/lang/Signature
      org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
      org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
      org.apache.jsp.simplejdbc_jsp._jspService(org.apache.jsp.simplejdbc_jsp:119)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
      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:802)

root cause

java.lang.NoClassDefFoundError: org/aspectj/lang/Signature
      java.lang.Class.forName0(Native Method)
      java.lang.Class.forName(Unknown Source)
      org.apache.jsp.simplejdbc_jsp._jspService(org.apache.jsp.simplejdbc_jsp:52)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
      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:802)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.15 logs.

i put mysql- jav connector 5.0.0b.jar into C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\lib this directory

could i want to set ant classpath?
LVL 9
Manikandan ThiagarajanSenior consultantAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

radarshCommented:
Alright stmani,

Remove the mysql-connector-java-XXXX-bin-g.jar from your classpath
and just add the mysql-connector-java-XXXX-bin.jar

the -g jar is a debug version and should not be in your classpath

________
radarsh
0
Manikandan ThiagarajanSenior consultantAuthor Commented:
now it dispalys

can not display records.

how could i know  counter table structure in javatest database in mysql
0
radarshCommented:
Open mysql command line and type

desc counter;

________
radarsh
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

radarshCommented:
Don't do out.println("can not display the records");

print the exception stacktrace.

d.printStackTrace();

Otherwise, you won't understand anything.

________
radarsh
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Manikandan ThiagarajanSenior consultantAuthor Commented:
if i run through eclipse that shows page can not be displayed.

it would  be run with out  ecclipse.

i create a dynamic webproject is called jdbcjsp.

right click that one add jsp file to that.

when i right clikc jdbcjsp folder and select option run as server.

it shows page can not be displayed.


could i modify workspace in ecllpse.

http://localhost:8090/JDBCJSP THIS URL SHOWS IN ECCLIPSE.

FILE NAME IS JDBC.JSP.

IS IT CORRECT.

HOW COULD I RUN THIS PROGRAM IN ECCLIPSE.



0
radarshCommented:
Where did you put your jsp? It should be directly under WebContent folder.
Make sure your server is running.

Hit http://localhost:8090 and see if you get something.

How is it 8090? Did you change the port? By default it will be 8080.

________
radarsh
0
Manikandan ThiagarajanSenior consultantAuthor Commented:
jsp file is there in webcontentfolder only

>>Hit http://localhost:8090 and see if you get something.

it shows page can not be displayed

>>How is it 8090? Did you change the port? By default it will be 8080.

already i changed the port

0
radarshCommented:
That means your server is not started! Make sure you start the server
properly and then try rest of the things.

________
radarsh
0
Manikandan ThiagarajanSenior consultantAuthor Commented:
how to start the server.
0
radarshCommented:
stmani, all this is not relevant to your original question. All you asked was
how to get rid of that exception. And I guess that's solved.

You need to read the tomcat guides for information on how to do things.
http://tomcat.apache.org/tomcat-5.5-doc/index.html

________
radarsh
0
Manikandan ThiagarajanSenior consultantAuthor Commented:
now i got this exception

i put

    %>
    </table>
<%
}
catch(Exception d)
{
 out.println(d.printStackTrace());

}
 that would causes an exception like this
An error occurred at line: 35 in the jsp file: /simplejdbc.jsp


Generated servlet error:
The method println() in the type PrintStream is not applicable for the arguments (void)


      org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
      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:802)

root cause
0
radarshCommented:
>> out.println(d.printStackTrace());

Should be either out.println(d.getMessage());

or d.printStackTrace();


________
radarsh


0
Manikandan ThiagarajanSenior consultantAuthor Commented:
Access denied for user ''@'localhost' (using password: NO)

now that would give message like this
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.