一定是配置不对。看看你启动Tomcat的命令中是否指定了Jdom的Jar。
解决方案 »
- struts2 tomcat6 运行一段时间后 action会报404 not found,其它action确可以正常访问。
- 怎么回事啊?求解?????
- 一个数据库连接的问题
- 关于修改文件重启中间件
- 请求参数和javabean
- [求助] JSP页面做视频监控,用什么控件
- java Socket的问题 !
- 求助 eclipse配置tomcat出现错误
- ★△★△★有难度的:WebService(java编写),WinForm(.NET编写的客户端),使用out参数!!!!
- 超级难题,Tomcat+Jbuilder配置问题,利用Jbuider启动Tomcat服务的问题?
- Enhydra Octopus Application 问题
- 关于struts 怎么编译的问题
其实我是想试试这个程序,因为我想对xml进行操作
package xml;
import org.jdom.*;
import org.jdom.output.*;
import org.jdom.input.*;
import java.io.*; public class readXML { private Document doc=null; public readXML(){} public String readXML(String xmlFileName){ String strExc=""; try{
SAXBuilder sb = new SAXBuilder();
doc = sb.build(new FileInputStream(xmlFileName));
}catch(Exception e){
strExc=e.toString();
}
return(strExc);
} public Document getXmlDoc(){
return(doc);
}
}
@echo off
if "%OS%" == "Windows_NT" setlocal
rem ---------------------------------------------------------------------------
rem Stop script for the CATALINA Server
rem
rem $Id: shutdown.bat,v 1.4.4.2 2002/01/30 18:10:40 patrickl Exp $
rem ---------------------------------------------------------------------------rem Guess CATALINA_HOME if not defined
if not "%CATALINA_HOME%" == "" goto gotHome
set CATALINA_HOME=.
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
set CATALINA_HOME=..
:gotHome
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
echo The CATALINA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHomeset EXECUTABLE=%CATALINA_HOME%\bin\catalina.batrem Check that target executable exists
if exist "%EXECUTABLE%" goto okExec
echo Cannot find %EXECUTABLE%
echo This file is needed to run this program
goto end
:okExecrem Get remaining unshifted command line arguments and save them in the
set CMD_LINE_ARGS=
:setArgs
if ""%1""=="""" goto doneSetArgs
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto setArgs
:doneSetArgscall "%EXECUTABLE%" stop %CMD_LINE_ARGS%:end
这是编译时候的问题,和tomcat的运行还没有关系,将引用的类路径设置到IDE的环境中,不知道你用的IDE,不好说具体的方法,最简单如下javac -classpath "jdom.jar的路径" "源代码的路径"。
你的试验代码不用Tomcat。
javac配置:
$(FileName) -deprecation -classpath "E:\ApacheTomcat4\lib" $(FileDir)
结果提示
---------- javac ----------
javac: invalid flag: I:\wf\MYstudy\javastudy\jsp\myjsp\WEB-INF\classes\xml
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are used
-classpath <path> Specify where to find user class files
-sourcepath <path> Specify where to find input source files
-bootclasspath <path> Override location of bootstrap class files
-extdirs <dirs> Override location of installed extensions
-d <directory> Specify where to place generated class files
-encoding <encoding> Specify character encoding used by source files
-source <release> Provide source compatibility with specified release
-target <release> Generate class files for specific VM version
-help Print a synopsis of standard options
输出完成 (耗时 3 秒) - 正常终止