1

While Migrating java hybrid Application from java 8 to java 17 with latest maven version. Here are the following version changes during migration.

-> Jdk8 to jdk17

-> Maven 3.1 to maven 3.8.6

-> Tomcat 7 to Tomcat 10.

-> Migrate javax to jakarta servlet.

Here are the following parent pom details as per new stack version:

<dependency>
    <groupId>jakarta.platform</groupId>
    <artifactId>jakarta.jakartaee-api</artifactId>
    <version>10.0.0</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>jakarta.xml.bind</groupId>
    <artifactId>jakarta.xml.bind-api</artifactId>
    <version>3.0.1</version>
    <scope>runtime</scope>
    <exclusions>
        <exclusion>
            <artifactId>xml-apis</artifactId>
            <groupId>xml-apis</groupId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.glassfish.jaxb</groupId>
    <artifactId>jaxb-runtime</artifactId>
    <version>3.0.2</version>
    <scope>runtime</scope>
    <exclusions>
        <exclusion>
            <artifactId>xml-apis</artifactId>
            <groupId>xml-apis</groupId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>6.1.7.Final</version>
</dependency>
<dependency>
    <groupId>org.hibernate.orm</groupId>
    <artifactId>hibernate-entitymanager</artifactId>
    <version>6.0.0.Alpha7</version>
    <scope>runtime</scope>
</dependency>
<dependency>
    <groupId>org.hibernate.orm</groupId>
    <artifactId>hibernate-envers-jakarta</artifactId>
    <version>6.0.0.Alpha9</version>
</dependency>
<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-validator</artifactId>
    <version>8.0.0.Final</version>
    <scope>runtime</scope>
</dependency>

Following errors which i face during build project:

cannot find symbol 
[ERROR]   symbol:   class LogicalAuditExpression
[ERROR]   location: package org.hibernate.envers.query.criteria cannot find symbol 
[ERROR]   symbol:   class JavaTypeDescriptor
[ERROR]   location: package org.hibernate.type.descriptor.java cannot find symbol 
[ERROR]   symbol:   class BasicBinder 
[ERROR]   location: package org.hibernate.type.descriptor.sql cannot find symbol 
[ERROR]   symbol:   class SqlTypeDescriptor 
[ERROR]   location: class com.xxx.framework.base.jdbc.postgresql.PostgreSQLDialect cannot find symbol 
[ERROR]   symbol:   class YesNoType 
[ERROR]   location: package org.hibernate.type package org.hibernate.service.jdbc.dialect.internal does not exist

I tried changing hibernate core library version, still the error persists. Can you help to resolve or share any example related to hibernate with java 17? and also i cannot find hibernate.jpa library related to jakarta.

I tried changing versions and library based on java 17. I want to build with latest stack version.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Saran
  • 101
  • 1
  • 4
  • 2
    Ditch `hibernate-entitymanager` as that isn't needed anyumore. All the `org.hibernate.orm` versions in use should match. You are mixing different versions. I would also suggest to do things one by one. First java upgrade, next maven (or vice-versa) then start to upgrade to tomcat 10 (only change servlet stuff and keep old hibernate), then lastly upgrade hibernate. Finally you seem to have some custom code for Hibernate which needs to be migrated as well, classes in hibernate have been removed/replaced so fix your custom code as well. It isn't a drop in replacement. – M. Deinum Jul 11 '23 at 08:04
  • Thanks for the comments. Yes i have been doing step by step. Finally after trying to upgrade hibernate got stuck in it. So yes i will try to replace with all the org.hibernate.orm versions. and some of the functions are missing/removed in the hibernate library. Not sure how to replace the existing. Any reference on how to use hibernate for latest stack? Thanks. – Saran Jul 11 '23 at 08:23
  • I would strongly suggest to chck the Hibernate release notes, those tell you generally what to modify. – M. Deinum Jul 11 '23 at 08:27

0 Answers0