You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Emmanuel Touzery <em...@lit-transit.com> on 2017/11/28 14:04:50 UTC

per-application settings outside of the WAR file

Hello,

     in our setup we have a series of key-value low-level config 
settings in the WAR file, however we'd like to move those out of the war 
file.

     I was looking at possible options, and 
|$CATALINA_BASE/conf/[enginename]/[hostname]/$APP.xml seems like a good 
option.
|

     I was checking https://stackoverflow.com/a/26146742/516188 and 
https://stackoverflow.com/a/26147130/516188

     However when I add such an extra context.xml file, the app startup 
fails (message at the end of this email).

     I think this is probably because we already have a server-wide 
context.xml and one in our war file (the one in the war file is empty 
though). I wonder is there a way we could create such a file in 
conf/engine/hostname/app.xml containing for instance 'Environment' 
entries which we could read through JNDI without impacting our app setup 
in other ways?

Emmanuel

Startup error =>

Caused by: java.lang.IllegalStateException: No Factories configured for 
this Application. This happens if the faces-initialization does not work 
at all - make sure that you properly include all configuration settings 
necessary for a basic faces application and that all the necessary libs 
are included. Also check the logging output of your web application and 
your container for any exceptions!
If you did that and find nothing, the mistake might be due to the fact 
that you use some special web-containers which do not support 
registering context-listeners via TLD files and a context listener is 
not setup in your web.xml.
A typical config looks like this;
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>

     at javax.faces.FactoryFinder._getFactory(FactoryFinder.java:305)
     at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:225)
     at javax.faces.webapp.FacesServlet.init(FacesServlet.java:115)
     at 
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1183)
     ... 24 more