Out-of-the-box working samples for FF4J
ff4j / ff4j-samples Goto Github PK
View Code? Open in Web Editor NEWOut-of-the-box working samples for FF4J
License: Apache License 2.0
Out-of-the-box working samples for FF4J
License: Apache License 2.0
New web console displays without any style.
http://localhost:7300/ff4j
Can someone point to me a project that has web console + rest API and it builds successfully?
So far I tried the following project(and many more) and was unsuccessful:
ff4j-sample-springboot-starter
ff4j-sample-springboot
ff4j-sample-springboot2
ff4j-sample-springboot-jdbc
Once I switch the version from <ff4j.version>1.9-SNAPSHOT</ff4j.version> to <ff4j.version>1.8.4</ff4j.version> it runs and the REST API works but the web console doesn't work.
Once I hit http://localhost:8080/ff4j-web-console/home
it gives me below message in the browser:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Mon Apr 06 13:40:57 PDT 2020
There was an unexpected error (type=Not Found, status=404).
No message available
I am new to FF4J and started with hello world application. I wrote a sample spring boot project and added dependency for ff4j-spring-boot-starter and ff4j-web modules in my pom.xml.
However, when I run the application, the FF4J web console is displayed distracted.
Below is my pom.xml for your reference
Below is the web console that i can see
Below are my configuration classes.
Please check and help what i am missing and how do i get web console properly.
Hi, I am trying to embed the ff4j functionality in my existing spring boot application
Followed all the steps as per the ff4j release 1.8.6, jumped to spring boot 2.2.7, still getting the below error
Full Stack trace -
14:01:15.212 ERROR org.springframework.boot.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: java.lang.IllegalArgumentException. Message: Invalid [ff4j-web-console/] in servlet mapping
14:01:15.296 ERROR org.springframework.boot.SpringApplication : Application run failed
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:156)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
at com.streamlinx.snapsource.SnapsourceApplication.main(SnapsourceApplication.java:22)
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:125)
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.(TomcatWebServer.java:87)
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:437)
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:191)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:180)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:153)
... 8 common frames omitted
Caused by: java.lang.IllegalArgumentException: Invalid [ff4j-web-console/] in servlet mapping
at org.apache.catalina.core.StandardContext.addServletMappingDecoded(StandardContext.java:3183)
at org.apache.catalina.Context.addServletMappingDecoded(Context.java:881)
at org.apache.catalina.core.ApplicationServletRegistration.addMapping(ApplicationServletRegistration.java:196)
at org.springframework.boot.web.servlet.ServletRegistrationBean.configure(ServletRegistrationBean.java:194)
at org.springframework.boot.web.servlet.ServletRegistrationBean.configure(ServletRegistrationBean.java:51)
at org.springframework.boot.web.servlet.DynamicRegistrationBean.register(DynamicRegistrationBean.java:113)
at org.springframework.boot.web.servlet.RegistrationBean.onStartup(RegistrationBean.java:53)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize(ServletWebServerApplicationContext.java:228)
at org.springframework.boot.web.embedded.tomcat.TomcatStarter.onStartup(TomcatStarter.java:53)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5140)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:468)
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:106)
... 13 common frames omitted
Process finished with exit code 1
We do have our own WebSecurityConfig, where i tried to add the ff4j-wen-console/* to permitted URL, still cant get rid of the error.
.antMatchers("/ff4j-web-console/*").permitAll();
Can you please let me know the issue, what i am missing here. Thanks
hi,
when i integrate ff4j according to this sample, i got ,
Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'swaggerConfig' for bean class [org.ff4j.spring.boot.web.api.config.SwaggerConfig] conflicts with existing, non-compatible bean definition of same name and class [com.phoenix.common.swagger.SwaggerConfig]
how to fix this, thanks
When trying to access the Swagger UI for documentation I'm getting the following in my browser:
{"uptime":"0 day(s) 0 hours(s) 2 minute(s) 42 seconds"","autocreate":true,"version":"1.8.11","featuresStore":{"type":"org.ff4j.audit.proxy.FeatureStoreAuditProxy","numberOfFeatures":5,"numberOfGroups":2,"features":["AwesomeFeature","first","second","third","forth"],"groups":["GRP0","GRP1"],"cache":null},"eventRepository":{"type":"org.ff4j.audit.repository.InMemoryEventRepository","eventsPie":{"title":"Total Hit Counts FROM 20211211 TO 20211212","sectors":[]},"barChart":{"title":"HitCounts Distribution FROM 20211211 TO 20211212","labels":[],"series":[]},"hitCount":0},"authorizationsManager":null}
This is on URL: http://localhost:8080/api/ff4j/
Under project: ff4j-sample-springboot2x
Is there a missing configuration or setup step?
My expectation is the swagger for the ff4j-sample-springboot2x project would look similar to the following:
https://ff4j.herokuapp.com/swagger-ui.html
Thanks,
Travis
Hi there,
thank you for uploading the ff4j-sample-simplejdbc sample.
But i am not able to get the audit working.
Do you know what the reason could be?
Thanks,
The spring-boot samples use a rather old version of ff4j. The version should be updated to reflect recent API changes.
Hi,
Do you have any sample to showcase ff4j with microservices implementation. Basically, how we can manage features in ff4j database and the same features should be available for multiple services running on multiple JVMS.
Hi there,
sorry for asking again.
Is there a sample project which combines the REST API (with Swagger doc), Spring jdbc and the admin web console?
Like the other project you created (ff4j-sample-simplejdbc)?
Or how can I integrate swagger doc into the ff4j-sample-jdbc example?
Thank you in advance.
When using the latest spring boot sample and trying to edit either a property or a feature, the modal dialog box does not come up.
I tested with chrome and firefox and ff4j 1.6.5.
If I delete the templates folder, delete css, js, img, fonts folders from resources/static and copy the resources from the ff4j-sample-web/src/main/webapp project then everything seems functional but the button colors for edit/remove in property and feature list does not render correctly. The demo/ url does not work either since I guess it uses the templates for that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.