博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
web.xml引入 xml (tomcat 7.0.52) 以上版本报错!
阅读量:4036 次
发布时间:2019-05-24

本文共 1906 字,大约阅读时间需要 6 分钟。

今天在搞工作流,tomcat7.0.57 总是报错,解析不了web.xml引用的joa.xml .

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE web-app
                [<!ENTITY joa SYSTEM  "joa.xml">]>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    version="3.0">

后经查找资料发现:

tomcat 7.0.52开始的版本才会出这个问题,

是因为安全的考虑tomcat 7.0.52开始的版本把xmlBlockExterna属性默认为false,要解决这个问题,

两种方法:

1、把tomcat版本换成7.0.52之前的版本。

2、把xmlBlockExterna设成false。

下面是原版解释:
As per discussion with Tomcat developers, xmlBlockExternal="false" attribute of Tomcat's Context (context.xml) was set true by default starting from 7.0.52. With xmlBlockExternal="false"generated/djn-settings.conf can be included。

<Context  xmlBlockExternal="false" >

    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    
    <!-- Uncomment this to disable session persistence across Tomcat restarts -->
    <!--
    <Manager pathname="" />
    -->
    <!-- Uncomment this to enable Comet connection tacking (provides events
         on session expiration as well as webapp lifecycle) -->
    <!--
    <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
    -->
</Context>

解决完这个问题后,又出现了一个新问题:

之后查找资料解决方法:

在项目下创建org.apache:

package org.apache;

import java.lang.reflect.InvocationTargetException;
import javax.naming.NamingException;
/**
 * @author 董志博
 * @date  2015-8-17
 * @description
 * @Version 1.0
 */
public interface AnnotationProcessor {
    
    
      public void postConstruct(Object instance) throws IllegalAccessException,
      InvocationTargetException;
      public void preDestroy(Object instance) throws IllegalAccessException,
          InvocationTargetException;
    
      public void processAnnotations(Object instance)
          throws IllegalAccessException, InvocationTargetException,
          NamingException;
}

由于时间问题,还未了解原因。待续.......

转载地址:http://ddjdi.baihongyu.com/

你可能感兴趣的文章
MPMoviePlayerViewController和MPMoviePlayerController的使用
查看>>
CocoaPods实践之制作篇
查看>>
[Mac]Mac 操作系统 常见技巧
查看>>
苹果Swift编程语言入门教程【中文版】
查看>>
捕鱼忍者(ninja fishing)之游戏指南+游戏攻略+游戏体验
查看>>
iphone开发基础之objective-c学习
查看>>
iphone开发之SDK研究(待续)
查看>>
计算机网络复习要点
查看>>
Variable property attributes or Modifiers in iOS
查看>>
NSNotificationCenter 用法总结
查看>>
C primer plus 基础总结(一)
查看>>
剑指offer算法题分析与整理(一)
查看>>
剑指offer算法题分析与整理(三)
查看>>
Ubuntu 13.10使用fcitx输入法
查看>>
pidgin-lwqq 安装
查看>>
mint/ubuntu安装搜狗输入法
查看>>
C++动态申请数组和参数传递问题
查看>>
opencv学习——在MFC中读取和显示图像
查看>>
retext出现Could not parse file contents, check if you have the necessary module installed解决方案
查看>>
pyQt不同窗体间的值传递(一)——对话框关闭时返回值给主窗口
查看>>