webtier@glassfish.java.net

Re: [webtier] Re: Unable to get it work with Maven and embedded Jetty

From: Lincoln Baxter, III <lincolnbaxter_at_gmail.com>
Date: Fri, 1 Jan 2010 23:49:20 -0500

Wow. I completely missed the fact that you said you had already found
"mvn jetty:run-war"... apologies.. Good explanation and workaround,
Dan.

-Lincoln

On Thu, Dec 24, 2009 at 1:27 AM, <webtier_at_javadesktop.org> wrote:
> The problem is that Mojarra (JSF 2 RI) scans three places for classes annotated with @ManagedBean:
>
> 1. WEB-INF/classes
> 2. JARS in WEB-INF/lib
> 3. classpath with META-INF/faces-config.xml
>
> Since Jetty reads the class files from target/classes in embedded mode, JSF 2 doesn't know to scan them there (unless META-INF/faces-config.xml is present). Basically, instead of just scanning all classpath entries, Mojarra is very specific.
>
> If you really want to get productive with JSF 2 right out of the box w/ embedded Jetty, I recommend looking into the weld-jsf-servlet-minimal artifact, which prepares a JSF 2.0 and CDI 1.0 application for you.
>
> http://tinyurl.com/weld-archetypes
>
> If you use @Named classes (from CDI) rather than @ManagedBean (from JSF 2), a substitue I recommend anyway, then you can get the productive you want.
>
> Btw, here is the workaround with Mojarra with regard to the scanning: https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1111 If you put faces-config.xml in src/main/resources/META-INF, then it will find the classes you want.
> [Message sent by forum member 'mojavelinux' (dan.allen_at_mojavelinux.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=377293
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>
>