Massimo Petrus
Massimo Petrus

Reputation: 1891

JBOSS EAP and SPRING: Issues with spring-jdbc ns

I a project I use spring jdbc:embedded-database xml config for JUNIT tests. The spring version is 4.3.3.RELEASE. When i try to configure in xml spring-jdbc in JBoss Developer Studio 7.1.1.GA i got the following issue:

Multiple annotations found at this line: - schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/jdbc/spring-jdbc.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not . - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jdbc:embedded-database'.

The failing configuration is as follows

<?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" />

Instead, using

http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd">

JBoss Developer Studio doesn't give errors.

Also, I note that the error comes up ONLY from JBoss Developer Studio UI, if I launch tests from maven (or install) I don't have any error.

How can I solve this ? Thanks for your help.

Upvotes: 0

Views: 130

Answers (1)

Tristan
Tristan

Reputation: 9141

It looks like JBoss has some problems finding the xsd file inside war/jar.

The workaround are specific to JBoss, details here if you have some Redhat account (I don't) :

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

Upvotes: 0

Related Questions