Upgrade to Spring Framework 6 and Jakarta EE 9
Closes gh-28619 Closes gh-28620 Closes gh-28621 Closes gh-28622 Closes gh-28623 Closes gh-28624 Closes gh-28625 Closes gh-28626 Closes gh-28627 Closes gh-28628 Closes gh-28629 Closes gh-28630 Closes gh-28631 Closes gh-28632 Closes gh-28633 Closes gh-28634 Closes gh-28635 Closes gh-28636 Closes gh-28638 Closes gh-28639 Closes gh-28640 Closes gh-28644 Closes gh-28645 Closes gh-28650 Closes gh-28711 Closes gh-28866 Closes gh-28867 Closes gh-28868 Closes gh-28872 See gh-28641 See gh-28642 See gh-28643 See gh-28646 See gh-28647 See gh-28648 See gh-28649 See gh-28721 See gh-28869 See gh-28871
This commit is contained in:
@@ -19,13 +19,13 @@ package org.springframework.boot.docs.actuator.cloudfoundry.customcontextpath;
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
|
||||
import javax.servlet.GenericServlet;
|
||||
import javax.servlet.Servlet;
|
||||
import javax.servlet.ServletContainerInitializer;
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import jakarta.servlet.GenericServlet;
|
||||
import jakarta.servlet.Servlet;
|
||||
import jakarta.servlet.ServletContainerInitializer;
|
||||
import jakarta.servlet.ServletContext;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.ServletRequest;
|
||||
import jakarta.servlet.ServletResponse;
|
||||
|
||||
import org.apache.catalina.Host;
|
||||
import org.apache.catalina.core.StandardContext;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.docs.data.nosql.elasticsearch.connectingusingspringdata;
|
||||
|
||||
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
|
||||
import org.springframework.data.elasticsearch.backend.elasticsearch7.ElasticsearchRestTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
|
||||
@@ -18,10 +18,10 @@ package org.springframework.boot.docs.data.sql.jpaandspringdata.entityclasses;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
|
||||
@Entity
|
||||
public class City implements Serializable {
|
||||
|
||||
@@ -18,10 +18,10 @@ package org.springframework.boot.docs.data.sql.jpaandspringdata.entityclasses;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
|
||||
import org.hibernate.envers.Audited;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ package org.springframework.boot.docs.features.externalconfig.typesafeconfigurat
|
||||
|
||||
import java.net.InetAddress;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@@ -18,9 +18,9 @@ package org.springframework.boot.docs.features.externalconfig.typesafeconfigurat
|
||||
|
||||
import java.net.InetAddress;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.docs.features.testing.springbootapplications.autoconfiguredwebservices.client;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
@XmlRootElement(name = "request")
|
||||
class Request {
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.boot.docs.features.testing.springbootapplications.autoconfiguredwebservices.client;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
@XmlRootElement(name = "response")
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.docs.howto.dataaccess.configureacomponentthatisusedbyjpa;
|
||||
|
||||
import javax.persistence.EntityManagerFactory;
|
||||
import jakarta.persistence.EntityManagerFactory;
|
||||
|
||||
import org.springframework.boot.autoconfigure.orm.jpa.EntityManagerFactoryDependsOnPostProcessor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.docs.howto.messaging.disabletransactedjmssession;
|
||||
|
||||
import javax.jms.ConnectionFactory;
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
|
||||
import org.springframework.boot.autoconfigure.jms.DefaultJmsListenerContainerFactoryConfigurer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.docs.howto.springmvc.writexmlrestservice;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
@XmlRootElement
|
||||
public class MyThing {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.docs.howto.webserver.addservletfilterlistener.springbean.disable;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import jakarta.servlet.Filter;
|
||||
|
||||
public abstract class MyFilter implements Filter {
|
||||
|
||||
|
||||
@@ -16,46 +16,25 @@
|
||||
|
||||
package org.springframework.boot.docs.howto.webserver.enablemultipleconnectorsintomcat;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
|
||||
import org.apache.catalina.connector.Connector;
|
||||
import org.apache.coyote.http11.Http11NioProtocol;
|
||||
|
||||
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
|
||||
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.util.ResourceUtils;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
public class MyTomcatConfiguration {
|
||||
|
||||
@Bean
|
||||
public WebServerFactoryCustomizer<TomcatServletWebServerFactory> sslConnectorCustomizer() {
|
||||
return (tomcat) -> tomcat.addAdditionalTomcatConnectors(createSslConnector());
|
||||
return (tomcat) -> tomcat.addAdditionalTomcatConnectors(createConnectorConnector());
|
||||
}
|
||||
|
||||
private Connector createSslConnector() {
|
||||
private Connector createConnectorConnector() {
|
||||
Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
|
||||
Http11NioProtocol protocol = (Http11NioProtocol) connector.getProtocolHandler();
|
||||
try {
|
||||
URL keystore = ResourceUtils.getURL("keystore");
|
||||
URL truststore = ResourceUtils.getURL("truststore");
|
||||
connector.setScheme("https");
|
||||
connector.setSecure(true);
|
||||
connector.setPort(8443);
|
||||
protocol.setSSLEnabled(true);
|
||||
protocol.setKeystoreFile(keystore.toString());
|
||||
protocol.setKeystorePass("changeit");
|
||||
protocol.setTruststoreFile(truststore.toString());
|
||||
protocol.setTruststorePass("changeit");
|
||||
protocol.setKeyAlias("apitester");
|
||||
return connector;
|
||||
}
|
||||
catch (IOException ex) {
|
||||
throw new IllegalStateException("Fail to create ssl connector", ex);
|
||||
}
|
||||
connector.setPort(8080);
|
||||
return connector;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.docs.io.jta.mixingxaandnonxaconnections.nonxa;
|
||||
|
||||
import javax.jms.ConnectionFactory;
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.docs.io.jta.mixingxaandnonxaconnections.primary;
|
||||
|
||||
import javax.jms.ConnectionFactory;
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
|
||||
public class MyBean {
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.docs.io.jta.mixingxaandnonxaconnections.xa;
|
||||
|
||||
import javax.jms.ConnectionFactory;
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.docs.io.validation;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.docs.messaging.jms.receiving.custom;
|
||||
|
||||
import javax.jms.ConnectionFactory;
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
|
||||
import org.springframework.boot.autoconfigure.jms.DefaultJmsListenerContainerFactoryConfigurer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.boot.docs.messaging.jms.receiving.custom;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.Session;
|
||||
|
||||
import org.springframework.jms.support.converter.MessageConversionException;
|
||||
import org.springframework.jms.support.converter.MessageConverter;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.docs.web.servlet.springmvc.errorhandling;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.boot.web.servlet.error.ErrorAttributes;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package org.springframework.boot.docs.web.servlet.springmvc.errorhandling;
|
||||
|
||||
import javax.servlet.RequestDispatcher;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.RequestDispatcher;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
@@ -18,7 +18,7 @@ package org.springframework.boot.docs.web.servlet.springmvc.errorhandling.errorp
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.boot.autoconfigure.web.servlet.error.ErrorViewResolver;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
@@ -18,10 +18,10 @@ package org.springframework.boot.docs.web.servlet.springmvc.errorhandling.errorp
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.ServletRequest;
|
||||
import jakarta.servlet.ServletResponse;
|
||||
|
||||
import org.springframework.web.filter.GenericFilterBean;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ package org.springframework.boot.docs.web.servlet.springmvc.errorhandling.errorp
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import javax.servlet.DispatcherType;
|
||||
import jakarta.servlet.DispatcherType;
|
||||
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
Reference in New Issue
Block a user