Spring config beans - Attribute is not allowed to appear in element

5.5k Views Asked by At

I am attempting to integrate the User functionality from here:

https://github.com/iainporter/rest-java

into an existing Maven project of mine. I have got everything working, but the email-services-context.xml has some errors preventing me from deploying. I have used the most recent String Jars, and added everything to my pom.xml & project build path.

The file is found here:

https://github.com/iainporter/rest-java/blob/master/src/main/resources/META-INF/spring/email-services-context.xml

The errors I see in Eclipse are as follows:

Line 18: Element 'int:gateway' must have no character or element information item [children], because the type's content type is empty.
Line 21: Attribute 'message-store' is not allowed to appear in element 'int:queue'.
Line 25: Attribute 'expression' is not allowed to appear in element 'int:router'.
Line 26: Attribute 'fixed-rate' is not allowed to appear in element 'int:poller'.
Line 29: Invalid content was found starting with element 'int:mapping'. 
         One of '{"http://www.springframework.org/schema/beans":bean}' is expected.

Is this due to a new version of Spring as the example works when I run with Gradle, I assume because of some difference in dependancy? I have used a build.gradle -> pom.xml task to get the dependencies and added the Jars to my classpath.

Or is this due to the schema versions in the namespace? It works with Gradle so I didnt think that would be the issue. Namespace params are below

xsi:schemaLocation="http://www.springframework.org/schema/integration
    http://www.springframework.org/schema/integration/spring-integration.xsd
    http://www.springframework.org/schema/integration/jdbc
    http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd">

When I remove the http://www.springframework.org/schema/beans namespace, the errors are removed, is this because the functionality is not described within the namespacE? I have tried other version numbers on the end of the beans.xsd value as well.

1

There are 1 best solutions below

0
On BEST ANSWER

I resolved this issue by installing the Spring IDE package to my Eclipse platform and running a Validation against the XML.

The software can be found here: https://marketplace.eclipse.org/content/spring-ide