Double check your <tomee.home>/conf/server.xml file and ensure it has the TomEE 
ServerListener:

    <Server port="8005" shutdown="SHUTDOWN">
      <!-- TomEE plugin for Tomcat -->
      <Listener className="org.apache.tomee.catalina.ServerListener" />

I've seen it be the case where a project was originally setup with plain Tomcat 
and then Tomcat deleted from the file system and TomEE unpacked in the same 
directory.  The trick is the server.xml in the project will be from Tomcat and 
not TomEE.  This is actually just fine, we only add the one listener, so 
generally adding that listener to the server.xml being used in the project is 
enough.


-David

On Dec 6, 2012, at 6:02 PM, slobo <mch...@otit.fi> wrote:

> Hello,
> 
> I'm a total newbie with JSF and can't get it to work on TomEE+ 1.5.1
> (20121130.041650-92-plus). I use the snapshot plus because 1.5.0 didn't work
> at all on my Windows computer and I'm just exploring all the features.
> 
> I'm currently trying to do the calculator example from TomEE examples, but
> even the simplest jsf-file fails. (BTW. In the calculator example the Faces
> Servlet is configured to handle *.jsf in web.xml, but the files are *.xhtml.
> What's up with that?)
> 
> My configuration is explained here: http://pastebin.com/qe8PU0Cy .
> 
> This is the exception I have during startup:
> --------
> joulu 07, 2012 3:00:07 AP. org.apache.catalina.core.ApplicationContext log
> SEVERE: StandardWrapper.Throwable
> 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:286)
>       at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:206)
>       at javax.faces.webapp.FacesServlet.init(FacesServlet.java:116)
> --------
> The full startup log can be found from here:
> http://pastebin.com/raw.php?i=u092jxcA . I added the mentioned listener to
> the web.xml but it does not affect anything (apart from the duplicate
> complaint).
> 
> This is what happens when I try to open a JSF page:
> --------
> joulu 07, 2012 3:19:05 AP. org.apache.catalina.core.ApplicationDispatcher
> invoke
> SEVERE: Servlet.service() for servlet Faces Servlet threw exception
> java.lang.NullPointerException
>       at
> org.apache.myfaces.shared.context.flash.FlashImpl.isKeepMessages(FlashImpl.java:388)
>       at
> org.apache.myfaces.shared.context.flash.FlashImpl._saveMessages(FlashImpl.java:665)
>       at
> org.apache.myfaces.shared.context.flash.FlashImpl.doPostPhaseActions(FlashImpl.java:269)
>       at
> org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:254)
>       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:199)
>       at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
>       at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>       at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
>       at
> org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
>       at
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
>       at
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
>       at
> org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:369)
>       at
> org.apache.myfaces.view.jsp.JspViewDeclarationLanguage.buildView(JspViewDeclarationLanguage.java:99)
>       at
> org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:78)
>       at
> org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:241)
>       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:199)
>       at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
>       at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>       at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
>       at
> org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
>       at
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
>       at
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
>       at
> org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:369)
>       at
> org.apache.myfaces.view.jsp.JspViewDeclarationLanguage.buildView(JspViewDeclarationLanguage.java:99)
>       at
> org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:78)
>       at
> org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:241)
>       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:199)
>       at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.
> --------
> The above exception keeps on repeating.
> 
> The question is:
> What should I do to make this work?
> 
> Could JSF be used with web-app version 3.0? It doesn't work either, the
> examples use 2.5 and therefore I have that currently set in my web.xml.
> 
> I also have a couple of unrelated questions.
> 
> Question 2:
> In some other examples over the Internet I've seen JSF to be done without
> faces-config.xml. Can that be achieved with TomEE? Are there any benefits in
> using the xml?
> 
> Question 3:
> How could I get my META-INF/resources.xml file to affect anything? I have my
> resources currently in tomee.xml, but would like to have it in the
> resources.xml. The resources.xml is as below:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <resources>
> <Resource id="mchakaDs" type="javax.sql.DataSource">
>       JdbcDriver com.mysql.jdbc.Driver
>       JdbcUrl jdbc:mysql://localhost:3306/mchaka
>       UserName root
>       Password foobarawol
>       JtaManaged true
> </Resource>
> </resources>
> 
> Thank you.
> 
> Yours,
> Mikko
> 
> 
> 
> 
> 
> --
> View this message in context: 
> http://openejb.979440.n4.nabble.com/JSF-not-starting-on-TomEE-1-5-1-plus-tp4659143.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Reply via email to