Upgrading issues with spring-data-jpa from 1.9.5.RELEASE to 2.1.2.RELEASE

I'm trying to upgrade spring-data-jpa to its latest version i.e 2.1.2.RELEASE. But I'm facing a issue while deploying project in tomcat.

[INFO ] 2018-11-14 13:07:52.454 [localhost-startStop-1] LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default'
[WARN ] 2018-11-14 13:07:53.317 [localhost-startStop-1] XmlWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'accountRestController': Unsatisfied dependency expressed through field 'pgTransactionService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'PGTransactionServiceImpl': Unsatisfied dependency expressed through field 'onlineTxnLogDao'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'onlineTxnLogDao': Unsatisfied dependency expressed through field 'onlineTxnLogRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'onlineTxnLogRepository': Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.jpa.repository.support.QuerydslJpaPredicateExecutor]: Constructor threw exception; nested exception is java.lang.ClassCastException: com.chat.dao.model.QPGOnlineTxnLog cannot be cast to com.querydsl.core.types.EntityPath
[INFO ] 2018-11-14 13:07:53.318 [localhost-startStop-1] LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default'
[ERROR] 2018-11-14 13:07:53.332 [localhost-startStop-1] ContextLoader - Context initialization failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'accountRestController': Unsatisfied dependency expressed through field 'pgTransactionService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'PGTransactionServiceImpl': Unsatisfied dependency expressed through field 'onlineTxnLogDao'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'onlineTxnLogDao': Unsatisfied dependency expressed through field 'onlineTxnLogRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'onlineTxnLogRepository': Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.jpa.repository.support.QuerydslJpaPredicateExecutor]: Constructor threw exception; nested exception is java.lang.ClassCastException: com.chat.dao.model.QPGOnlineTxnLog cannot be cast to com.querydsl.core.types.EntityPath
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:596) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:374) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1378) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:575) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:846) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:863) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:400) ~[spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291) [spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103) [spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4813) [catalina.jar:8.0.35]
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5272) [catalina.jar:8.0.35]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) [catalina.jar:8.0.35]
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1407) [catalina.jar:8.0.35]
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1397) [catalina.jar:8.0.35]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_151]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_151]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_151]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]

I have searched all over the internet but could not find any solution to this. I have recently upgraded to spring 5.1.2. Here are the dependencies i'm using for jpa

        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-jpa</artifactId>
            <version>2.1.2.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>com.mysema.querydsl</groupId>
            <artifactId>querydsl-core</artifactId>
            <version>3.7.4</version>
        </dependency>

        <dependency>
            <groupId>com.mysema.querydsl</groupId>
            <artifactId>querydsl-apt</artifactId>
            <version>3.7.4</version>
        </dependency>

        <dependency>
            <groupId>com.mysema.querydsl</groupId>
            <artifactId>querydsl-jpa</artifactId>
            <version>3.7.4</version>
        </dependency>

        <dependency>
            <groupId>com.querydsl</groupId>
            <artifactId>querydsl-jpa</artifactId>
            <version>4.1.3</version>
        </dependency>

Here is the xml config file i'm using

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:util="http://www.springframework.org/schema/util" xmlns:context="http://www.springframework.org/schema/context"
    xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:jpa="http://www.springframework.org/schema/data/jpa"
    xsi:schemaLocation="
        http://www.springframework.org/schema/util 
        http://www.springframework.org/schema/util/spring-util-4.1.xsd
        http://www.springframework.org/schema/beans 
        http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
        http://www.springframework.org/schema/context 
        http://www.springframework.org/schema/context/spring-context-4.1.xsd
        http://www.springframework.org/schema/aop 
        http://www.springframework.org/schema/aop/spring-aop-4.1.xsd
        http://www.springframework.org/schema/mvc 
        http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd
        http://www.springframework.org/schema/oxm 
        http://www.springframework.org/schema/oxm/spring-oxm-4.1.xsd
        http://www.springframework.org/schema/jee 
        http://www.springframework.org/schema/jee/spring-jee-4.1.xsd
        http://www.springframework.org/schema/tx
        http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
        http://www.springframework.org/schema/data/jpa
        http://www.springframework.org/schema/data/jpa/spring-jpa.xsd ">

    <jee:jndi-lookup id="chatSysConfigId"
        jndi-name="java:comp/env/java/chatSysConfig" resource-ref="true" />

    <!-- bean declaration to read properties file -->
    <bean id="chatProperties"
        class="org.springframework.beans.factory.config.PropertiesFactoryBean">
        <property name="location" ref="chatSysConfigId" />
    </bean>

    <bean id="propertyConfigurer"
        class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <ref bean="chatSysConfigId" />
            </list>
        </property>
    </bean>

    <context:annotation-config />
    <context:component-scan base-package="com.chat" />
    <mvc:annotation-driven />

    <jpa:repositories base-package="com.chat.dao.repository" />

    <bean id="dataSource" class="com.zaxxer.hikari.HikariDataSource"
        destroy-method="close">
        <property name="driverClassName" value="${chat.db.driverClass}" />
        <property name="jdbcUrl" value="${chat.db.jdbcUrl}" />
        <property name="username" value="${chat.db.user}" />
        <property name="password" value="${chat.db.password}" />
        <property name="maximumPoolSize" value="${chat.db.maxPoolSize}" />
        <property name="minimumIdle" value="${chat.db.minPoolSize}" />
        <property name="idleTimeout" value="${chat.db.idleConnectionTestPeriod}" />

        <property name="connectionTimeout" value="${chat.db.connectionTimeout}" />
        <property name="maxLifetime" value="${chat.db.maxLifetime}" />
        <property name="leakDetectionThreshold" value="${chat.db.leakDetectionThreshold}" />
        <property name="poolName" value="${chat.db.poolName}" />
        <property name="dataSourceProperties" ref="dataSourcePropertiesId" />
    </bean>

    <util:properties id="dataSourcePropertiesId">
        <prop key="cachePrepStmts">${chat.db.cachePrepStmts}</prop>
        <prop key="prepStmtCacheSize">${chat.db.prepStmtCacheSize}</prop>
        <prop key="prepStmtCacheSqlLimit">${chat.db.prepStmtCacheSqlLimit}</prop>
        <prop key="useServerPrepStmts">${chat.db.useServerPrepStmts}</prop>
    </util:properties>

    <!-- Transaction Manager -->
    <bean id="txManager"
        class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource" />
    </bean>

    <tx:annotation-driven transaction-manager="transactionManager" />

    <bean id="jpaVendorAdapter"
        class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
        <property name="showSql" value="true" />
        <property name="generateDdl" value="false" />
        <property name="database" value="${chat.db.database}" />
    </bean>

    <bean id="entityManagerFactory"
        class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="jpaVendorAdapter" ref="jpaVendorAdapter" />
        <property name="jpaProperties">
          <props>
            <prop key="hibernate.id.new_generator_mappings">false</prop>
          </props>
        </property>
        <!-- spring based scanning for entity classes -->
        <property name="packagesToScan" value="com.chat.dao" />
    </bean>

    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory" />
    </bean>

</beans>

What am I doing wrong here. I am missing something? And before this I had got a maven build issue "cannot access OrderSpecifier" and found the solution here that I had to add a jpa dependency. Which is

    <dependency>
        <groupId>com.querydsl</groupId>
        <artifactId>querydsl-jpa</artifactId>
        <version>4.1.3</version>
    </dependency>

Which resolved the build issue but now I'm getting all this other issues while deploying.