泰坦陨落2剧情太短:求助!相同文件前台正常(/test.jsp),后台出错(/admin/test.jsp)

来源:百度文库 编辑:神马品牌网 时间:2024/04/27 16:34:47
我的服务器前台运行一切正常,后台提示错误.
为了测试,我写了一个文件放在站点根目录/test.jsp(前台),运行没问题.
把test.jsp拷贝到/admin/test.jsp(后台)下出现错误.

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

An error occurred at line: 2 in the jsp file: /test.jsp
Generated servlet error:
com.billedu.Constants.db_url cannot be resolved to a type

db_url是com.billedu.Constants的一个常量.

我把整个站点从服务器拷贝到本地机器运行未出现错误,在服务器上不正常.

本地机器将站点拷贝到webapps\下,访问http://localhost:8080/bill一切正常.

服务器配置server.xml文件
<Host name="www.bill.cn" debug="0" appBase="W:\tomcat\bill" unpackWARs="true" autoDeploy="true"> <alias>bill.cn</alias>

<Context path="/" docBase="W:\tomcat\bill" debug="0" reloadable="true"/></Host>

应该是服务器端配置的路径有问题,改成这样试试:
<Host name="www.bill.cn" debug="0" appBase="W:\tomcat\webapps\bill" unpackWARs="true" autoDeploy="true"> <alias>bill.cn</alias>

<Context path="/" docBase="W:\tomcat\webapps\bill" debug="0" reloadable="true"/></Host>
不行的话,考虑一下将com.billedu.Constants放到CLASSPAHT中再试试。