• 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
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Issue while adding commons validator dependency in pom.xml of Spring 3.1 project

 
Greenhorn
Posts: 12
Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my project, which is being developed in Spring 3.1, I am trying to perform both client side and server side validations by making use of Apache Commons Validator. But just by adding the below mentioned code is causing some xml exception.

added dependency in pom.xml --> <dependency>
<groupId>org.springmodules</groupId>
<artifactId>spring-modules-validation</artifactId>
<version>0.8</version>
</dependency>


compile time exception in servlet-context.xml --> Resource Path Location Type Referenced file contains errors (jar:file:/C:/Users/shift/.m2/repository/org/springframework/spring-beans/3.1.0.RELEASE/spring-beans-3.1.0.RELEASE.jar!/org/springframework/beans/factory/xml/spring-beans-3.0.xsd).


I read somewhere that the jars of Spring 3.1 might be colliding with Spring 2.x (which is added in maven repository as spring-modules-validation brings it with it). After that I added an exclusion as mentioned below: -

<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
</exclusion>

After which the exception disappeared but inbuilt classes like InternalResourceViewResolver, DataSourceTransactionManager, etc. are not found by the compiler.

Is there something else which I have missed, or any other way apart from Commons Validator to perform client and server side validations in Spring 3.1 ?
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes have a look at hibernate-validator and using the JSR-303 annotations. Spring 3 has support for this. Have a look here.

http://blog.springsource.org/2009/11/17/spring-3-type-conversion-and-validation/
 
Gaurav Lala
Greenhorn
Posts: 12
Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Bill, it helps....
 
Willie Smits increased rainfall 25% in three years by planting trees. Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!