Spring source suite spring3 + Hibernate4 + maven 3 + MySQL 5

后端 未结 5 1048
南笙
南笙 2021-02-05 18:22

I am getting an error in my application but I\'m not sure what it means. I posted some sample code bellow. This is the error I get:

> SEVERE: Exception sendin         


        
5条回答
  •  遥遥无期
    2021-02-05 18:57

    Just looking at the issue it's coming from this code:

    if ( ConnectionProvider.class.equals( unwrapType ) ||
                    DriverManagerConnectionProviderImpl.class.isAssignableFrom( unwrapType ) ) {
                return (T) this;
            }
            else {
                throw new UnknownUnwrapTypeException( unwrapType );
            }
    

    where unwrapType is javax.sql.DataSource.

    Whilst I can't explain exactly what it is about your config that causes this I can suggest a fix.

    Define a DriverManagerDataSource bean in your spring application context and then provide this as a property to your LocalSessionFactoryBean. Make sure you remove the datasource configuration from your Hibernate configuration file.

提交回复
热议问题