| Author |
JSP, Tomcat, Classpath Error
|
Elton Hughes
Ranch Hand
Joined: Jun 19, 2003
Posts: 72
|
|
Hello All, I am trying to learn about JSP and I am doing the exercises in the book "Beginning JSP2" from Apress. Until the last exercise, things were going well. Here is what I am using: Mac OS X 10.4.6 Tomcat 5.0.28 MySQL 5.0.16 MySQL ConnectorJ 3.1.13 Here is the latest script: <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %> <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql_rt" %> <sql:setDataSource var="datasource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/publish" user="publishuser" password="XXXXXXXXXX"/> <sql:query var="books" dataSource="${datasource}"> SELECT id, title, price FROM book </sql:query> <html> <head> <title>JSP gateway to the Publish Database</title> </head> <body> <table border="1"> <tr> <td>id</td> <td>title</td> <td>price</td> </tr> <c:forEach items="${books.rows}" var="row"> <tr> <td><c ut value="${row.id}" /></td> <td><c ut value="${row.title}" /></td> <td><c ut value="${row.price}" /></td> </tr> </c:forEach> </table> </body> </html> Unfortunately, I am getting this error message and I do not understand what it is saying. The message is: javax.servlet.ServletException: org/aspectj/lang/Signature org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758) org.apache.jsp.bookList_jsp._jspService(bookList_jsp.java:80) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) 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(Class.java:242) org.apache.taglibs.standard.tag.common.sql.DataSourceWrapper.setDriverClassName(DataSourceWrapper.java:46) org.apache.taglibs.standard.tag.common.sql.SetDataSourceTagSupport.doStartTag(SetDataSourceTagSupport.java:102) org.apache.jsp.bookList_jsp._jspx_meth_sql_setDataSource_0(bookList_jsp.java:100) org.apache.jsp.bookList_jsp._jspService(bookList_jsp.java:64) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) It looks like a class is missing. But the instructions only called for the mysql connector jar to go into the WEB-INF/lib directory, so I am at a loss as to what to do next. Thank you for your time. Elton
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56219
|
|
Indeed, it means that the org.aspectj.lang.Signature class is missing from the classpath. You'll need to track down where you need to et it from. But.... You said:
Tomcat 5.0.28
and
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %> <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql_rt" %>
which means you are using JSTL 1.0 with Tomcat 5. These are not compatible and will cause you future problems. If you are using Tomcat 5, you should be sure that your web.xml is declared as a Servlets 2.4 web app, and you should be using JSTL 1.1. The JSP FAQ has more details.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Elton Hughes
Ranch Hand
Joined: Jun 19, 2003
Posts: 72
|
|
Hi Bear, Thank you for pointing that out. As someone who is learning from a book, I can only assume the authors had a good reason for mixing things up. The book I am learning from earned 8 horseshoes. What should the taglib lines be? Thanks, Elton
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56219
|
|
http://java.sun.com/jsp/jstl/core This assumes you have installed the JSTL 1.1 jars.
|
 |
Stefan Evans
Bartender
Joined: Jul 06, 2005
Posts: 1005
|
|
The aspectj issue is coming from the MySQL driver I believe. Maybe you have a "test" build of it? Check that you have the right driver installed. A related post on the mysql forums. http://forums.mysql.com/read.php?39,22579,33723#msg-33723
|
 |
 |
|
|
subject: JSP, Tomcat, Classpath Error
|
|
|