Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] jetty 8.0.0M0 java.lang.IllegalStateException

Hi again,

I've looked a little further into this one.  The good news is that you can
make this work with jetty-8 with a little configuration. It would actually
be a bit simpler for you to use jetty-hightide, as that comes with some
extras already configured that you're going to need, such as jsp. See:

http://dist.codehaus.org/jetty/jetty-hightide-8.0.0/

If you're *not* using hightide do:

* get the jsp2.2 jars, either from the hightide distro or the dev.java.net repository and put them in $JETTY_HOME/lib/jsp

* create a context xml file to configure your webapp, and tell it that
 you want to use annotations and servlet container initializers (all
 features that mojarra 2.0.2 is using). You do that by including these
 lines in your context config file:
   <Call name="setConfigurationClasses">
     <Arg>
         <Array type="java.lang.String">
             <Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item>
             <Item>org.eclipse.jetty.webapp.WebXmlConfiguration</Item>
             <Item>org.eclipse.jetty.webapp.MetaInfConfiguration</Item>
             <Item>org.eclipse.jetty.webapp.FragmentConfiguration</Item>
             <Item>org.eclipse.jetty.plus.webapp.EnvConfiguration</Item>
             <Item>org.eclipse.jetty.plus.webapp.Configuration</Item>
             <Item>org.eclipse.jetty.annotations.AnnotationConfiguration</Item>
             <Item>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Item>
             <Item>org.eclipse.jetty.annotations.ContainerInitializerConfiguration</Item>
         </Array>
     </Arg>
   </Call>


Now, regarless of if you're using jetty-hightide or the standard jetty-distribution do:

* edit the etc/jetty.xml file and tell jetty to scan the mojarra jars:
          <Call name="setContextAttribute">
           <Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
           <Arg>.*/servlet-api-[^/]*\.jar$,.*/jsf-[^/]*\.jar$</Arg>
         </Call>


You *might* also need to edit your web.xml file and add in the mojarra listener that
configures stuff for faces. If you need to put it in, you add these lines to your web.xml:
   <listener>
     <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
   </listener>

If you get it working, please post back and let me know. Also please post any extra
things that you needed to do, or things that are still not working.

regards
Jan

Jan Bartel wrote:
Hi,

How are you including the mojarra jars? Are they on the container classpath
(ie in $JETTY-HOME/lib somewhere) or inside the webapp?

If they're on the container classpath, then you will need to add those jars
to the ones that jetty scans at startup time.

See the example etc/jetty.xml file and the line that sets the regular expressions for the files to scan - look for "org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern".

I'm a bit surprised that it works under jetty-7 actually, as it looks
like the mojarra stuff needs initialization that is specific to servlet-spec 3. I guess they must have some other alternatives in
there to support earlier specs.

If it still doesn't work, can you please post back with a full description
of your webapp and how you deploy it (standalone/maven, context deployer/webapp deployer etc). Ideally if you have a small webapp
setup that demonstrates the problem, that would be good.

cheers
Jan




Quoc Thang Trinh wrote:
Hello,

my web application is based on mojarra 2.0.2 and jetty 7.0.2. It works fine.

Last week I decide to use jetty 8.0.0M0 because I want to implement a programmatic authentication

which uses HttpServletRequest.login(). After replace all jars from jetty 7.0.2 with the new one I get the following exception at startup

ERROR /dominic  - unavailable

_java.lang.IllegalStateException_: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory

at javax.faces.FactoryFinder$FactoryManager.getFactory(_FactoryFinder.java:804_)

      at javax.faces.FactoryFinder.getFactory(_FactoryFinder.java:306_)

      at javax.faces.webapp.FacesServlet.init(_FacesServlet.java:166_)

at org.eclipse.jetty.servlet.ServletHolder.initServlet(_ServletHolder.java:442_)

at org.eclipse.jetty.servlet.ServletHolder.doStart(_ServletHolder.java:270_)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(_AbstractLifeCycle.java:55_)

at org.eclipse.jetty.servlet.ServletHandler.initialize(_ServletHandler.java:724_)

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(_ServletContextHandler.java:268_)

at org.eclipse.jetty.webapp.WebAppContext.startContext(_WebAppContext.java:978_)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(_ContextHandler.java:608_)

at org.eclipse.jetty.servlet.ServletContextHandler.doStart(_ServletContextHandler.java:155_)

at org.eclipse.jetty.webapp.WebAppContext.doStart(_WebAppContext.java:349_)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(_AbstractLifeCycle.java:55_)

at org.eclipse.jetty.server.handler.HandlerCollection.doStart(_HandlerCollection.java:165_)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(_AbstractLifeCycle.java:55_)

Has anyone an idea?

Thanks in advanced


------------------------------------------------------------------------

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users


--
Jan Bartel, Webtide LLC | janb@xxxxxxxxxxx | http://www.webtide.com


Back to the top