D
davy
when i run a jsp web after starting tomcat, where the code is
<% gdpTest n2 = new gdpTest();
n2.testGunDP();
%>
where gdpTest is one class extends testCase in Junit,
and i have imported the class gdpTest in JSP web, when i open the jsp
web, the information in the web is
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented
it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 20 in the jsp file: /gdptest.jsp
Generated servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina
\localhost\myTest\org\apache\jsp\gdptest_jsp.java:87: ÎÞ·¨·ÃÎÊ
junit.framework.TestCase
ÕÒ²»µ½Îļþ junit\framework\TestCase.class
gdpTest n2 = new gdpTest();
^
1 ´íÎó
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:
84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:
332)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:
511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:
295)
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)
note The full stack trace of the root cause is available in the Apache
Tomcat/5.0.28 logs.
--------------------------------------------------------------------------------
Apache Tomcat/5.0.28
well, i think i have configed the right classpath in my computer,
because when i import another project class and use its method, the
jsp web's information is right without no mistakes
so i have one question, jsp can not use project extends junit?
thanks
<% gdpTest n2 = new gdpTest();
n2.testGunDP();
%>
where gdpTest is one class extends testCase in Junit,
and i have imported the class gdpTest in JSP web, when i open the jsp
web, the information in the web is
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented
it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 20 in the jsp file: /gdptest.jsp
Generated servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina
\localhost\myTest\org\apache\jsp\gdptest_jsp.java:87: ÎÞ·¨·ÃÎÊ
junit.framework.TestCase
ÕÒ²»µ½Îļþ junit\framework\TestCase.class
gdpTest n2 = new gdpTest();
^
1 ´íÎó
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:
84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:
332)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:
511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:
295)
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)
note The full stack trace of the root cause is available in the Apache
Tomcat/5.0.28 logs.
--------------------------------------------------------------------------------
Apache Tomcat/5.0.28
well, i think i have configed the right classpath in my computer,
because when i import another project class and use its method, the
jsp web's information is right without no mistakes
so i have one question, jsp can not use project extends junit?
thanks