Unable to locate Spring NamespaceHandler for element
up vote
0
down vote
favorite
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 |
up vote
0
down vote
favorite
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-context
andspring-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.xsd
add this inxsi: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
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
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
mhshimul
4,7532825
4,7532825
asked Nov 11 at 2:07
John O C
225
225
try to have same version forspring-context
andspring-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.xsd
add this inxsi: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
add a comment |
try to have same version forspring-context
andspring-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.xsd
add this inxsi: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
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
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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-context
andspring-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.xsd
add this inxsi: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