Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] jetty + jsf/myfaces: registration via .tld

Hi,
I am using the jetty distribution 9.4.29.v20200521 with some javaee dependencies like cdi/weld, jsf/myfaces in lib/ext.
Unfortunately, I am getting when starting my application:

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.eclipse.jetty.servlet.ServletHolder$WrapperServlet.init(ServletHolder.java:1289)
	at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:602)
	at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:413)
	at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$0(ServletHandler.java:749)

I have read this: https://jsflive.wordpress.com/2012/08/19/jsf-2-on-jetty-8/ which basically describes the exact issue in the context of using embeeded jetty. So, when actually setting the listener of myfaces in the web.xml my application starts and all is fine. 
So, this definively gave me a hint in the right direction. But, ideally i do not want to hard-code this in my web.xml or provide an override for my web.xml.
Rather, I would like to understand better why it is failing for me, because if i read the documentation (https://www.eclipse.org/jetty/documentation/current/configuring-jsp.html#using-jsf-taglibs) it should be working without doing anything special.
I have myfaces under lib/ext, myfaces contains a .tld-file under META-INF and the .tld-file contains the <listener>..</listener> config i want.
So, my question is what could be the reason this does not just work. I also have the jsp and jstl features enabled (i can see when starting with --list-config / --list-modules that the modules are active and the jars are on the classpath).

I also enabled DEBUG level logging for org.eclipse.jetty.apache.jasper and do not see any output. I guess i would have expected output printed from here https://github.com/eclipse/jetty.project/blob/jetty-10.0.x/apache-jsp/src/main/java/org/eclipse/jetty/apache/jsp/JettyJasperInitializer.java!?
Does this give some indication regarding the problem?

Thanks,
Daniel



Back to the top