Results 1 to 7 of 7

Thread: Spring Tutorial jar file references to 2.0 not available in Spring 3.0

  1. #1
    Join Date
    Jul 2010
    Posts
    10

    Default Spring Tutorial jar file references to 2.0 not available in Spring 3.0

    Hi,

    Environment: Spring 3.0.1, Tomcat 6.0.26, Java 1.6.0_18

    Just like to commend the Spring Tutorial contributor/s - great job. I have successfully implemented the first 5 parts of the tut.

    The only problem is when I get to part 6, there is a reference to a few jars which have changed location in the spring distribution(or have been renamed or removed). The tutorial, it appears, was written for Spring 2.0. I have run the first 5 parts of the tut on Spring 3.0.

    When I search for the jar files specific to part 6 of the tutorial in my local spring distribution, they don't show up.

    The jar files as referenced in the tut are 'aspectjweaver.jar', 'commons-dbcp.jar' and 'commons-pool.jar':

    For all this to work we need some additional jar files copied to the 'WEB-INF/lib' directory. Copy aspectjweaver.jar from the 'spring-framework-2.5/lib/aspectj' directory and commons-dbcp.jar and commons-pool.jar from the 'spring-framework-2.5/lib/jakarta-commons' directory to the 'springapp/war/WEB-INF/lib' directory.
    http://static.springsource.org/docs/...tep/part6.html

    If anyone could point out the appropriate jars to use, that would be much appreciated.

    Jim
    Last edited by jim2; Jul 5th, 2010 at 11:00 AM. Reason: Included environment details.

  2. #2
    Join Date
    Jul 2010
    Posts
    10

    Default

    Hi,

    Just to update anyone who may run into this problem, the reason I asked about which 3.x jars were appropriate was because I assumed the tutorial could be excercised against spring versions subsequent to 2.x. When I couldn't find the appropriate jars for part 6 of the tutorial in the 3.x spring dist, I substituted the most appropriate ones I could find in the 3.x dist. But I got cryptic-looking errors at tomcat startup.

    So I decided to go back to the earlier version of spring (i.e. 2.x). I cleared out the WEB-INF/lib jars in my eclipse workspace and replaced them with those referenced in the tutorial one-by-one and it(part6) is now working.

    Jim

  3. #3
    Join Date
    Jan 2011
    Posts
    1

    Default

    Helo Jim,

    I also ran into the same problem while following the tutorial. It seems that Spring 3.0 does not support the "aop" and "tx" namespaces. If you remove the aop and tx tags portion at the end of the applicationContext.xml file, then the application should work. I tested it in a similar configuration and it is working. You will still need the jars 'aspectjweaver.jar', 'commons-dbcp.jar' and 'commons-pool.jar' which needs to be downloaded separately. I don't think this is the correct way of developing with Spring 3.x but just to get the tutorial up and running with Spring 3.x , this should work.

  4. #4
    Join Date
    Dec 2010
    Location
    Singapore
    Posts
    286

    Default

    Quote Originally Posted by jim2 View Post
    Hi,

    Just to update anyone who may run into this problem, the reason I asked about which 3.x jars were appropriate was because I assumed the tutorial could be excercised against spring versions subsequent to 2.x. When I couldn't find the appropriate jars for part 6 of the tutorial in the 3.x spring dist, I substituted the most appropriate ones I could find in the 3.x dist. But I got cryptic-looking errors at tomcat startup.

    So I decided to go back to the earlier version of spring (i.e. 2.x). I cleared out the WEB-INF/lib jars in my eclipse workspace and replaced them with those referenced in the tutorial one-by-one and it(part6) is now working.

    Jim
    You should be able to find the dependencies in this zip http://s3.amazonaws.com/dist.springf...pendencies.zip
    Amila Domingo

  5. #5
    Join Date
    Apr 2011
    Posts
    2

    Default

    You don't need aspectjweaver.jar to get it to work if you cut out the aop namespaces and tags from applicationContext.xml. I would really like to see this same example updated to Spring 3, including:

    1.) how to implement the aop/tx stuff given in the example using Spring 3
    2.) the replacements for SimpleFormController (I assume it involves @Controller annotations)and AbstractTransactionalDataSourceSpringContextTests which are depracated and will go away in the next release
    3.) how to do JSR-303 bean validation with annotations (ie @NotEmpty, etc).

    Spring 3 seems like a significant enough release that this would be useful.

  6. #6
    Join Date
    Jul 2010
    Location
    Venice, Italy
    Posts
    709

    Default

    AspectJ and Apache Commons are not part of Spring, they are separate projects so it is quite normal that the jars aren't included in the Spring distribution...You all should really start using Maven (or Ivy) to manage your dependencies, it truly saves you the pain of looking for dependencies yourselves... but if you really can't / don't want to, then just get the jars yourselves from the AspectJ site and the Apache Commons site (just google the names) and place them in your classpath...

  7. #7
    Join Date
    Apr 2011
    Posts
    2

    Default

    I'm aware that they aren't part of Spring. The point is that the aop portions of the example jim is citing (http://static.springsource.org/docs/...-step-by-step/) don't work for Spring 3, so you don't need to bother getting aspectjweaver.jar to complete it.

    Quite frankly, Maven sucks for the bandwidth challenged. It's quicker for me to use findjar.com and download the jars myself.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •