Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

app cant' find spring-context xsd in jar file after adding spring-integration-core dependency

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello.

I have a problem with initialization spring application context during running stand-alone java application from command-line.
When I start application from the eclipse ide, everything is fine and application context is initialized.
When I try to start my application packed as jar from command line, I've got an exception that xsd from spring-context schema is not found.

D:\docs>java -jar WebserverMinimal.jar
DEBUG: me.test.selfcare.SelfcareMain - app started
Exception in thread "main" org.springframework.beans.factory.parsing.BeanDefinit
ionParsingException: Configuration problem: Unable to locate Spring NamespaceHan
dler for XML schema namespace [http://www.springframework.org/schema/context]
Offending resource: class path resource [context-test.xml]

at org.springframework.beans.factory.parsing.FailFastProblemReporter.err
or(FailFastProblemReporter.java:70)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderC
ontext.java:85)
...
at org.springframework.context.support.ClassPathXmlApplicationContext.<i
nit>(ClassPathXmlApplicationContext.java:83)
at me.test.selfcare.SelfcareMain.main(SelfcareMain.java:15)




This problem appeared if I add to dependencies spring-integration-core.
If I don't do this and only use spring-aop, spring-beans, spring-context, spring-core, spring-expressions - everything is fine.

This is build.gradle:


context-test.xml:


How I try to initialize applicationContext:



Could you help me? I don't understand why is it working so.
In jar file in spring.schemas there's mapping which is assign to existing xsd file which is needed.

http\://www.springframework.org/schema/context/spring-context-2.5.xsd=org/springframework/context/config/spring-context-2.5.xsd
http\://www.springframework.org/schema/context/spring-context-3.0.xsd=org/springframework/context/config/spring-context-3.0.xsd
http\://www.springframework.org/schema/context/spring-context-3.1.xsd=org/springframework/context/config/spring-context-3.1.xsd
http\://www.springframework.org/schema/context/spring-context-3.2.xsd=org/springframework/context/config/spring-context-3.2.xsd
http\://www.springframework.org/schema/context/spring-context-4.0.xsd=org/springframework/context/config/spring-context-4.0.xsd
http\://www.springframework.org/schema/context/spring-context-4.1.xsd=org/springframework/context/config/spring-context-4.1.xsd
http\://www.springframework.org/schema/context/spring-context.xsd=org/springframework/context/config/spring-context-4.1.xsd

 
jamshut kishelmek
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also I figure out that the problem begins when I try to use as dependency spring-tx.
spring-integration adds spring-tx, so maybe the problem with adding spring-tx.jar

Anyway, the problem is still the same.
 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you run gradle dependencies to get the list of all depdnencies? Looking at the differrences will tell you if there are any problems due to version conflicts
 
jamshut kishelmek
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, Jayesh A Lalwani

Everything is working fine for this dependencies:

[sts] -----------------------------------------------------
[sts] Starting Gradle build for the following tasks:
[sts] dependencies
[sts] -----------------------------------------------------
:dependencies

------------------------------------------------------------
Root project
------------------------------------------------------------

archives - Configuration for archive artifacts.
No dependencies

compile - Compile classpath for source set 'main'.
+--- org.slf4j:jcl-over-slf4j:1.7.9
| \--- org.slf4j:slf4j-api:1.7.9
+--- log4j:log4j:1.2.17
+--- org.slf4j:slf4j-log4j12:1.7.9
| +--- org.slf4j:slf4j-api:1.7.9
| \--- log4j:log4j:1.2.17
+--- org.springframework:spring-aop:4.1.7.RELEASE
| +--- aopalliance:aopalliance:1.0
| +--- org.springframework:spring-beans:4.1.7.RELEASE
| | \--- org.springframework:spring-core:4.1.7.RELEASE
| | \--- commons-logging:commons-logging:1.2
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-beans:4.1.7.RELEASE (*)
+--- org.springframework:spring-context:4.1.7.RELEASE
| +--- org.springframework:spring-aop:4.1.7.RELEASE (*)
| +--- org.springframework:spring-beans:4.1.7.RELEASE (*)
| +--- org.springframework:spring-core:4.1.7.RELEASE (*)
| \--- org.springframework:spring-expression:4.1.7.RELEASE
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-expression:4.1.7.RELEASE (*)
\--- org.springframework:spring-messaging:4.1.7.RELEASE
+--- org.springframework:spring-beans:4.1.7.RELEASE (*)
+--- org.springframework:spring-context:4.1.7.RELEASE (*)
\--- org.springframework:spring-core:4.1.7.RELEASE (*)

default - Configuration for default artifacts.
+--- org.slf4j:jcl-over-slf4j:1.7.9
| \--- org.slf4j:slf4j-api:1.7.9
+--- log4j:log4j:1.2.17
+--- org.slf4j:slf4j-log4j12:1.7.9
| +--- org.slf4j:slf4j-api:1.7.9
| \--- log4j:log4j:1.2.17
+--- org.springframework:spring-aop:4.1.7.RELEASE
| +--- aopalliance:aopalliance:1.0
| +--- org.springframework:spring-beans:4.1.7.RELEASE
| | \--- org.springframework:spring-core:4.1.7.RELEASE
| | \--- commons-logging:commons-logging:1.2
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-beans:4.1.7.RELEASE (*)
+--- org.springframework:spring-context:4.1.7.RELEASE
| +--- org.springframework:spring-aop:4.1.7.RELEASE (*)
| +--- org.springframework:spring-beans:4.1.7.RELEASE (*)
| +--- org.springframework:spring-core:4.1.7.RELEASE (*)
| \--- org.springframework:spring-expression:4.1.7.RELEASE
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-expression:4.1.7.RELEASE (*)
\--- org.springframework:spring-messaging:4.1.7.RELEASE
+--- org.springframework:spring-beans:4.1.7.RELEASE (*)
+--- org.springframework:spring-context:4.1.7.RELEASE (*)
\--- org.springframework:spring-core:4.1.7.RELEASE (*)

runtime - Runtime classpath for source set 'main'.
+--- org.slf4j:jcl-over-slf4j:1.7.9
| \--- org.slf4j:slf4j-api:1.7.9
+--- log4j:log4j:1.2.17
+--- org.slf4j:slf4j-log4j12:1.7.9
| +--- org.slf4j:slf4j-api:1.7.9
| \--- log4j:log4j:1.2.17
+--- org.springframework:spring-aop:4.1.7.RELEASE
| +--- aopalliance:aopalliance:1.0
| +--- org.springframework:spring-beans:4.1.7.RELEASE
| | \--- org.springframework:spring-core:4.1.7.RELEASE
| | \--- commons-logging:commons-logging:1.2
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-beans:4.1.7.RELEASE (*)
+--- org.springframework:spring-context:4.1.7.RELEASE
| +--- org.springframework:spring-aop:4.1.7.RELEASE (*)
| +--- org.springframework:spring-beans:4.1.7.RELEASE (*)
| +--- org.springframework:spring-core:4.1.7.RELEASE (*)
| \--- org.springframework:spring-expression:4.1.7.RELEASE
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-expression:4.1.7.RELEASE (*)
\--- org.springframework:spring-messaging:4.1.7.RELEASE
+--- org.springframework:spring-beans:4.1.7.RELEASE (*)
+--- org.springframework:spring-context:4.1.7.RELEASE (*)
\--- org.springframework:spring-core:4.1.7.RELEASE (*)

testCompile - Compile classpath for source set 'test'.
+--- org.slf4j:jcl-over-slf4j:1.7.9
| \--- org.slf4j:slf4j-api:1.7.9
+--- log4j:log4j:1.2.17
+--- org.slf4j:slf4j-log4j12:1.7.9
| +--- org.slf4j:slf4j-api:1.7.9
| \--- log4j:log4j:1.2.17
+--- org.springframework:spring-aop:4.1.7.RELEASE
| +--- aopalliance:aopalliance:1.0
| +--- org.springframework:spring-beans:4.1.7.RELEASE
| | \--- org.springframework:spring-core:4.1.7.RELEASE
| | \--- commons-logging:commons-logging:1.2
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-beans:4.1.7.RELEASE (*)
+--- org.springframework:spring-context:4.1.7.RELEASE
| +--- org.springframework:spring-aop:4.1.7.RELEASE (*)
| +--- org.springframework:spring-beans:4.1.7.RELEASE (*)
| +--- org.springframework:spring-core:4.1.7.RELEASE (*)
| \--- org.springframework:spring-expression:4.1.7.RELEASE
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-expression:4.1.7.RELEASE (*)
\--- org.springframework:spring-messaging:4.1.7.RELEASE
+--- org.springframework:spring-beans:4.1.7.RELEASE (*)
+--- org.springframework:spring-context:4.1.7.RELEASE (*)
\--- org.springframework:spring-core:4.1.7.RELEASE (*)

testRuntime - Runtime classpath for source set 'test'.
+--- org.slf4j:jcl-over-slf4j:1.7.9
| \--- org.slf4j:slf4j-api:1.7.9
+--- log4j:log4j:1.2.17
+--- org.slf4j:slf4j-log4j12:1.7.9
| +--- org.slf4j:slf4j-api:1.7.9
| \--- log4j:log4j:1.2.17
+--- org.springframework:spring-aop:4.1.7.RELEASE
| +--- aopalliance:aopalliance:1.0
| +--- org.springframework:spring-beans:4.1.7.RELEASE
| | \--- org.springframework:spring-core:4.1.7.RELEASE
| | \--- commons-logging:commons-logging:1.2
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-beans:4.1.7.RELEASE (*)
+--- org.springframework:spring-context:4.1.7.RELEASE
| +--- org.springframework:spring-aop:4.1.7.RELEASE (*)
| +--- org.springframework:spring-beans:4.1.7.RELEASE (*)
| +--- org.springframework:spring-core:4.1.7.RELEASE (*)
| \--- org.springframework:spring-expression:4.1.7.RELEASE
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-expression:4.1.7.RELEASE (*)
\--- org.springframework:spring-messaging:4.1.7.RELEASE
+--- org.springframework:spring-beans:4.1.7.RELEASE (*)
+--- org.springframework:spring-context:4.1.7.RELEASE (*)
\--- org.springframework:spring-core:4.1.7.RELEASE (*)

(*) - dependencies omitted (listed previously)

BUILD SUCCESSFUL

Total time: 0.209 secs
[sts] -----------------------------------------------------
[sts] Build finished succesfully!
[sts] Time taken: 0 min, 0 sec
[sts] -----------------------------------------------------




But when I add spring-tx dependency, the error appears about xsd at runtime.

[sts] -----------------------------------------------------
[sts] Starting Gradle build for the following tasks:
[sts] dependencies
[sts] -----------------------------------------------------
:dependencies

------------------------------------------------------------
Root project
------------------------------------------------------------

archives - Configuration for archive artifacts.
No dependencies

compile - Compile classpath for source set 'main'.
+--- org.slf4j:jcl-over-slf4j:1.7.9
| \--- org.slf4j:slf4j-api:1.7.9
+--- log4j:log4j:1.2.17
+--- org.slf4j:slf4j-log4j12:1.7.9
| +--- org.slf4j:slf4j-api:1.7.9
| \--- log4j:log4j:1.2.17
+--- org.springframework:spring-aop:4.1.7.RELEASE
| +--- aopalliance:aopalliance:1.0
| +--- org.springframework:spring-beans:4.1.7.RELEASE
| | \--- org.springframework:spring-core:4.1.7.RELEASE
| | \--- commons-logging:commons-logging:1.2
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-beans:4.1.7.RELEASE (*)
+--- org.springframework:spring-context:4.1.7.RELEASE
| +--- org.springframework:spring-aop:4.1.7.RELEASE (*)
| +--- org.springframework:spring-beans:4.1.7.RELEASE (*)
| +--- org.springframework:spring-core:4.1.7.RELEASE (*)
| \--- org.springframework:spring-expression:4.1.7.RELEASE
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-expression:4.1.7.RELEASE (*)
+--- org.springframework:spring-messaging:4.1.7.RELEASE
| +--- org.springframework:spring-beans:4.1.7.RELEASE (*)
| +--- org.springframework:spring-context:4.1.7.RELEASE (*)
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
\--- org.springframework:spring-tx:4.1.7.RELEASE
+--- org.springframework:spring-beans:4.1.7.RELEASE (*)
\--- org.springframework:spring-core:4.1.7.RELEASE (*)

default - Configuration for default artifacts.
+--- org.slf4j:jcl-over-slf4j:1.7.9
| \--- org.slf4j:slf4j-api:1.7.9
+--- log4j:log4j:1.2.17
+--- org.slf4j:slf4j-log4j12:1.7.9
| +--- org.slf4j:slf4j-api:1.7.9
| \--- log4j:log4j:1.2.17
+--- org.springframework:spring-aop:4.1.7.RELEASE
| +--- aopalliance:aopalliance:1.0
| +--- org.springframework:spring-beans:4.1.7.RELEASE
| | \--- org.springframework:spring-core:4.1.7.RELEASE
| | \--- commons-logging:commons-logging:1.2
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-beans:4.1.7.RELEASE (*)
+--- org.springframework:spring-context:4.1.7.RELEASE
| +--- org.springframework:spring-aop:4.1.7.RELEASE (*)
| +--- org.springframework:spring-beans:4.1.7.RELEASE (*)
| +--- org.springframework:spring-core:4.1.7.RELEASE (*)
| \--- org.springframework:spring-expression:4.1.7.RELEASE
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-expression:4.1.7.RELEASE (*)
+--- org.springframework:spring-messaging:4.1.7.RELEASE
| +--- org.springframework:spring-beans:4.1.7.RELEASE (*)
| +--- org.springframework:spring-context:4.1.7.RELEASE (*)
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
\--- org.springframework:spring-tx:4.1.7.RELEASE
+--- org.springframework:spring-beans:4.1.7.RELEASE (*)
\--- org.springframework:spring-core:4.1.7.RELEASE (*)

runtime - Runtime classpath for source set 'main'.
+--- org.slf4j:jcl-over-slf4j:1.7.9
| \--- org.slf4j:slf4j-api:1.7.9
+--- log4j:log4j:1.2.17
+--- org.slf4j:slf4j-log4j12:1.7.9
| +--- org.slf4j:slf4j-api:1.7.9
| \--- log4j:log4j:1.2.17
+--- org.springframework:spring-aop:4.1.7.RELEASE
| +--- aopalliance:aopalliance:1.0
| +--- org.springframework:spring-beans:4.1.7.RELEASE
| | \--- org.springframework:spring-core:4.1.7.RELEASE
| | \--- commons-logging:commons-logging:1.2
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-beans:4.1.7.RELEASE (*)
+--- org.springframework:spring-context:4.1.7.RELEASE
| +--- org.springframework:spring-aop:4.1.7.RELEASE (*)
| +--- org.springframework:spring-beans:4.1.7.RELEASE (*)
| +--- org.springframework:spring-core:4.1.7.RELEASE (*)
| \--- org.springframework:spring-expression:4.1.7.RELEASE
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-expression:4.1.7.RELEASE (*)
+--- org.springframework:spring-messaging:4.1.7.RELEASE
| +--- org.springframework:spring-beans:4.1.7.RELEASE (*)
| +--- org.springframework:spring-context:4.1.7.RELEASE (*)
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
\--- org.springframework:spring-tx:4.1.7.RELEASE
+--- org.springframework:spring-beans:4.1.7.RELEASE (*)
\--- org.springframework:spring-core:4.1.7.RELEASE (*)

testCompile - Compile classpath for source set 'test'.
+--- org.slf4j:jcl-over-slf4j:1.7.9
| \--- org.slf4j:slf4j-api:1.7.9
+--- log4j:log4j:1.2.17
+--- org.slf4j:slf4j-log4j12:1.7.9
| +--- org.slf4j:slf4j-api:1.7.9
| \--- log4j:log4j:1.2.17
+--- org.springframework:spring-aop:4.1.7.RELEASE
| +--- aopalliance:aopalliance:1.0
| +--- org.springframework:spring-beans:4.1.7.RELEASE
| | \--- org.springframework:spring-core:4.1.7.RELEASE
| | \--- commons-logging:commons-logging:1.2
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-beans:4.1.7.RELEASE (*)
+--- org.springframework:spring-context:4.1.7.RELEASE
| +--- org.springframework:spring-aop:4.1.7.RELEASE (*)
| +--- org.springframework:spring-beans:4.1.7.RELEASE (*)
| +--- org.springframework:spring-core:4.1.7.RELEASE (*)
| \--- org.springframework:spring-expression:4.1.7.RELEASE
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-expression:4.1.7.RELEASE (*)
+--- org.springframework:spring-messaging:4.1.7.RELEASE
| +--- org.springframework:spring-beans:4.1.7.RELEASE (*)
| +--- org.springframework:spring-context:4.1.7.RELEASE (*)
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
\--- org.springframework:spring-tx:4.1.7.RELEASE
+--- org.springframework:spring-beans:4.1.7.RELEASE (*)
\--- org.springframework:spring-core:4.1.7.RELEASE (*)

testRuntime - Runtime classpath for source set 'test'.
+--- org.slf4j:jcl-over-slf4j:1.7.9
| \--- org.slf4j:slf4j-api:1.7.9
+--- log4j:log4j:1.2.17
+--- org.slf4j:slf4j-log4j12:1.7.9
| +--- org.slf4j:slf4j-api:1.7.9
| \--- log4j:log4j:1.2.17
+--- org.springframework:spring-aop:4.1.7.RELEASE
| +--- aopalliance:aopalliance:1.0
| +--- org.springframework:spring-beans:4.1.7.RELEASE
| | \--- org.springframework:spring-core:4.1.7.RELEASE
| | \--- commons-logging:commons-logging:1.2
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-beans:4.1.7.RELEASE (*)
+--- org.springframework:spring-context:4.1.7.RELEASE
| +--- org.springframework:spring-aop:4.1.7.RELEASE (*)
| +--- org.springframework:spring-beans:4.1.7.RELEASE (*)
| +--- org.springframework:spring-core:4.1.7.RELEASE (*)
| \--- org.springframework:spring-expression:4.1.7.RELEASE
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-core:4.1.7.RELEASE (*)
+--- org.springframework:spring-expression:4.1.7.RELEASE (*)
+--- org.springframework:spring-messaging:4.1.7.RELEASE
| +--- org.springframework:spring-beans:4.1.7.RELEASE (*)
| +--- org.springframework:spring-context:4.1.7.RELEASE (*)
| \--- org.springframework:spring-core:4.1.7.RELEASE (*)
\--- org.springframework:spring-tx:4.1.7.RELEASE
+--- org.springframework:spring-beans:4.1.7.RELEASE (*)
\--- org.springframework:spring-core:4.1.7.RELEASE (*)

(*) - dependencies omitted (listed previously)

BUILD SUCCESSFUL

Total time: 0.208 secs
[sts] -----------------------------------------------------
[sts] Build finished succesfully!
[sts] Time taken: 0 min, 0 sec
[sts] -----------------------------------------------------



The only difference that I found is

\--- org.springframework:spring-tx:4.1.7.RELEASE
+--- org.springframework:spring-beans:4.1.7.RELEASE (*)
\--- org.springframework:spring-core:4.1.7.RELEASE (*)


spring-beans and spring-core were added before with this version.
 
jamshut kishelmek
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found that the problem was that in jar/META-INF there're several spring.handlers, spring.schemas and spring.tooling files. If I merge these files to one for each one, the context xsd is found successfully.
But for this moment I don't know how to do this merge in my gradle.build file.
    Bookmark Topic Watch Topic
  • New Topic