Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.(5)

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

ITtutoria

ITtutoria Logo ITtutoria Logo

ITtutoria Navigation

  • Python
  • Java
  • Reactjs
  • JavaScript
  • R
  • PySpark
  • MYSQL
  • Pandas
  • QA
  • C++
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Python
  • Science
  • Java
  • JavaScript
  • Reactjs
  • Nodejs
  • Tools
  • QA
Home/ Questions/Error: access to dialectresolutioninfo cannot be null when 'hibernate.dialect' not set – Quick tips
Next
Answered
Jade Bouchet
  • 9
Jade Bouchet
Asked: May 12, 20222022-05-12T09:27:53+00:00 2022-05-12T09:27:53+00:00In: java

Error: access to dialectresolutioninfo cannot be null when ‘hibernate.dialect’ not set – Quick tips

  • 9

. Advertisement .

..3..

. Advertisement .

..4..

I am tired of fixing the problem: access to dialectresolutioninfo cannot be null when ‘hibernate.dialect’ not set in the java; even if I get the reference from another forum, it still returns an error:

Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
  at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:104)
  at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:71)
  at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:205)
  at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111)
  at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234)
  at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206)
  at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1885)
  at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1843)
  at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)
  at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843)
  at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:398)
  at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842)
  at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:152)
  at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:336)
  at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1613)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1550)
  ... 21 more

To identity the problem, I will show you the detail here:

<parent>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-parent</artifactId>
  <version>1.1.8.RELEASE</version>
 </parent>
 
 <dependencies>
  <dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-web</artifactId>
  </dependency>
  <dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-actuator</artifactId>
  </dependency>
  <dependency>
  <groupId>org.springframework.security</groupId>
  <artifactId>spring-security-web</artifactId>
  </dependency>
  <dependency>
  <groupId>org.springframework.security</groupId>
  <artifactId>spring-security-config</artifactId>
  </dependency>
  <dependency>
  <groupId>org.springframework.security</groupId>
  <artifactId>spring-security-taglibs</artifactId>
  </dependency>
  <dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-data-jpa</artifactId>
  </dependency>
  <dependency>
  <groupId>commons-dbcp</groupId>
  <artifactId>commons-dbcp</artifactId>
  </dependency>
 </dependencies>
@Configuration
 @EnableTransactionManagement
 @ComponentScan({ "com.spring.app" })
 public class HibernateConfig {
 
  @Bean
  public LocalSessionFactoryBean sessionFactory() {
  LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
 
  sessionFactory.setDataSource(restDataSource());
  sessionFactory.setPackagesToScan(new String[] { "com.spring.app.model" });
  sessionFactory.setHibernateProperties(hibernateProperties());
 
  return sessionFactory;
  }
 
  @Bean
  public DataSource restDataSource() {
  BasicDataSource dataSource = new BasicDataSource();
 
  dataSource.setDriverClassName("org.postgresql.Driver");
  dataSource.setUrl("jdbc:postgresql://localhost:5432/teste?charSet=LATIN1");
  dataSource.setUsername("klebermo");
  dataSource.setPassword("123");
 
  return dataSource;
  }
 
  @Bean
  @Autowired
  public HibernateTransactionManager transactionManager(SessionFactory sessionFactory) {
  HibernateTransactionManager txManager = new HibernateTransactionManager();
  txManager.setSessionFactory(sessionFactory);
  return txManager;
  }
 
  @Bean
  public PersistenceExceptionTranslationPostProcessor exceptionTranslation() {
  return new PersistenceExceptionTranslationPostProcessor();
  }
 
  Properties hibernateProperties() {
  return new Properties() {
  /**
  * 
  */
  private static final long serialVersionUID = 1L;
 
  {
  setProperty("hibernate.hbm2ddl.auto", "create");
  setProperty("hibernate.show_sql", "false");
  setProperty("hibernate.dialect", "org.hibernate.dialect.PostgreSQLDialect");
  }
  };
  }
 }

How do I do that? Could you support me in improving this problem?

dialectresolutioninfo
  • 2 2 Answers
  • 221 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook
  • Report

2 Answers

  • Voted
  • Oldest
  • Recent
  • Random
  1. Best Answer
    dhtutoria Expert
    2022-06-01T10:15:31+00:00Added an answer on June 1, 2022 at 10:15 am

    The cause:

    gene_name = no_headers.iloc[1:,[1]]

    This creates a DataFrame because you passed a list of columns (single, but still a list). When you later do this:

    gene_name[x]

    Now you have a Series object with a single value, so you can’t hash the Series.

    Solution: You can resolve the error by creating Series from the start.

    gene_type = no_headers.iloc[1:,0]
    gene_name = no_headers.iloc[1:,1]
    disease_name = no_headers.iloc[1:,2]
    • 12
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  2. Manon Rigaud
    2022-05-25T19:38:25+00:00Added an answer on May 25, 2022 at 7:38 pm

    Similar problem occurred when I tried to start the application using Spring Boot and the database server was down.

    Hibernate is able to determine which dialect to use by itself, but it requires a connection to the database.

    • 17
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question
  • How to Split String by space in C++
  • How To Convert A Pandas DataFrame Column To A List
  • How to Replace Multiple Characters in A String in Python?
  • How To Remove Special Characters From String Python

Explore

  • Home
  • Tutorial

Footer

ITtutoria

ITtutoria

This website is user friendly and will facilitate transferring knowledge. It would be useful for a self-initiated learning process.

@ ITTutoria Co Ltd.

Tutorial

  • Home
  • Python
  • Science
  • Java
  • JavaScript
  • Reactjs
  • Nodejs
  • Tools
  • QA

Legal Stuff

  • About Us
  • Terms of Use
  • Privacy Policy
  • Contact Us

DMCA.com Protection Status

Help

  • Knowledge Base
  • Support

Follow

© 2022 Ittutoria. All Rights Reserved.

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.