Results 1 to 2 of 2

Thread: NoSuchMethodError in Spring JDBC

  1. #1
    Join Date
    Oct 2008
    Posts
    2

    Default NoSuchMethodError in Spring JDBC

    Hi,

    I'm using Spring JDBC and get an exception whenever I try to use it:

    Code:
    EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
    db = builder.setType(EmbeddedDatabaseType.H2).addScript("file:" + getClass().getResource("trades.sql").getPath()).build();
    Code:
    Exception in thread "main" java.lang.NoSuchMethodError: org.springframework.util.StringUtils.hasText(Ljava/lang/CharSequence;)Z
    	at org.springframework.jdbc.datasource.init.ResourceDatabasePopulator.splitSqlScript(ResourceDatabasePopulator.java:274)
    	at org.springframework.jdbc.datasource.init.ResourceDatabasePopulator.executeSqlScript(ResourceDatabasePopulator.java:162)
    	at org.springframework.jdbc.datasource.init.ResourceDatabasePopulator.populate(ResourceDatabasePopulator.java:120)
    	at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory.populateDatabase(EmbeddedDatabaseFactory.java:153)
    	at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory.initDatabase(EmbeddedDatabaseFactory.java:139)
    	at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory.getDatabase(EmbeddedDatabaseFactory.java:114)
    	at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder.build(EmbeddedDatabaseBuilder.java:112)
    The following jars are in my build path:

    org.springframework.aop-3.0.5.RELEASE.jar
    org.springframework.asm-3.0.5.RELEASE.jar
    org.springframework.aspects-3.0.5.RELEASE.jar
    org.springframework.beans-3.0.5.RELEASE.jar
    org.springframework.context-3.0.5.RELEASE.jar
    org.springframework.context.support-3.0.5.RELEASE.jar
    org.springframework.core-3.0.5.RELEASE.jar
    org.springframework.expression-3.0.5.RELEASE.jar
    org.springframework.instrument-3.0.5.RELEASE.jar
    org.springframework.instrument.tomcat-3.0.5.RELEASE.jar
    org.springframework.jdbc-3.0.5.RELEASE.jar
    org.springframework.jms-3.0.5.RELEASE.jar
    org.springframework.orm-3.0.5.RELEASE.jar
    org.springframework.oxm-3.0.5.RELEASE.jar
    org.springframework.spring-library-3.0.5.RELEASE.libd
    org.springframework.test-3.0.5.RELEASE.jar
    org.springframework.transaction-3.0.5.RELEASE.jar
    org.springframework.web-3.0.5.RELEASE.jar
    org.springframework.web.portlet-3.0.5.RELEASE.jar
    org.springframework.web.servlet-3.0.5.RELEASE.jar
    org.springframework.web.struts-3.0.5.RELEASE.jar
    h2-1.3.161.jar
    hibernate-3.3.1.GA.jar
    hibernate-annotations.jar
    hibernate-c3p0-3.3.1.GA.jar

    Does anyone have any ideas where I'm going wrong?

    Thanks

  2. #2
    Join Date
    Aug 2006
    Location
    Arequipa-Peru / South America
    Posts
    2,806

    Default

    Hello

    Code:
    Exception in thread "main" java.lang.NoSuchMethodError: 
    org.springframework.util.StringUtils.hasText(Ljava/lang/CharSequence;)Z
    It is a conflict of versions. Could you update to the last version of Spring (3.1) and Hibernate?

    Same consideration for h2

    Let me know your advance
    - Manuel Jordan

    Kill Your Pride, Share Your Knowledge With All
    The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7

    Blog


    Technical Reviewer of Apress

    • Pro SpringSource dm Server
    • Spring Enterprise Recipes: A Problem-Solution Approach
    • Spring Recipes: A Problem-Solution Approach, 2nd Edition
    • Pro Spring Integration
    • Pro Spring Batch
    • Pro Spring 3
    • Pro Spring MVC: With Web Flow
    • Pro Spring Security

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
  •