Announcement Announcement Module
No announcement yet.
petclinic sample with hibernate/mysql Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • petclinic sample with hibernate/mysql

    Hello. I am very new to Spring, and have what I am afraid is a very, very naive question (with associated problem).

    I am attempting to deploy the petclinic sample included in Spring 1.1 RC2 to a resin 3.0 server in an effort to learn about Spring and related technology. I have several working webapps running under this server (jspwiki, and a couple of Struts apps).

    I have attempted to modify the petclinic configuration to use mysql by editing appropriately:

    I have made no other modifications to the app or resin configuration. I used the initDB.txt script to create the database, and all looks good there.

    When starting resin, I see no errors, warnings or other red flags. Among other things, it reports:

    [15:14:51.594] Using dialect: net.sf.hibernate.dialect.MySQLDialect
    [15:14:51.602] Maximim outer join fetch depth: 2
    [15:14:51.607] Use outer join fetching: true
    [15:14:51.615] Initializing connection provider: org.springframework.orm.hibernate.LocalDataSourceConnectionProvider
    [15:14:51.633] No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
    [15:14:52.029] Use scrollable result sets: true
    [15:14:52.030] Use JDBC3 getGeneratedKeys(): true
    [15:14:52.030] Optimize cache for minimal puts: false
    [15:14:52.031] Query language substitutions: {}
    [15:14:52.031] cache provider: net.sf.hibernate.cache.EhCacheProvider
    [15:14:52.041] instantiating and configuring caches
    [15:14:52.731] building session factory
    [15:14:55.245] Not binding factory to JNDI, no JNDI name configured
    [15:14:55.246] Creating shared instance of singleton bean 'transactionManager'
    [15:14:55.503] Using DataSource [[email protected]8f] of Hibernate SessionFactory for HibernateTransactionManager
    [15:14:55.903] Database Product Name is MySQL
    [15:14:55.904] Driver Version is 2.0.14
    Deployment to resin works, and I can navigate the application. I added a 'vet' to the database by hand, and using the 'Display All vets' link displays the vet I added.

    However, when attempting to add an owner, I get an exception:

    java.lang.AbstractMethodError: com.mysql.jdbc.jdbc2.Connection.prepareStatement(Ljava/lang/String;I)Ljava/sql/PreparedStatement;
    So, I am guessing I have some silly configuration issue. Can anyone point me in the right direction?

    Thanks much,

  • #2
    Try using the MySQL Connector/J 3.0 driver. I don't think the 2.0 driver supports the generatedKey feature from the JDBC 3.0 spec.


    • #3
      petclinic sample with hibernate/mysql

      Originally posted by trisberg
      Try using the MySQL Connector/J 3.0 driver. I don't think the 2.0 driver supports the generatedKey feature from the JDBC 3.0 spec.
      Thanks very much Thomas, that did the trick.

      <sheepish grin>