首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >JBOSS和SPRING: spring ns的问题

JBOSS和SPRING: spring ns的问题
EN

Stack Overflow用户
提问于 2017-10-13 08:58:54
回答 1查看 102关注 0票数 0

我使用spring :embedded-database配置进行JUNIT测试。spring版本为4.3.3.RELEASE。当我尝试在JBoss Developer Studio 7.1.1.GA中配置xml时,我遇到了以下问题:

在这一行中找到多个注释:- schema_reference.4:未能读取模式文档'http://www.springframework.org/schema/jdbc/spring-jdbc.xsd',因为1)找不到文档;2)文档无法读取;3)文档的根元素不是。-cvc-complex- The .2.4.c:匹配的通配符是严格的,但是元素jdbc:embedded-database没有任何声明。

失败的配置如下

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:jdbc="http://www.springframework.org/schema/jdbc"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd">

  ...
  <jdbc:embedded-database id="dataSource" type="H2" />

相反,使用

代码语言:javascript
复制
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd">

JBoss Developer Studio不会出现错误。

此外,我注意到错误仅来自JBoss Developer Studio,如果我从maven (或install)启动测试,则没有任何错误。

我怎么才能解决这个问题?谢谢你的帮助。

EN

回答 1

Stack Overflow用户

发布于 2017-10-13 09:50:39

看起来,JBoss在war/jar中查找xsd文件时遇到了一些问题。

解决方法是特定于JBoss的,如果您有一些Redhat帐户(我没有),请在这里提供详细信息:

https://access.redhat.com/solutions/2381041 https://access.redhat.com/solutions/62251

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46726148

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档