1

I'm desperate to build a Spring Boot-Applikation with JSF. The Build-Tool is Gradle and to integrate JSF in Spring we use Joinfaces. If I start the application from Spring Tool Suite(STS) or with Gradle bootRun, it loads all the available config files and everything works just fine.

If I run bootJar and start the Application with java -jar it is missing several configs and the facesflows are not loaded.
We use joinfaces 4.1.5, SpringBoot 2.2.5 and Gradle 6.0.1

This is a part of the STS or bootRun log:

Loading prepared scan result took 0.4388ms
Reading config : jar:file:...org.primefaces.extensions/.../META-INF/faces-config.xml
Reading config : jar:file:...org.primefaces/primefaces.../faces-config.xml
Reading config : jar:file:.../weld-servlet-core-3.1.2.Final.jar!/META-INF/faces-config.xml
Reading config : jar:file:.../joinfaces-autoconfigure-4.1.5.jar!/META-INF/faces-config.xml
Reading config /dataTableLazy/dataTableLazy-flow.xml
Reading config /button/button-flow.xml
Reading config /confirmDialog/confirmDialog-flow.xml
Reading config /dataTable/dataTable-flow.xml
Reading config /main/main-flow.xml
Reading config /accordion/accordion-flow.xml
Artifact 'myfaces-api' was found in version '2.3.6' from path '...'
Artifact 'myfaces-impl' was found in version '2.3.6' from path '...'
MyFaces CDI support enabled


But the call of the jar as result of bootJar is missing the flow-xml files:

Loading prepared scan result took 0.6126ms
Reading config : jar:file:...org.primefaces.extensions/.../META-INF/faces-config.xml
Reading config : jar:file:...org.primefaces/primefaces.../faces-config.xml
Reading config : jar:file:.../weld-servlet-core-3.1.2.Final.jar!/META-INF/faces-config.xml
Reading config : jar:file:.../joinfaces-autoconfigure-4.1.5.jar!/META-INF/faces-config.xml
Artifact 'myfaces-api' was found in version '2.3.6' from path '...'
Artifact 'myfaces-impl' was found in version '2.3.6' from path '...'
MyFaces CDI support enabled

Our Resource-Tree:

src/main/resources
..META-INF
....resources
......accordion
........accordion.xthml
........accordion-flow.xml
......button
........button.xthml
........button-flow.xml
......main
........main.xthml
........main-flow.xml
......css
......etc...
..application.properties

Does anyone know why starting the Jar resulting from bootJar and starting with bootRun show different behaviour? Have anyone faced the same problem?

  • Using the `bootJar` task while also having a `WEB-INF` directory in your resource tree doesn't look right to me. Have you tried using `bootWar`? – Andy Wilkinson Mar 10 '20 at 15:45
  • @AndyWilkinson Ahh sorry it's a empty folder. I'll remove it. No we have the Java-Plugin and not the WAR-Plugin – GrizzlyOnFire Mar 10 '20 at 15:49
  • How is this JSF related (other than you using it in your application)? Seems to be starting things and in both I see JSF and PrimeFaces just being loaded... and loaded fine – Kukeltje Mar 10 '20 at 15:57
  • @Kukeltje Well all I know is that the flow-xmls from JSF are not loaded if i create a jar. I honestly don't know which component is causing the trouble so i thought its best to mention all. Maybe some JSF-Experts are using Spring-Boot and Joinfaces too and can help me. – GrizzlyOnFire Mar 10 '20 at 16:07
  • Are these faces flows files that are not loaded (that is something different to not working), then the Q is more clear (there is a big typo in your question). Try to get a 'dump' of the runtime config then and find the differences. This is one of the reasons I dislike this wrapped config thing (and hence spring). Everything that normally works needs additional config or something. Tried things from https://www.google.com/search?client=firefox-b-d&q=joinfaces+set+faces+flows+config+folder? Cheers – Kukeltje Mar 10 '20 at 16:21
  • @Kukeltje Yes the flow.xmls are not loaded. I tried many things from google for hours. But i have one new clue. If i deactivate the SpringBoot Dev-Tools then its also not loading with the task bootRun either. The Dev-Tools are not shipped with the Jar. So something in Dev-Tools is recognizing the missing *-flow.xml and add them to the externalContext. The DefaultFacesConfigurationProvider.class from myfaces is tries to load the flows the from the externalContext. – GrizzlyOnFire Mar 11 '20 at 09:40
  • Also probably a good question to ask the Joinfaces Github Issues page to found out where these should go. Joinfaces makes some decisions on where certain files NEED to be in the JSF world like taglibs and composite components etc. – Melloware Apr 05 '20 at 21:32

1 Answers1

0

we have solved this by putting the flows in the file faces-config.xml. we use Maven and have the following structure:

- /src/main/resource/application.properties
- /src/main/resource/META-inf/faces-config.xml
- /src/main/resource/META-inf/resource/index.xhtml