I am trying to upgrade spring boot from 1.5.x to 2.1.1 (latest) in our java based enterprise web application. It seems that starting spring boot version 2.1.0, spring requires hibernate to be above version 5.x. We get the following error otherwise with hibernate version 4.3.5
Caused by: java.lang.ClassNotFoundException: org.hibernate.boot.model.naming.PhysicalNamingStrategy
Till spring boot release 2.0.0, the application worked well with hibernate version 4.3.5. This naming strategy change was introduced in hibernate version 5.
We cannot upgrade hibernate right now. Is there a workaround that we can apply with the latest spring boot upgrade to 2.1.x?
Related
Which version of com.javaeatmoi.core:javaeatmoi-spring4-vfs2-support compatible with spring version 5.3.14
Current i have eatmoi as 1.4.1 but in the Vfs2PathMatchingResourcePatternResolver doFindPathMatching jar it has 2 parameter.
But spring PathMatchingResourcePatternResolver::doFindPathMatching has 3. This was working fine in spring version 4.2.5
We are using spring boot 1.5.10 release and default embedded tomcat server 8.4.5 and changed the tomcat server to 9.0.3 by using
Gradle 2.12 version in build.gradle
ext('tomcat.version:9.0.3')
and trying to run apllication Getting Error: .... nested exception is java.lang.NoSuchMethodError: org.apache.catalina.Context.addServletMapping(Ljava/lang/String)
Spring Boot 1.5 does not support using Tomcat 9 as an embedded web server. To use Tomcat 9 you should upgrade to a supported version of Spring Boot. At the time of writing, 2.5.x and 2.6.x are the supported versions. Both use Tomcat 9.0.x by default.
we recently updated Spring boot from 1.3.7.RELEASE to Spring Boot 2.1.1.RELEASE
and also we are upgrading java7 to Java11(Open amazon-corretto-11.jdk) and also we upgraded the gradle distribution version from Gradle 2.10 to Gradle 5.3 as well.
Note: we have dependancy for hystrix as well ,
and when we specify the Hystrix
version as 1.1.7.RELEASE.
Code compiles fine but failed to start the application with below error:
compile ("org.springframework.cloud:spring-cloud-starter-hystrix:1.1.7.RELEASE")
compile "org.springframework.cloud:spring-cloud-starter-hystrix-dashboard:1.1.7.RELEASE"
Error: o.s.boot.SpringApplication - Application run failed
java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.([Ljava/lang/Object;)
Can anyone help us on this issue? prompt response will be appreciated.
spring-cloud-starter-hystrix 1.1.7 is built for Spring Boot 1, it's from 2016. If you upgrade Spring Boot, you need to upgrade all the related dependencies too.
I highly suggest you don't upgrade to a really old version of Spring Boot 2.1, upgrade directly to Spring Boot 2.1.12.RELEASE so you have all the necessary bug and CVE fixes. And pick a hystrix dependency which belongs to Spring Boot 2.1.x, which likely is spring-cloud-starter-netflix-hystrix 2.1.5.
I'm using 1.4.1.RELEASE of spring-boot application. Everything was working ok for Java 8. However when I updated java version to 11 I can't run application using command mvn clean spring-boot:run. At the same time I can package is successfully (using mvn package). When I set java version to 8, it's working fine again.
[main] ERROR o.s.boot.SpringApplication - Application startup failed
java.lang.IllegalStateException: Restarter has not been initialized
at org.springframework.util.Assert.state(Assert.java:392)
at org.springframework.boot.devtools.restart.Restarter.getInstance(Restarter.java:545)
at org.springframework.boot.devtools.restart.RestartApplicationListener.onApplicationEvent(RestartApplicationListener.java:48)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:166)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:138)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:121)
at org.springframework.boot.context.event.EventPublishingRunListener.contextLoaded(EventPublishingRunListener.java:85)
at org.springframework.boot.SpringApplicationRunListeners.contextLoaded(SpringApplicationRunListeners.java:66)
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:367)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175)
at com.myapp.Application.main(Application.java:24)
I can understand that newer versions of Spring might require newer version of Java. But it's not clear why older spring-boot can't be run on newer java versions.
The version of Spring Boot that you're using was released in September, 2016, long before Java 11 was released in September, 2018. I recommend you update to the latest version of Spring Boot, which is currently 2.1.9.
Please let me know if this fixes your issue; otherwise, we'll debug it further.
By default, Spring Boot 1.4.1.RELEASE requires Java 7 until Java 8 which is highly recommended and Spring Framework 4.3.3.RELEASE or above. If you want to use Java 11 with some version of Spring Boot, The latest version is recommended to use, then you should do a upgrade your project.
Although you can use Spring Boot with Java 6 or 7, we generally recommend Java 8 if at all possible.
System Requirements for Spring Boot 1.4.1
The version of Spring Boot which starts to use Java 11 it was 2.1.1 then you can use any up to this version.
Spring Boot 2.1.1.RELEASE requires Java 8 and is compatible up to Java 11 (included).
System Requirements for Spring Boot 2.1.1
I am using Hibernate in my application and now there is a need of upgrading to the latest version of Hibernate(now its 4.3.5.Final) and I have to integrate it with Spring.
Now my question is that which version of Spring is compatible with Hibernate 4.3.5.Final or which latest version of hibernate is compatible with Spring 4.x version.
FYI: During my search I found this SO link which tells that how to know the Spring and Hibernate version comparability. And according to that I opened spring-orm Maven POM and found that with spring-orm: 4.0.5.RELEASE I can use hibernate-core: 4.2.12.Final and hibernate-core: 3.6.10.Final among these only hibernate-core: 3.6.10.Final is working. Then how can I solve this problem of version conflicts.