Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
web.xml中有多个资源引用_Xml_Web_Web.xml_Dtd - Fatal编程技术网

web.xml中有多个资源引用

web.xml中有多个资源引用,xml,web,web.xml,dtd,Xml,Web,Web.xml,Dtd,我需要将我的应用程序连接到另一个数据源,因此,我在web.xml中添加了另一个资源引用。看起来是这样的: <resource-ref> <description>A Schema DB Connection</description> <res-ref-name>jdbc/AschemaDS</res-ref-name> <res-type>javax.sql.DataSource</res-t

我需要将我的应用程序连接到另一个数据源,因此,我在web.xml中添加了另一个资源引用。看起来是这样的:

<resource-ref>
    <description>A Schema DB Connection</description>
    <res-ref-name>jdbc/AschemaDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-ref>
    <description>B Schema DB Connection</description>
    <res-ref-name>jdbc/BschemaDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>

模式数据库连接
jdbc/AschemaDS
javax.sql.DataSource
容器
可分享
B模式数据库连接
jdbc/BschemaDS
javax.sql.DataSource
容器
可分享
现在,在eclipse中,我可以看到一个关于DTD模式规范(web-app_2_3.DTD)的错误,声明如下:

<resource-ref>
    <description>A Schema DB Connection</description>
    <res-ref-name>jdbc/AschemaDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-ref>
    <description>B Schema DB Connection</description>
    <res-ref-name>jdbc/BschemaDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
元素类型“web app”的内容必须匹配(图标?、显示名称?、描述?、可分发?、上下文参数*、筛选器*、筛选器映射*、侦听器*、servlet*、servlet映射*、会话配置?、mime映射*、欢迎文件列表?、错误页*、标记库*、资源环境引用*、资源引用*、安全约束*、登录配置?、安全角色*、环境条目*、ejb引用*、ejb本地引用*)”

我想星号(参考资料*)的意思是“你想要多少就有多少”


我的配置中是否缺少某些内容?

没错,星号表示零或更多,因此您可以添加另一个
资源引用
。但是
web app
的所有子项必须按指定顺序排列(我们知道这一点是因为错误消息中显示的模型中的逗号)。确保将新的
资源引用添加到正确的位置。我重新启动了eclipse,问题消失了。:(你是对的,星号表示零或更多,因此你可以添加另一个
资源引用。
。但是,
web app
的所有子项必须按照指定的顺序(我们之所以知道这一点,是因为错误消息中显示的模型中有逗号)。请确保在正确的位置添加了新的
resource ref
。我重新启动了eclipse,问题消失了:(