Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

issue with spring boot while upgrading to 1.3.0.RELEASE

Hi i just upgraded to spring boot 1.3.0.RELEASE and while running the same again get this strange error

14:43:52.503 [main] INFO  c.test.whf.service.HfServices - Starting up....
Exception in thread "main" java.lang.IllegalAccessError: tried to access method org.springframework.core.convert.support.DefaultConversionService.addCollectionConverters(Lorg/springframework/core/convert/converter/ConverterRegistry;)V from class org.springframework.boot.bind.RelaxedConversionService
    at org.springframework.boot.bind.RelaxedConversionService.<init>(RelaxedConversionService.java:52)
    at org.springframework.boot.bind.RelaxedDataBinder.modifyProperties(RelaxedDataBinder.java:148)
    at org.springframework.boot.bind.RelaxedDataBinder.doBind(RelaxedDataBinder.java:128)
    at org.springframework.validation.DataBinder.bind(DataBinder.java:715)
    at org.springframework.boot.bind.PropertiesConfigurationFactory.doBindPropertiesToTarget(PropertiesConfigurationFactory.java:267)
    at org.springframework.boot.bind.PropertiesConfigurationFactory.bindPropertiesToTarget(PropertiesConfigurationFactory.java:240)
    at org.springframework.boot.context.config.ConfigFileApplicationListener.bindToSpringApplication(ConfigFileApplicationListener.java:220)
    at org.springframework.boot.context.config.ConfigFileApplicationListener.postProcessEnvironment(ConfigFileApplicationListener.java:171)
    at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:161)
    at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:146)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:119)
    at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:111)
    at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:65)
    at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
    at org.springframework.boot.SpringApplication.doRun(SpringApplication.java:315)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:295)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1112)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1101)
    at com.wellmanage.whf.service.HfServices.main(HfServices.java:97)

also there have been no other changes to my code not sure what is causing this really .

app class is as simple as below

  SpringApplication.run(HfServices.class, args);

Please help ...

like image 452
Gaurav Rawat Avatar asked Nov 19 '15 09:11

Gaurav Rawat


People also ask

Which version of spring boot is stable?

What is the latest Spring Boot version? The current stable version, as of July 2022, is Spring Boot 2.7.

When we should not use spring boot?

Disadvantages of Spring BootLack of control. Spring Boot creates a lot of unused dependencies, resulting in a large deployment file; The complex and time-consuming process of converting a legacy or an existing Spring project to a Spring Boot application; Not suitable for large-scale projects.

Which version of Java is required for spring boot?

System Requirements Spring Boot 2.7. 4 requires Java 8 and is compatible up to and including Java 19. Spring Framework 5.3. 23 or above is also required.

How do I upgrade my spring boot?

To upgrade an existing CLI installation, use the appropriate package manager command (for example, brew upgrade ). If you manually installed the CLI, follow the standard instructions, remembering to update your PATH environment variable to remove any older references.


1 Answers

That method was added in Spring Framework and you are overriding the version explicitly in your project. Please don't do that!

Spring Boot is managing this for you and you should really let it determine the Spring Framework version to use.

like image 123
Stephane Nicoll Avatar answered Dec 09 '22 21:12

Stephane Nicoll