XML在Linux下解析报错,但在Window下支行正常,有没有懂的帮助看看
服务器是Tomcat
操作系统:red hat 9
JDK1.5.11
用的dom4j的包
<?xml version= "1.0 "?>
<!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 1.0//EN " "http://www.wapforum.org/DTD/pap_1.0.dtd ">
<pap product-name= "test ">
<push-response push-id= "91809/741/OpenwavePush " sender-address= "10.10.10.10 " sender-name= "testMan " reply-time= "2007-03-30T14:12:42Z ">
<response-result code= "1001 " desc= "The request has been accepted for processing "/>
</push-response>
</pap>
上面的XML文件,在Window下可以正常解析,但在Linux下会报错,说找不到http://www.wapforum.org/DTD/pap_1.0.dtd
但把XML中的dtd申明去掉,在Linux下又可以正常解析,有人知道怎么解决??
<?xml version= "1.0 "?>
<pap product-name= "test PPG ">
<push-response push-id= "91809/741/OpenwavePush " sender-address= "10.10.10.10 " sender-name= "testMan " reply-time= "2007-03-30T14:12:42Z ">
<response-result code= "1001 " desc= "The request has been accepted for processing "/>
</push-response>
</pap>
------解决方案--------------------以前好像遇到过,后来是在同一个目录下放入
DTD,(可能与java设置的加载路径有关
记不清了)
------解决方案--------------------可能是少倒入了某个jar吧
------解决方案--------------------估计是dtd的格式问题,http://www.wapforum.org/DTD/pap_1.0.dtd,这个dtd写的有问题,比如字符集或是格式问题,造成linux不支持。
------解决方案--------------------是不是linux不能上网?