Activity

The jetty m2 plugin is trying to deploy from the src directory instead of from the target dir. Any idea how to make the m2 plugin deploy from the target dir? IOW, the src dir does not have the jars for myfaces but the target does. I've pasted the stack trace that I get from m2 below.

Also since few of us are that familiar with Jetty (as far as I know anyway) perhaps you could do some digging to help us find the problem?

Embedded error: 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>

Bill Dudney
added a comment - 16/Feb/06 00:24 Jurgen,
The jetty m2 plugin is trying to deploy from the src directory instead of from the target dir. Any idea how to make the m2 plugin deploy from the target dir? IOW, the src dir does not have the jars for myfaces but the target does. I've pasted the stack trace that I get from m2 below.
Also since few of us are that familiar with Jetty (as far as I know anyway) perhaps you could do some digging to help us find the problem?
Thanks again for using myfaces!
[INFO] Configuring Jetty for project: Tomahawk Examples: Simple
[INFO] Webapp source directory is: .../myfaces-current/tomahawk/examples/simple/src/main/webapp
[INFO] web.xml file located at: .../myfaces-current/tomahawk/examples/simple/src/main/webapp/WEB-INF/web.xml
[INFO] Classes located at: .../myfaces-current/tomahawk/examples/simple/target/classes
[INFO] tmp dir for webapp will be .../myfaces-current/tomahawk/examples/simple/target/jetty-tmp
[INFO] Starting Jetty Server ...
[INFO] No connectors configured, using defaults: org.mortbay.jetty.nio.SelectChannelConnector listening on 8080 with maxIdleTime 30000
1 [main] INFO org.mortbay.log - Logging to org.slf4j.impl.SimpleLogger@d71256 via org.mortbay.log.Slf4jLog
[INFO] Context path = /myfaces-example-simple
[INFO] Webapp directory = .../myfaces-current/tomahawk/examples/simple/src/main/webapp
[INFO] Setting up classpath ...
[INFO] Finished setting up classpath
[INFO] Started configuring web.xml, resource base=.../myfaces-current/tomahawk/examples/simple/src/main/webapp
[INFO] Finished configuring web.xml
1560 [main] WARN org.mortbay.log - failed Faces Servlet
1562 [main] WARN org.mortbay.log - failed ContextHandler@a9da7
{/myfaces-example-simple,file:.../myfaces-current/tomahawk/examples/simple/src/main/webapp/}
1621 [main] INFO org.mortbay.log - Started SelectChannelConnector @ 0.0.0.0:8080
1622 [main] WARN org.mortbay.log - failed Server@751a9b
[INFO] Jetty server exiting.
[INFO] ----------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ----------------------------------------------------------------------------
[INFO] Failure
Embedded error: 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>

The jetty plugin gets the myfaces libraries from the dependencies of the project, as specified in the POM.
The problem you are having is related to the startupServletContextListener: apparently Jetty does not yet support listeners via TLD files, so you should add the following lines to the web.xml of the tomahawk simple example web.xml:

I've been trying to locate the problem, but haven't found the exact source yet.
I have noticed that in the ExtensionsResponseWrapper there is a comment that Jetty uses the getOutputStream() method, whereas Tomcat uses the getWriter() method, which is not the case for Jetty6: it also uses the getWriter() method.

Anyway, it has been a while since I wrote ServletFilters and such - JSF does such a good job hiding all that request/response complexity I haven't needed it anymore - so it might take me a while to figure out how this thing works...

Jurgen Lust
added a comment - 16/Feb/06 00:35 The jetty plugin gets the myfaces libraries from the dependencies of the project, as specified in the POM.
The problem you are having is related to the startupServletContextListener: apparently Jetty does not yet support listeners via TLD files, so you should add the following lines to the web.xml of the tomahawk simple example web.xml:
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
Now it should start correctly.
I've been trying to locate the problem, but haven't found the exact source yet.
I have noticed that in the ExtensionsResponseWrapper there is a comment that Jetty uses the getOutputStream() method, whereas Tomcat uses the getWriter() method, which is not the case for Jetty6: it also uses the getWriter() method.
Anyway, it has been a while since I wrote ServletFilters and such - JSF does such a good job hiding all that request/response complexity I haven't needed it anymore - so it might take me a while to figure out how this thing works...