Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/tx] Offending resource: ServletContext resource [/WEB-INF/spring-servlet.xml]
Asked
Active
Viewed 1,685 times
3
-
can you more specific on your issue i don't know why it is tag to stack? – soorapadman Sep 25 '15 at 11:43
-
Is there any more information you can add to this? – pete the pagan-gerbil Sep 25 '15 at 11:43
-
it's a maven application ,in config im getting error – sagar Sep 25 '15 at 11:47
-
sir i'm new user here so getting confused with your site, i dont knw what is tag here, withought that i could not post my qutn so jst tagged to that – sagar Sep 25 '15 at 11:49
-
Have you reviewed the following ... http://stackoverflow.com/questions/7188719/unable-to-locate-spring-namespacehandler-for-xml-schema-namespace-http-www-sp – Rob Kielty Sep 25 '15 at 12:24
-
Looks like a missing dependency, I would guess spring-tx is missing – Henry Sep 25 '15 at 12:26
1 Answers
7
In gradle you can use shadowJar plugin for fix that. My build.gradle file for compile fat jar:
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'application'
mainClassName = 'ru.antowka.Initializer'
buildscript {
repositories { jcenter() }
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.2'
}
}
jar {
manifest {
attributes 'Main-Class': mainClassName
}
}
shadowJar {
mergeServiceFiles('META-INF/spring.*')
}
// JDK 8
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileJava.options.encoding = 'UTF-8'
repositories {
maven {
url 'http://repo.spring.io/snapshot'
}
mavenLocal()
mavenCentral()
jcenter()
}
dependencies {
compile 'org.jsoup:jsoup:1.8.3'
compile 'org.springframework:spring-context:4.2.2.BUILD-SNAPSHOT'
compile 'log4j:log4j:1.2.17'
compile 'org.quartz-scheduler:quartz:1.8.6'
compile 'org.springframework:spring-support:2.0.8'
compile 'org.springframework:spring-tx:2.5.4'
compile 'org.springframework:spring-orm:4.1.7.RELEASE'
compile 'org.hibernate:hibernate-core:4.3.10.Final'
compile 'org.postgresql:postgresql:9.4-1201-jdbc41'
compile 'org.apache.commons:commons-dbcp2:2.1'
testCompile 'org.springframework:spring-test:4.2.0.RELEASE'
testCompile 'org.mockito:mockito-core:1.+'
testCompile 'junit:junit:4.12'
}

Anton Nikanorov
- 341
- 3
- 4