spring 4 and quartz 1.x - spring

I have upgraded my project from Spring 2 to Spring 4. I have quartz 1.7 in my project. After I upgraded to Spring 4, I got this error
Invocation of init method failed; nested exception is
org.quartz.JobPersistenceException; Couldn't receive trigger: Invalid column name 'SCHED_NAME'
Any suggestions?

If you take a look at Quartz 2 migration guide
http://quartz-scheduler.org/documentation/quartz-2.x/migration-guide
SHED_NAME column was added to all tables in Quartz.
Check your dependencies for Quartz, I think you are on 2.x.x version now.

Copying the latest quartz.jar in /jboss/server//lib worked for me

Related

RestHighLevelClient Bean for elasticsearch not found on classpath in spring boot 3

I am trying to upgrade my existing spring boot 2.7.x project to spring boot 3.x.x.
I have sorted out everything except this error while running the application.
APPLICATION FAILED TO START
Description:
Parameter 0 of method lockProvider in com.cox.config.ShedLockConfiguration required a bean of type 'org.elasticsearch.client.RestHighLevelClient' that could not be found.
Action:
Consider defining a bean of type 'org.elasticsearch.client.RestHighLevelClient' in your configuration.
Process finished with exit code 0
Spring Boot Version used is 3.0.0
I am aware that RestHighLevelClient is deprecated, but documentation says it's still available in spring-data-elasticsearch
Tried upgrading all dependencies to be compatible with spring boot 3
Update:
Also getting below error for another component with elastic search which I am trying to upgrade to spring boot 3
APPLICATION FAILED TO START
Description:
Parameter 2 of constructor in com.cox.service.esindex.EsIndexRefreshService required a bean of type 'org.springframework.data.elasticsearch.core.ElasticsearchOperations' that could not be found.
Action:
Consider defining a bean of type 'org.springframework.data.elasticsearch.core.ElasticsearchOperations' in your configuration.
It looks like spring boot is no longer creating beans for deprecated methods/classes. Can you please help me map each deprecated method/class with the new spring-data-elasticsearch
The documentation explicitly states:
The old deprecated RestHighLevelClient can still be used, but you will need to add the dependency explicitly to your application as Spring Data Elasticsearch does not pull it in automatically anymore:
Edit 18.02.2023:
Check the documentation it also documents how to configure the different clients. You will have to do this configuraiton by yourself, I don't think that Spring Boot will configure this automatically, they are using the current stuff from Spring Data Elasticsearch .

Using Hibernate 6.x with Spring Boot 2.7.x not working?

I am trying to use Hibernate Core 6.x with Spring Boot / Spring Data JPA 2.7.x project, but it's not able to pick up Hibernate 6.x classes.
As you can see in the pom, in spring-boot-starter-data-jpa I have excluded hibernate-core 5.6.10-final and added 6.x as project dependency.
But I am seeing below error:
***************************
APPLICATION FAILED TO START
***************************
Description:
A component required a bean of type 'javax.persistence.EntityManagerFactory' that could not be found.
Action:
Consider defining a bean of type 'javax.persistence.EntityManagerFactory' in your configuration.
I don't think spring boot is autoconfiguring the new Hibernate 6.x version.
For 5.6.x, I could see below 11 implementations for EntityManager.
On moving to 6.x, I see only one implementation.
What's going on, I have no idea. Can some one pitch in and help resolve this issue.
Why I want 6.x -> See if RIGHT JOIN work in 6.x. Even other wise I see it's going to be a good task to figure out and make this combo work.
Hibernate 6 uses the JPA version (JPA 3) that uses the jakarta.persistence package names introduced in JakartaEE 9. Spring Boot 2.x still uses the javax.* package namespace of JakartaEE 8 and earlier (JPA 2.2 and earlier), and thus only supports Hibernate 5.x (for Spring Boot 2.7, Hibernate 5.6.x is the default).
Spring Boot 3 switched to the jakarta.* packages of JakartaEE 9+. So, you can upgrade to Spring Boot 3 to able to use Hibernate 6. If you cannot upgrade Spring Boot yet, you'll need to use Hibernate 5.6.

Spring-Kafka: RecordIntercepter class not found

I am using spring boot 2.1.5 and spring-kafka, version not specified. Project is gradle 6.0, java 1.8
I am getting this error
error creating bean with name 'org.springframework.boot.autoconfigure.kafka.kafkaannotationdrivenconfiguration': unexpected exception during bean creation; nested exception is java.lang.typenotpresentexception: type org.springframework.kafka.listener.recordinterceptor not present
What could be this due to? Please help.
2.1.5 is nearly a year old; the current Boot 2.1.x release is 2.1.13.
2.1.5 uses spring-kafka 2.2.6 so I don't see how you can get that error, based on your description.
RecordInterceptor was added in spring-kafka 2.2.7.
It was added to the Spring Boot autoconfiguration in 2.2.0.
So what you are describing makes no sense; you must be using Boot 2.2.x and an old spring-kafka version.
You have mis-matched Boot/Kafka versions.
Upgrade to Boot 2.1.13 (or preferably 2.2.6).

Why does Spring Aspects depend on Spring ORM?

I have a project with a dependency to org.springframework:spring-aspects which used to work fine with some Spring 4.x version. Now I've updated to some Spring 5.x version and the application refuses to start with org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'persistenceUnit' available
It turned out this could be resolved by excluding the newly added dependency to org.springframework:spring-orm. Is this the expected way to solve this problem?
We hit the same thing. It seems it's a bug that's already been fixed in Spring 5.2.4 (released on Feb 25th, 2020) - see Spring Framework issue #24491.
So it seems the right thing to do, until you can pick up this release, is to exclude spring-orm as you've done.

trouble with spring-hibernate3:jar:2.0.8 and struts2-core:jar:2.3.16 for different version of asm

I am working on a project for upgrade an application to spring 3.2.0.RELEASE, struts 2.3.16, and hibernate 3.6.5.Final.
in the pom.xml, I have dependency spring-hibernate3 2.0.8 version.
And, I found out this version need asm:asm-attrs:jar:1.5.3:compile,
but, struts need asm 3.3 and 3.3.1.
Currently, when I try to start the application use Tomcat 7.0, I have issue with different asm version conflict issue.
The errors are:
Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.(Z)V
I can't upgrade the hibernate to 4, I have to stay in 3.6.
So, I need introduce two version of asm, how to separate them and forbid them refer the wrong version of asm?

Resources