Spring Framework 4.3.1 mail not resolved - spring

I updated Spring Framework to 4.3.1, now I am getting an error:
The import cannot be resolved
for the following imports:
import org.springframework.mail.MailException;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.mail.javamail.MimeMessageHelper;
I have the following libraries for springframework 4.3.1;
spring-core-4.3.1.RELEASE.jar,
aop, aspects, beans, context, context-support,expression, instrument,
instrument-tomcat, jdbc, jms, messaging, orm, tx, websocket
I am not using Maven. Others: Java 8, Liferay 4.3.1, Hibernate 5.2. How can I fix it?

The mail library is found in spring-context-support so download spring-context-support-4.3.1.RELEASE.jar and add that in your classpath

Without maven you may know that you must place the jar in classpath. Follow the jar.
Java Mail Jar
Check those steps on link above and you'll get it.
Spring Mail Integration
If work, tell us a feedback.
Regards

If it was Maven you could add the following to your dependencies:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>

Related

spring-boot-security 2.2.5 - java.lang.NoClassDefFoundError:org/bouncycastle/crypto/params/Argon2Parameters

I am using spring boot security version 2.2.5.RELEASE in that , I am creating a custom password encoder with Argon2PasswordEncoder as my password encoder.
In this when i run, can see following error in the Argon2PasswordEncoder.java where i can see these two imports are missing,
import org.bouncycastle.crypto.generators.Argon2BytesGenerator;
import org.bouncycastle.crypto.params.Argon2Parameters;
Error:
java.lang.NoClassDefFoundError: org/bouncycastle/crypto/params/Argon2Parameters$Builder
at org.springframework.security.crypto.argon2.Argon2PasswordEncoder.encode(Argon2PasswordEncoder.java:78) ~[spring-security-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at com.custom.CustomPasswordEncoder.encode(CustomPasswordEncoder.java:11)
Please suggest me want to do, am I missing some dependency or its the spring boot version issue. And also how to overcome.
Many thanks.
I got the issue. for the version 2.2.5 springboot we need to explicitly add the dependency for Argon2BytesGenerator, Argon2Parameters nt found issue, since its not included in this version.
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.64</version>
</dependency>

What are analogs for classes from *autoconfigure.security.oauth2 and *security.oauth2 for Spring Boot 2.1.1.RELEASE?

What are analogs for classes from *autoconfigure.security.oauth2 and *security.oauth2 for Spring Boot 2.1.1.RELEASE version of spring-boot-starter-parent?
They are removed in this version.
import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties;
import org.springframework.boot.autoconfigure.security.oauth2.resource.UserInfoTokenServices;
import org.springframework.security.oauth2.client.OAuth2ClientContext;
import org.springframework.security.oauth2.client.OAuth2RestTemplate;
import org.springframework.security.oauth2.client.filter.OAuth2ClientAuthenticationProcessingFilter;
import org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter;
import org.springframework.security.oauth2.client.token.grant.code.AuthorizationCodeResourceDetails;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableOAuth2Client;
I think what you're missing is a dependency on spring-security-oauth2-autoconfigure to make your old setup work "seamlessly" with Spring Boot 2.1.1.RELEASE
<dependency>
<groupId>org.springframework.security.oauth.boot</groupId>
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
<version>2.1.1.RELEASE</version>
</dependency>
That being said that project is maintenance mode and the recommended approach is to use the built in Spring Oauth support.

import of amqp from org.springframework get error

I'm working on existing Scala project which using the spring framework and I need to import org.springframework.amqp but when I tried to build the project I get:
Error:(15, 28) object amqp is not a member of package
org.springframework import org.springframework.amqp
It is really strange since I can see it in the formal website and I can see it in lot of examples in the web.
Any idea what is the problem?
A Maven dependency was missing. This is what I was need to add:
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-amqp</artifactId>
<version>2.1.2.RELEASE</version>
</dependency>

How to import latest Ignite Scheduler repository

I would like to import the Scheduler repository in my project, and I have add the dependency in pom as below
<dependency>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-schedule</artifactId>
<version>2.1.0</version>
</dependency>
But it reports error to load it.
Anyone can help me out, much appreciate for any hints.
ignite-schedule is optional LGPL dependency and it's not published to apache maven repo.
You can build it by yourself from code or use GridGain maven repository to get it.
Here is information about it:
https://ignite.apache.org/download.cgi#3rdparty

What replaces FacesContextUtils in Spring 3?

We just upgraded from Spring 2.5 to Spring 3.0.7. The class:
org.springframework.web.jsf.FacesContextUtils
doesn't appear exist in 3.0.7. We are trying to call:
FacesContextUtils.getWebApplicationContext(FacesContext.getCurrentInstance()).getBeansOfType(type);
Is there a replacement in Spring 3?
This class also exists in Spring 3.0.7, maybe you missed a jar or downloaded a different release?
You can use the following maven dependency:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>org.springframework.web</artifactId>
<version>3.0.7.RELEASE</version>
</dependency>
You can also get the jar from the spring repo.
If this doesn't help you may update your question with the stacktrace of the error msg.

Resources