Tomcat如何动态加载class及遇到的错误
2009-06-11 13:38
375 查看
转载:http://ceapet.com/blog/index.php?option=com_content&view=article&id=205:tomcatclass&catid=38:java&Itemid=64
找到tomcat\conf\server.xml,在
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
下加入这一行
<Context path="/demo" docBase="C:/apache-tomcat-6.0.18/webapps/demo" reloadable="true" />
想要把tomcat设置成自动加载class,将reloadable="true"后,tomcat的确有反应,缺显示了错误,reload失败。&
lt;/p>
Illegal access: this web application instance has been stopped already. Could not load org.apache.xerces.impl.dtd.XMLNotationDecl. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
查找日志找到,
Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED!
org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
以为是 com.sun.faces.config.ConfigureListener配置有问题,弄来弄去,还是不行。
google 半天,也没有结果,终于看到一个大侠的提问,没有人回答,但大侠终究是大侠,自己搞明白了,还分享了答案,将xercesImpl-2.8.1.jar从webapp的lib下剪切到 tomcat的lib下,试一试,错误终于消失了。
回头看看这个包,错误信息中已经提示了,可自己当初怎么就是想不到呢?学艺不精啊。
找到tomcat\conf\server.xml,在
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
下加入这一行
<Context path="/demo" docBase="C:/apache-tomcat-6.0.18/webapps/demo" reloadable="true" />
想要把tomcat设置成自动加载class,将reloadable="true"后,tomcat的确有反应,缺显示了错误,reload失败。&
lt;/p>
Illegal access: this web application instance has been stopped already. Could not load org.apache.xerces.impl.dtd.XMLNotationDecl. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
查找日志找到,
Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED!
org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
以为是 com.sun.faces.config.ConfigureListener配置有问题,弄来弄去,还是不行。
google 半天,也没有结果,终于看到一个大侠的提问,没有人回答,但大侠终究是大侠,自己搞明白了,还分享了答案,将xercesImpl-2.8.1.jar从webapp的lib下剪切到 tomcat的lib下,试一试,错误终于消失了。
回头看看这个包,错误信息中已经提示了,可自己当初怎么就是想不到呢?学艺不精啊。
相关文章推荐
- 如何解决 tomcat 下 oracle 缓冲池 读取 clob 字段内容 时的错误 "java.lang.ClassCastException: org.apache.commons.dbcp.DelegatingResultSet "
- 如何用Class_forName方法动态加载构造方法带参数的类
- 如何用Class.forName方法动态加载构造方法带参数的类
- Ajax动态滚动加载数据遇到的错误:parsererror
- Tomcat动态加载class的Devloader工具包(又称为免重启的开发插件)
- myeclipse 使用中 遇到错误 无法加载到tomcat下 提示如下 时 的 解决方法
- linux中tomcat部署项目报错,如何显示错误信息?
- 如何实现从服务器端向页面动态加载JavaScript脚本?
- jquery 如何动态添加、删除class样式方法介绍
- 遇到Class path contains multiple SLF4J bindings.该如何解决
- 请问ATTC如何在表格数据从服务器动态加载后更新flash?
- android开发遇到make is not found in path 或者是报加载不到so库的错误
- [UE4]C++实现动态加载的问题:LoadClass<T>()和LoadObject<T>() 及 静态加载问题:ConstructorHelpers::FClassFinder()和FObjectFinder()
- 如何使用DLL函数动态加载-静态加载
- 关于ios 程序加载百度地图lib,出现链接错误:找不到符号 (null): _OBJC_CLASS_$_BMKMapManager的解决办法
- 如何在tomcat启动时自动加载一个类
- Android Studio 导入项目时遇到sdk location not found错误,如何解决
- Java_动态重新加载Class机制
- 用maven管理项目,后加入tomcat中出现以下错误Failed to load or instantiate TagLibraryValidator class:
- class 类与jar 包的动态加载