Skip to content

Commit

Permalink
WIP: Spring Boot Upgrade -Hibernate problems
Browse files Browse the repository at this point in the history
  • Loading branch information
tonydamage committed Apr 4, 2024
1 parent e45ab75 commit 1a8ad58
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import org.apache.catalina.startup.Tomcat;
import org.apache.catalina.valves.ErrorReportValve;
import org.apache.catalina.webresources.ExtractingRoot;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.coyote.ajp.AbstractAjpProtocol;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.embedded.tomcat.TomcatWebServer;
Expand Down Expand Up @@ -47,6 +49,11 @@ public class MidPointTomcatServletWebServerFactory extends TomcatServletWebServe

private String jvmRoute;

/**
* Logger, uses TomcatServletWebServerFactory for backwards compatibility
*/
private static final Log LOG = LogFactory.getLog(TomcatServletWebServerFactory.class);

public MidPointTomcatServletWebServerFactory(String contextPath, SystemObjectCache systemObjectCache) {
this.contextPath = contextPath;
this.systemObjectCache = systemObjectCache;
Expand All @@ -68,7 +75,7 @@ protected TomcatWebServer getTomcatWebServer(Tomcat tomcat) {
String error = e.getMessage();
if (error != null && error.contains("Child name [] is not unique")) {
// Safely ignored, this covers Boot config: server.servlet.context-path=/
logger.debug("Ignoring duplicate root, probably root context is explicitly configured");
LOG.debug("Ignoring duplicate root, probably root context is explicitly configured");
} else {
throw e;
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>3.0.10</version>
<version>3.2.4</version>
<!-- This parent also declares dependencies listed here:
https://docs.spring.io/spring-boot/docs/2.7.3/reference/html/dependency-versions.html#dependency-versions
Or for current version of Spring Boot:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ public enum Database {
org.hibernate.dialect.SQLServerDialect.class.getName()),
ORACLE("oracle.jdbc.OracleDriver",
MidPointOracleDialect.class.getName(),
org.hibernate.dialect.OracleDialect.class.getName(),
org.hibernate.dialect.Oracle8iDialect.class.getName(),
org.hibernate.dialect.Oracle9iDialect.class.getName(),
org.hibernate.dialect.Oracle10gDialect.class.getName());
org.hibernate.dialect.OracleDialect.class.getName()
);

@NotNull List<String> drivers;
@NotNull List<String> dialects;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

import org.hibernate.boot.Metadata;
import org.hibernate.boot.model.relational.SqlStringGenerationContext;
import org.hibernate.dialect.Oracle12cDialect;
import org.hibernate.dialect.OracleDialect;
import org.hibernate.mapping.Index;
import org.hibernate.tool.schema.spi.Exporter;

/**
* Created by Viliam Repan (lazyman).
*/
public class MidPointOracleDialect extends Oracle12cDialect {
public class MidPointOracleDialect extends OracleDialect {

private static final String INITRANS = " initrans 30";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

package com.evolveum.midpoint.repo.sql.util;

import org.hibernate.dialect.SQLServer2008Dialect;
import org.hibernate.dialect.SQLServerDialect;

import java.sql.Types;

/**
* @author lazyman
*/
public class UnicodeSQLServer2008Dialect extends SQLServer2008Dialect {
public class UnicodeSQLServer2008Dialect extends SQLServerDialect {

private static final int MAX_LENGTH = 8000;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import java.nio.file.Path;

import org.springframework.boot.loader.PropertiesLauncher;
import org.springframework.boot.loader.launch.PropertiesLauncher;

/**
* This is a "pre-launcher" to {@link PropertiesLauncher} which is the actual launcher.
Expand Down

0 comments on commit 1a8ad58

Please sign in to comment.