Unable to locate Spring NamespaceHandler for element
So I have a spring project that I will want to use with a h2 database but am having some trouble with the initial set up and I can't seem to figure out what's wrong.
Here are my dependencies in my pom file.
<dependencies>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.1.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>5.1.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.h2database/h2 -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.196</version>
</dependency>
</dependencies>
and here is my beans.xml file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"
xmlns:context="https://mvnrepository.com/artifact/org.springframework/spring-context"
xmlns:jdbc="https://mvnrepository.com/artifact/org.springframework/spring-jdbc">
<context:component-scan base-package="darragh"></context:component-scan>
<jdbc:embedded-database id="dataSource" type="h2">
<jdbc:script location="schema.sql" />
<jdbc:script location="data.sql" />
</jdbc:embedded-database>
I am getting the following errors.
Unable to locate Spring NamespaceHandler for element 'context:component-scan' of schema namespace 'https://mvnrepository.com/
artifact/org.springframework/spring-context'
and
Unable to locate Spring NamespaceHandler for element 'jdbc:embedded-database' of schema namespace 'https://mvnrepository.com/
artifact/org.springframework/spring-jdbc'
Forgive me as I'm new to spring and don't understand why I am these error messages
java xml spring spring-boot
add a comment |
So I have a spring project that I will want to use with a h2 database but am having some trouble with the initial set up and I can't seem to figure out what's wrong.
Here are my dependencies in my pom file.
<dependencies>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.1.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>5.1.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.h2database/h2 -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.196</version>
</dependency>
</dependencies>
and here is my beans.xml file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"
xmlns:context="https://mvnrepository.com/artifact/org.springframework/spring-context"
xmlns:jdbc="https://mvnrepository.com/artifact/org.springframework/spring-jdbc">
<context:component-scan base-package="darragh"></context:component-scan>
<jdbc:embedded-database id="dataSource" type="h2">
<jdbc:script location="schema.sql" />
<jdbc:script location="data.sql" />
</jdbc:embedded-database>
I am getting the following errors.
Unable to locate Spring NamespaceHandler for element 'context:component-scan' of schema namespace 'https://mvnrepository.com/
artifact/org.springframework/spring-context'
and
Unable to locate Spring NamespaceHandler for element 'jdbc:embedded-database' of schema namespace 'https://mvnrepository.com/
artifact/org.springframework/spring-jdbc'
Forgive me as I'm new to spring and don't understand why I am these error messages
java xml spring spring-boot
try to have same version forspring-contextandspring-jdbc
– Deadpool
Nov 11 at 2:17
@Deadpool Ah ok updated the question with same versions. Still same error though
– John O C
Nov 11 at 2:21
http://www.springframework.org/schema/context/spring-context-3.0.xsdadd this inxsi:schemaLocationcan you try this
– Deadpool
Nov 11 at 2:35
@Deadpool When you say add do you mean replace what's already in the " ". By replacing it with your line I get the following error "Multiple annotations found at this line: - cvc-elt.1: Cannot find the declaration of element 'beans'. - SchemaLocation: schemaLocation value = 'springframework.org/schema/context/spring- context-3.0.xsd' must have even number of URI's." on line 6 my jdbc one
– John O C
Nov 11 at 2:40
add a comment |
So I have a spring project that I will want to use with a h2 database but am having some trouble with the initial set up and I can't seem to figure out what's wrong.
Here are my dependencies in my pom file.
<dependencies>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.1.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>5.1.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.h2database/h2 -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.196</version>
</dependency>
</dependencies>
and here is my beans.xml file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"
xmlns:context="https://mvnrepository.com/artifact/org.springframework/spring-context"
xmlns:jdbc="https://mvnrepository.com/artifact/org.springframework/spring-jdbc">
<context:component-scan base-package="darragh"></context:component-scan>
<jdbc:embedded-database id="dataSource" type="h2">
<jdbc:script location="schema.sql" />
<jdbc:script location="data.sql" />
</jdbc:embedded-database>
I am getting the following errors.
Unable to locate Spring NamespaceHandler for element 'context:component-scan' of schema namespace 'https://mvnrepository.com/
artifact/org.springframework/spring-context'
and
Unable to locate Spring NamespaceHandler for element 'jdbc:embedded-database' of schema namespace 'https://mvnrepository.com/
artifact/org.springframework/spring-jdbc'
Forgive me as I'm new to spring and don't understand why I am these error messages
java xml spring spring-boot
So I have a spring project that I will want to use with a h2 database but am having some trouble with the initial set up and I can't seem to figure out what's wrong.
Here are my dependencies in my pom file.
<dependencies>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.1.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>5.1.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.h2database/h2 -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.196</version>
</dependency>
</dependencies>
and here is my beans.xml file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"
xmlns:context="https://mvnrepository.com/artifact/org.springframework/spring-context"
xmlns:jdbc="https://mvnrepository.com/artifact/org.springframework/spring-jdbc">
<context:component-scan base-package="darragh"></context:component-scan>
<jdbc:embedded-database id="dataSource" type="h2">
<jdbc:script location="schema.sql" />
<jdbc:script location="data.sql" />
</jdbc:embedded-database>
I am getting the following errors.
Unable to locate Spring NamespaceHandler for element 'context:component-scan' of schema namespace 'https://mvnrepository.com/
artifact/org.springframework/spring-context'
and
Unable to locate Spring NamespaceHandler for element 'jdbc:embedded-database' of schema namespace 'https://mvnrepository.com/
artifact/org.springframework/spring-jdbc'
Forgive me as I'm new to spring and don't understand why I am these error messages
java xml spring spring-boot
java xml spring spring-boot
edited Nov 11 at 4:58
Monzurul Haque Shimul
4,9082825
4,9082825
asked Nov 11 at 2:07
John O C
386
386
try to have same version forspring-contextandspring-jdbc
– Deadpool
Nov 11 at 2:17
@Deadpool Ah ok updated the question with same versions. Still same error though
– John O C
Nov 11 at 2:21
http://www.springframework.org/schema/context/spring-context-3.0.xsdadd this inxsi:schemaLocationcan you try this
– Deadpool
Nov 11 at 2:35
@Deadpool When you say add do you mean replace what's already in the " ". By replacing it with your line I get the following error "Multiple annotations found at this line: - cvc-elt.1: Cannot find the declaration of element 'beans'. - SchemaLocation: schemaLocation value = 'springframework.org/schema/context/spring- context-3.0.xsd' must have even number of URI's." on line 6 my jdbc one
– John O C
Nov 11 at 2:40
add a comment |
try to have same version forspring-contextandspring-jdbc
– Deadpool
Nov 11 at 2:17
@Deadpool Ah ok updated the question with same versions. Still same error though
– John O C
Nov 11 at 2:21
http://www.springframework.org/schema/context/spring-context-3.0.xsdadd this inxsi:schemaLocationcan you try this
– Deadpool
Nov 11 at 2:35
@Deadpool When you say add do you mean replace what's already in the " ". By replacing it with your line I get the following error "Multiple annotations found at this line: - cvc-elt.1: Cannot find the declaration of element 'beans'. - SchemaLocation: schemaLocation value = 'springframework.org/schema/context/spring- context-3.0.xsd' must have even number of URI's." on line 6 my jdbc one
– John O C
Nov 11 at 2:40
try to have same version for
spring-context and spring-jdbc– Deadpool
Nov 11 at 2:17
try to have same version for
spring-context and spring-jdbc– Deadpool
Nov 11 at 2:17
@Deadpool Ah ok updated the question with same versions. Still same error though
– John O C
Nov 11 at 2:21
@Deadpool Ah ok updated the question with same versions. Still same error though
– John O C
Nov 11 at 2:21
http://www.springframework.org/schema/context/spring-context-3.0.xsd add this in xsi:schemaLocation can you try this– Deadpool
Nov 11 at 2:35
http://www.springframework.org/schema/context/spring-context-3.0.xsd add this in xsi:schemaLocation can you try this– Deadpool
Nov 11 at 2:35
@Deadpool When you say add do you mean replace what's already in the " ". By replacing it with your line I get the following error "Multiple annotations found at this line: - cvc-elt.1: Cannot find the declaration of element 'beans'. - SchemaLocation: schemaLocation value = 'springframework.org/schema/context/spring- context-3.0.xsd' must have even number of URI's." on line 6 my jdbc one
– John O C
Nov 11 at 2:40
@Deadpool When you say add do you mean replace what's already in the " ". By replacing it with your line I get the following error "Multiple annotations found at this line: - cvc-elt.1: Cannot find the declaration of element 'beans'. - SchemaLocation: schemaLocation value = 'springframework.org/schema/context/spring- context-3.0.xsd' must have even number of URI's." on line 6 my jdbc one
– John O C
Nov 11 at 2:40
add a comment |
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245235%2funable-to-locate-spring-namespacehandler-for-element%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245235%2funable-to-locate-spring-namespacehandler-for-element%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
try to have same version for
spring-contextandspring-jdbc– Deadpool
Nov 11 at 2:17
@Deadpool Ah ok updated the question with same versions. Still same error though
– John O C
Nov 11 at 2:21
http://www.springframework.org/schema/context/spring-context-3.0.xsdadd this inxsi:schemaLocationcan you try this– Deadpool
Nov 11 at 2:35
@Deadpool When you say add do you mean replace what's already in the " ". By replacing it with your line I get the following error "Multiple annotations found at this line: - cvc-elt.1: Cannot find the declaration of element 'beans'. - SchemaLocation: schemaLocation value = 'springframework.org/schema/context/spring- context-3.0.xsd' must have even number of URI's." on line 6 my jdbc one
– John O C
Nov 11 at 2:40