java.lang.UnsupportedOperationException: The application must supply JDBC connections.
// Codigo
<dependency></br>
<groupId>org.postgresql</groupId></br>
<artifactId>postgresql</artifactId></br>
<version>9.3-1100-jdbc4</version>
</dependency>
package br.com.melhorcaminho.config;
import java.util.Properties;
import javax.persistence.EntityManagerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.JpaVendorAdapter;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@EnableTransactionManagement
public class JpaConfigurationApp {
@Bean
public LocalContainerEntityManagerFactoryBean entityManager(){
LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
JpaVendorAdapter jpaAdapter= new HibernateJpaVendorAdapter();
factory.setJpaVendorAdapter(jpaAdapter);
DriverManagerDataSource source = new DriverManagerDataSource();
source.setUsername("postgres");
source.setPassword("");
source.setUrl("jdbc:postgresql://localhost:5432/MC");
source.setDriverClassName("org.postgresql.Driver");
Properties props = new Properties();
props.setProperty("hibernate.dialect" , "org.hibernate.dialect.PostgreSQLDialect");
props.setProperty("hibernate.show_sql", "true");
props.setProperty("hibernate.hbm2ddl.auto", "update");
factory.setJpaProperties(props);
factory.setPackagesToScan("br.com.melhorcaminho.model");
return factory;
}
@Bean
public JpaTransactionManager jpaTransactionManager(EntityManagerFactory factory){
return new JpaTransactionManager(factory);
}
}
Como corrigir esse erro ?