Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

jsp doesnt work when try to connect with tomcat and mysql

Question posted by: hkma08 (Newbie) on May 6th, 2008 03:04 AM
I dont know I should post JSP error in here or not. If not please redirect me to another one. Thx.

I just installed apache tomcat with mysql with java, but i got error when try to connect to mysql database, what is happening? Here is my error msg:

org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 3 in the jsp file: /tutorial/test.jsp
Syntax error on tokens, delete these tokens
1: <%@ page import="java.sql.*" %>
2: <%
3: String connectionURL = "jdbc:mysql://localhost:3306/test?username="admin1"&password="admin"";
4: Connection connection = null;
5: Statement statement = null;
6: ResultSet rs = null;


Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.jav acError(DefaultErrorHandler.java:85)
org.apache.jasper.compiler.ErrorDispatcher.javacEr ror(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateCla ss(JDTCompiler.java:415)
org.apache.jasper.compiler.Compiler.compile(Compil er.java:308)
org.apache.jasper.compiler.Compiler.compile(Compil er.java:286)
org.apache.jasper.compiler.Compiler.compile(Compil er.java:273)
org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:308)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
r035198x's Avatar
r035198x
Admin
10,049 Posts
June 4th, 2008
03:55 PM
#2

Re: jsp doesnt work when try to connect with tomcat and mysql
According to the compiler/parser you have an error in the JSP code.
Check that your script tags are properly closed e.t.c
If you can't spot the error then post the JSP code in the Java forum.

Reply
Reply
Not the answer you were looking for? Post your question . . .
170,098 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Top Apache Forum Contributors