New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spring boot 2.0.1 migration issue. #27
Comments
Hello, This is because As a workaround you could try to have the following dependencies for a spring boot starter parent with version 2.x <dependency>
<groupId>org.ff4j</groupId>
<artifactId>ff4j-spring-boot-web-api</artifactId>
<version>1.7.1</version>
</dependency>
<dependency>
<groupId>org.ff4j</groupId>
<artifactId>ff4j-web</artifactId>
<version>1.7.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency> and the following configuration gist in your project I have already started upgrading the ff4j-spring-boot-starter to spring boot 2.x and kotlin and should be released as part of 2.0.RC1 |
Thank you for reply. Will wait for 2.0.RC1 |
Hi, |
Hello, Mostly I have fixed the broken code https://github.com/paul58914080/ff4j-spring-boot-starter-parent I would have to integrate it as part of ff4j version 2. @clun any thoughts about the 2.0RC1 ? |
Hello, Any ETC for 2.0RC1? Thanks. |
Hello, any updates on this? Do you support Spring Boot 2 with its SpringBootServletInitializer moved to another package? |
Started with the movement https://github.com/ff4j/ff4j-spring-boot-starter-parent. Will try to release a RC (ReleaseCanditate) version within this week. |
Hi Paul, any updates on the RC version ? and when will the RC version release? thanks. |
Planning to release it next week. |
I tried following the changes above and explained in gist The only change I made was I used FF4jDispatcherServlet instead of ConsoleServlet to get the new UI. It starts up fine but when I hit the URL it gets the following exception: Receiver class org.ff4j.web.thymeleaf.CustomMessageResolver does not define or inherit an implementation of the resolved method abstract resolveMessage(Lorg/thymeleaf/context/ITemplateContext;Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String; of interface org.thymeleaf.messageresolver.IMessageResolver. I have the thymeleaf dependency defined in my pom file.
Any ideas what I can do to get this to work? |
There has been a lot of breaking changes after the updates from spring-boot 2.x. I have decided that I will be removing the support of auto-configuration of the console(ff4j-web) which uses old dependencies and is causing a lot of conflicts with spring-boot 2.x. To help you resolve the configuration, I have updated the sample project In the SpringBootApplication I had to exclude the ThymeleafAutoConfiguration. Refer @SpringBootApplication(exclude = ThymeleafAutoConfiguration.class)
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
} The following dependencies were added explicitly <dependency>
<groupId>org.ff4j</groupId>
<artifactId>ff4j-web</artifactId>
<version>1.7.3</version>
</dependency>
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf</artifactId>
<version>2.1.4.RELEASE</version>
</dependency> @Configuration
@ConditionalOnClass({ConsoleServlet.class, FF4jDispatcherServlet.class})
@AutoConfigureAfter(FF4JConfiguration.class)
public class FF4JWebConfiguration extends SpringBootServletInitializer {
@Bean
public ServletRegistrationBean servletRegistrationBean(ConsoleServlet ff4jConsoleServlet) {
return new ServletRegistrationBean(ff4jConsoleServlet, "/ff4j-console");
}
@Bean
@ConditionalOnMissingBean
public ConsoleServlet getFF4jServlet(FF4j ff4j) {
ConsoleServlet ff4jConsoleServlet = new ConsoleServlet();
ff4jConsoleServlet.setFf4j(ff4j);
return ff4jConsoleServlet;
}
@Bean
public ServletRegistrationBean ff4jDispatcherServletRegistrationBean(FF4jDispatcherServlet ff4jDispatcherServlet) {
return new ServletRegistrationBean(ff4jDispatcherServlet, "/ff4j-web-console/*");
}
@Bean
@ConditionalOnMissingBean
public FF4jDispatcherServlet getFF4jDispatcherServlet(FF4j ff4j) {
FF4jDispatcherServlet ff4jConsoleServlet = new FF4jDispatcherServlet();
ff4jConsoleServlet.setFf4j(ff4j);
return ff4jConsoleServlet;
}
} Let me know if this helps. |
That did the trick. I couldn't use ff4j-spring-boot-starter still with spring boot 2 but I did get it working without the starter. Thank you very much for your help. |
Hello, Please use the latest release i.e. 1.8. The sample project has also be updated.
|
After migrating to spring boot 2.0.1 version, i started getting below error
Caused by: java.io.FileNotFoundException: class path resource [org/springframework/boot/web/support/SpringBootServletInitializer.class] cannot be opened because it does not exist
upon checking the issue could be because of wrong import in
FF4JWebConfiguration
for SpringBootServletInitializerIs there a version of ff4j compatible with spring boot 2.0.1 I am using latest ff4j version 1.7.1
The text was updated successfully, but these errors were encountered: