0
votes

My environment:

JSF 2.3, Mojarra 2.3.9.payara-p2

PrimeFaces 7.0

Payara 5.192

OmniFaces 3.3

Project Java EE 8 Maven

NetBeans 11.1

I have created a Faces flow:

folder "flotTransfer" containing only 2 files (for the moment) flotTransfert-flow.xml and flotTransfert.xhtml.

I can't deploy the application. I receive this message: " Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: java.lang.IllegalStateException: Flow with id "flotTransfert" and definingDocumentId "" already exists.|#] ".

I don't understand why I get this error (why "already exists"?). No other application deployed on the server.

The content of flotTransfert-flow.xml:

<faces-config version="2.3"
              xmlns="http://xmlns.jcp.org/xml/ns/javaee"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd">
  <flow-definition id="flotTransfert">
    <flow-return id="sortieFlot">
      <from-outcome>/listeComptes</from-outcome>
    </flow-return> 
  </flow-definition>
</faces-config>

If I rename this file, no more error and the application is deployed on the server but, obviously, the faces flow does not work.

If I keep the file but remove all the content of the file (I comment out all the lines), I get the same error.

I have almost the same faces flow (just more pages in the folder) in another application but with Java EE 7 and Payara 5.184 and without OmniFaces and the flow works.

1

1 Answers

1
votes

Sorry, I made a mistake: I added the file flotTransfert-flow.xml with a wizard of my IDE and I didn't notice that this wizard added a <context-param> in the file web.xml, referencing the definition file of the flow. If I remove this <context-param>, all is working.

The lines I removed from web.xml:

<context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/flotTransfert/flotTransfert-flow.xml</param-value>
</context-param>