dependencies - Maven downloading incorrect Spring jar versions -


i have been trying find way resolve issue while without success. namespaces using in bean xml follows:

<?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans"    xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"    xmlns:int="http://www.springframework.org/schema/integration"    xmlns:int-jdbc="http://www.springframework.org/schema/integration/jdbc"    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     http://www.springframework.org/schema/security      http://www.springframework.org/schema/security/spring-security.xsd">    <beans profile="dev, local">     <bean id="emailverificationmessagestore" class="org.springframework.integration.store.simplemessagestore"/> </beans> <beans profile="production, staging">     <int-jdbc:message-store id="emailverificationmessagestore" data-source="datasource" region="emailverification"/> </beans> 

the profile elements @ end of file shown above. when deploy tomcat server seeing following errors:

 line 58 in xml document url [file:/var/lib/tomcat6/webapps/project/web-inf/classes/meta-inf/spring/context.xml]  invalid; nested exception org.xml.sax.saxparseexception;   linenumber: 58; columnnumber: 33;  cvc-complex-type.2.4.a: invalid content found starting element 'beans'.  1 of '{"http://www.springframework.org/schema/beans":import,  "http://www.springframework.org/schema/beans":alias,   "http://www.springframework.org/schema/beans":bean,   wc[##other:"http://www.springframework.org/schema/beans"]}' expected. 

i ran mvn dependency:tree see maven downloading correct jar versions, seems though have specified latest versions in pom.xml downloading 3.0.0 jars:

 --- maven-dependency-plugin:2.8:tree (default-cli) @ services ---  downloading: http://repo.maven.apache.org/maven2/org/springframework/spring-aop/3.0.0.rc3/spring-aop-3.0.0.rc3.jar  downloading: http://repo.maven.apache.org/maven2/org/springframework/spring-context/3.0.0.rc3/spring-context-3.0.0.rc3.jar  downloading: http://repo.maven.apache.org/maven2/org/springframework/spring-asm/3.0.0.rc3/spring-asm-3.0.0.rc3.jar  downloading: http://repo.maven.apache.org/maven2/org/springframework/spring-core/3.0.0.rc3/spring-core-3.0.0.rc3.jar  downloading: http://repo.maven.apache.org/maven2/org/springframework/spring-beans/3.0.0.rc3/spring-beans-3.0.0.rc3.ja 

how can force maven download later version of jar?

found answer using eclipse's dependancy hierarchy tool , seems importing jersey jar includes spring 3.0.0 , therefore overrides other jars.

adding has resolved issue:

<dependency>         <groupid>com.sun.jersey.contribs</groupid>         <artifactid>jersey-spring</artifactid>         <version>1.8</version>         <exclusions>             <exclusion>                 <groupid>org.springframework</groupid>                 <artifactid>spring</artifactid>             </exclusion>             <exclusion>                 <groupid>org.springframework</groupid>                 <artifactid>spring-core</artifactid>             </exclusion>             <exclusion>                 <groupid>org.springframework</groupid>                 <artifactid>spring-web</artifactid>             </exclusion>             <exclusion>                 <groupid>org.springframework</groupid>                 <artifactid>spring-beans</artifactid>             </exclusion>             <exclusion>                 <groupid>org.springframework</groupid>                 <artifactid>spring-context</artifactid>             </exclusion>         </exclusions>     </dependency> 

Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -