myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wolf Benz" <euroj...@gmail.com>
Subject Re: myFaces 1.2 problem
Date Wed, 25 Jul 2007 11:02:10 GMT
That's true Martin - there is a lot defaulted. Yet, if it's almost all
defaulted, I think there's a case for leaving the web.xml much cleaner.
Certainly the obvious ones could be better left out, it makes the
web.xmlonly more verbose.
It gives people the impression there's a lot to configure before you get MF
to work.
Look at all the setup issues of MF120 now: a lot of people(that would
include me) then start to wonder whether perhaps it's perhaps due to one of
all these params that is wrongly set, whereas that's(mostly) not the case.

All that and those & their explanation could perhaps be better shifted to
the project documentation.
To my taste, I find that a little "cleaner" :-)
-Wolf

On 7/25/07, Martin Marinschek <martin.marinschek@gmail.com> wrote:
>
> I believe your statement is entirely wrong.
>
> None of the MyFaces-web.xml parameter is necessary - they are all
> optional, with default values if they are not provided.
>
> For MyFaces - the implementation - you got nothing to configure
> additionally in comparison to the RI. The StartupServletContextListener is
> an issue with certain servlet-containers only, and it is certainly not our
> problem, but a problem with these servlet-containers. MyFaces doesn't
> require configuring this.
>
> For Tomahawk, there is one additional filter necessary. That's it. For
> performance tweaks, you might need one or two more settings. I wouldn't call
> that much.
>
> regards,
>
> Martin
>
> On 7/25/07, Wolf Benz <eurojava@gmail.com> wrote:
> >
> > Perhaps I better started a new thread on this but as this is a good
> > example:
> > Wouldn't it be a good idea for much more and aggressive defaulting from
> > MyFaces?
> > Take the web.xml: merely using myfaces makes the poor thing go through
> > the roof!
> > There are a few Context pars you can't do without but... the pretty
> > html, scroll, js, ... c'mon.
> > This StartupServletContextListener is another good example, the
> > AddStreamingresource Listener, ... it all just adds and adds. For newbies
> > coming from RI this alone is a reason to run back, fast! Certainly as -as is
> > pointed out in this thread as well- even doing do doesn;t guarantee a free
> > ride. With every Myfaces project, I have had startup problems. Currently as
> > well. (counter ticks 2 weeks now)
> > It's setup is too complex. Also a more standardized approach would
> > make troubleshooting  much easier.
> > It's a trend also, with reason. Look at annotations e.g. where you
> > mostly only have to use them if you wish to override a default setting.
> >
> >
> > -Wolf
> >
> > On 7/25/07, Martin Marinschek < martin.marinschek@gmail.com > wrote:
> > >
> > > Hi guys,
> > >
> > > the StartupServletContextListener should automatically be run by the
> > > servlet container when it parses the tld.
> > >
> > > What you can do as a workaround:
> > >
> > > - declare the context-listener as explained in the stacktrace in your
> > > web.xml
> > > - use the MyFacesServlet instead of the FacesServlet
> > >
> > > In any case, make sure that the work and temp directories of the
> > > Tomcat are cleared, and that you have the MyFaces libraries available only
> > > in one version.
> > >
> > > I have had this problem quite often now - especially in Tomcat, and
> > > I'm quite desperate to find a solution for this.
> > >
> > > regards,
> > >
> > > Martin
> > >
> > >
> > >
> > > On 7/25/07, Wolf Benz <eurojava@gmail.com> wrote:
> > > >
> > > > Indeed - and this is what made things already better for me - before
> > > > (2.5 & 1.2 versions), I had weird startup errors. --> for the time
> > > > being: better stick with versions 2.4 & 1.1 :-)-Wolf
> > > >
> > > > On 7/25/07, ncheltsov <ncheltsov@obs.bg> wrote:
> > > > >
> > > > >  Hi, as much as I see, both documents are, like you say: 2.4 &
1.1?
> > > > >
> > > > >
> > > > > Wolf Benz wrote:
> > > > >
> > > > > Sorry -  Look at the top of the 2 docs you cite: it refers to the
> > > > > version the document conforms to.
> > > > > At first I thought: I'm building a JSF1.2 app so I state: servlet
> > > > > v. 2.5(web.xml) &  JSF-version 1.2 (in faces-config top)
> > > > > Yet, to my surprise, this gave me problems...
> > > > > Changed them back to 2.4 & 1.1 and the problems were gone.
> > > > > If you look at the demo apps Werner put online this morning,
> > > > > you'll see he also references 2.4 & 1.1
> > > > >
> > > > >  The "why" for this failure is not clear to me. As you state
> > > > > yourself: it shouldn't be like this, it really should be 2.5 &
> > > > > 1.2...
> > > > >
> > > > >  OK like this?
> > > > > -Wolf
> > > > >
> > > > > On 7/24/07, ncheltsov <ncheltsov@obs.bg > wrote:
> > > > > >
> > > > > > Hi, I don't really understand what you are saying! Can you give
> > > > > > more explanations?
> > > > > > I need to use JSF version 1.2,  not 1.1.
> > > > > >
> > > > > > Wolf Benz wrote:
> > > > > >
> > > > > > On Tomcat I had this too at first.  Then I changed
> > > > > > - in the web.xml the web app xsd version from 2.5 to 2.4, and
> > > > > > - in faces-config.xml the JSF version from 1.2 to 1.1
> > > > > > ... and the problem was solved... !
> > > > > >
> > > > > >  The bleeb part is... it really should be 2.5 and 1.2, yet this
> > > > > > gave me errors...
> > > > > > Are the URLs wrong/not yet online (--> would SYSTEM &
have the
> > > > > > files locally solve the problem?)
> > > > > >
> > > > > >  & @Matthias: is the StartupServletContextListener still
> > > > > > necessary to declare in the web.xml?
> > > > > >
> > > > > >  -Wolf
> > > > > >
> > > > > > On 7/24/07, Matthias Wessendorf <matzew@apache.org > wrote:
> > > > > > >
> > > > > > > can you try this jetty version:
> > > > > > >
> > > > > > > <version>6.1.2rc0</version>
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On 7/24/07, ncheltsov <ncheltsov@obs.bg> wrote:
> > > > > > > >
> > > > > > > >  Hi, I am trying to use myfaces 1.2 and I have the
following
> > > > > > > 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>
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Caused by: java.lang.IllegalStateExceptio n: 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;
> > > > > > > > org.apache.myfaces.webapp.StartupServletContextListener
at
> > > > > > > > javax.faces.FactoryFinder.getFactory(FactoryFinder.java:90)
> > > > > > > > at
> > > > > > > > javax.faces.webapp.FacesServlet.init(FacesServlet.java:88)
> > > > > > > > at
> > > > > > > > org.mortbay.jetty.servlet.ServletHolder.initServlet(
> > > > > > > ServletHolder.java :433)
> > > > > > > > at
> > > > > > > > org.mortbay.jetty.servlet.ServletHolder.getServlet(
> > > > > > > ServletHolder.java:342)
> > > > > > > > at
> > > > > > > > org.mortbay.jetty.servlet.ServletHolder.handle(
> > > > > > > ServletHolder.java:463)
> > > > > > > > at
> > > > > > > > org.mortbay.jetty.servlet .ServletHandler.handle(
> > > > > > > ServletHandler.java:362)
> > > > > > > > at
> > > > > > > > org.mortbay.jetty.security.SecurityHandler.handle(
> > > > > > > SecurityHandler.java:216)
> > > > > > > > at
> > > > > > > > org.mortbay.jetty.servlet.SessionHandler.handle(
> > > > > > > SessionHandler.java :181)
> > > > > > > > at
> > > > > > > > org.mortbay.jetty.handler.ContextHandler.handle(
> > > > > > > ContextHandler.java:712)
> > > > > > > > at
> > > > > > > > org.mortbay.jetty.webapp.WebAppContext.handle(
> > > > > > > WebAppContext.java:405)
> > > > > > > > at
> > > > > > > > org.mortbay.jetty.handler .ContextHandlerCollection.handle(
> > > > > > > ContextHandlerCollection.java:211)
> > > > > > > > at
> > > > > > > > org.mortbay.jetty.handler.HandlerCollection.handle(
> > > > > > > HandlerCollection.java:114)
> > > > > > > > at
> > > > > > > > org.mortbay.jetty.handler.HandlerWrapper.handle(
> > > > > > > HandlerWrapper.java:139)
> > > > > > > > at org.mortbay.jetty.Server.handle(Server.java:313)
at
> > > > > > > > org.mortbay.jetty.HttpConnection.handleRequest(
> > > > > > > HttpConnection.java:506)
> > > > > > > > at
> > > > > > > > org.mortbay.jetty.HttpConnection$RequestHandler.headerComple
> > > > > > > te(HttpConnection.java:830)
> > > > > > > > at
> > > > > > > > org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
> > > > > > > > at
> > > > > > > > org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java
> > > > > > > :211)
> > > > > > > > at
> > > > > > > > org.mortbay.jetty.HttpConnecti on.handle(HttpConnection.java
> > > > > > > :381)
> > > > > > > > at
> > > > > > > > org.mortbay.io.nio.SelectChannelEndPoint.run(
> > > > > > > SelectChannelEndPoint.java:396)
> > > > > > > > at
> > > > > > > > org.mortbay.thread.BoundedThreadPool$PoolThread.run(
> > > > > > > BoundedThreadPool.java :442)
> > > > > > > >  I am using maven-jetty-plugin 6.1.5. I don't know
what
> > > > > > > stays behind this
> > > > > > > > plugin, but when I try to use JBoss-4.2 I
> > > > > > > > got the similar exception:
> > > > > > > >
> > > > > > > > [INFO] [talledLocalContainer]
> > > > > > > java.lang.IllegalStateException: Application
> > > > > > > > was not properly initialized at startup, could not
find
> > > > > > > Factor
> > > > > > > > y: javax.faces.application.ApplicationFactory
> > > > > > > > [INFO] [talledLocalContainer] at
> > > > > > > > javax.faces.FactoryFinder .getFactory(FactoryFinder.java
> > > > > > > :256)
> > > > > > > > [INFO] [talledLocalContainer] at
> > > > > > > > com.sun.faces.config.ConfigureListener$InitFacesContext
> > > > > > > .getApplication(ConfigureListener.java:1614)
> > > > > > > > [INFO] [talledLocalContainer] at
> > > > > > > > com.sun.faces.util.MessageFactory.getApplication(
> > > > > > > MessageFactory.java:255)
> > > > > > > > [INFO] [talledLocalContainer] at
> > > > > > > > com.sun.faces.util.MessageFactory.getMessage(
> > > > > > > MessageFactory.java:144)
> > > > > > > > [INFO] [talledLocalContainer] at
> > > > > > > > com.sun.faces.util.MessageFactory.getMessage(
> > > > > > > MessageFactory.java:122)
> > > > > > > > [INFO] [talledLocalContainer] at
> > > > > > > > com.sun.faces.util.MessageUtils.getExceptionMessageString(
> > > > > > > MessageUtils.java:277)
> > > > > > > > [INFO] [talledLocalContainer] at
> > > > > > > > com.sun.faces.config.ConfigureListener.digester(
> > > > > > > ConfigureListener.java:1180)
> > > > > > > > [INFO] [talledLocalContainer] at
> > > > > > > > com.sun.faces.config.ConfigureListener.contextInitialized(
> > > > > > > ConfigureListener.java:297)
> > > > > > > > [INFO] [talledLocalContainer] at
> > > > > > > > org.jboss.web.jsf.integration.config.JBossJSFConfigureListen
> > > > > > > er.contextInitialized(JBossJSFConfigureLis
> > > > > > > >
> > > > > > > > I tried everything and nothing helps. I tried to look
in
> > > > > > > Internet, without
> > > > > > > > any result. Since the problem is reproduced on different
> > > > > > > > servers I began to thing, that this is the problem
in JSF
> > > > > > > 1.2
> > > > > > > >
> > > > > > > >  my web.xml is classical:
> > > > > > > >
> > > > > > > >  <?xml version="1.0 "?>
> > > > > > > >  <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
> > > > > > > >
> > > > > > > > xmlns:xsi="http://www.w3.org/2001/XMLSche ma-instance"
> > > > > > > >
> > > > > > > > xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> > > > > > > > http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd "
> > > > > > > >           version="2.4">
> > > > > > > >
> > > > > > > >      <display-name>Hardware Tracing System</display-name>
> > > > > > > >      <description>Hardware Tracing System</description>
> > > > > > > >
> > > > > > > >     <listener>
> > > > > > > >         <listener-class>
> > > > > > > >
> > > > > > > > org.apache.myfaces.webapp.StartupServletContextListener
> > > > > > > >         </listener-class>
> > > > > > > >     </listener>
> > > > > > > >
> > > > > > > >     <servlet>
> > > > > > > >        <servlet-name>javax.faces.FacesServlet</servlet-name>
> > > > > > > >        <servlet-class>javax.faces.webapp.FacesServlet
> > > > > > > </servlet-class>
> > > > > > > >
> > > > > > > >     </servlet>
> > > > > > > >
> > > > > > > >     <servlet-mapping>
> > > > > > > >        <servlet-name>javax.faces.FacesServlet</servlet-name>
> > > > > > > >        <url-pattern>*.jsf</url-pattern>
> > > > > > > >     </servlet-mapping>
> > > > > > > >
> > > > > > > >      <!-- Welcome files -->
> > > > > > > >      <welcome-file-list>
> > > > > > > >          <welcome-file>helloWorld.jsf</welcome-file>
> > > > > > > >      </welcome-file-list>
> > > > > > > >
> > > > > > > >  </web-app>
> > > > > > > >
> > > > > > > >  my faces-config.xml also:
> > > > > > > >
> > > > > > > >  <?xml version="1.0"?>
> > > > > > > >
> > > > > > > >  <!DOCTYPE faces-config PUBLIC
> > > > > > > >    "-//Sun Microsystems, Inc.//DTD JavaServer Faces
Config
> > > > > > > 1.0//EN"
> > > > > > > >    "http://java.sun.com/dtd/web-facesconfig_1_1.dtd"
>
> > > > > > > >
> > > > > > > >  <faces-config>
> > > > > > > >
> > > > > > > >      <!-- managed beans of the simple hello world
app -->
> > > > > > > >      <managed-bean>
> > > > > > > >
> > > > > > > > <managed-bean-name>helloWorldBacking</managed-bean-name>
> > > > > > > >
> > > > > > > > <managed-bean-class>bg.obs.hts.HelloWorldBacking
> > > > > > > </managed-bean-class>
> > > > > > > >          <managed-bean-scope>request</managed-bean-scope>
> > > > > > > >      </managed-bean>
> > > > > > > >
> > > > > > > >      <!-- navigation rules for helloWorld.jsp -->
> > > > > > > >      <navigation-rule>
> > > > > > > >          <from-view-id>/helloWorld.jsp</from-view-id>
> > > > > > > >          <navigation-case>
> > > > > > > >              <from-outcome>success</from-outcome>
> > > > > > > >              <to-view-id>/helloWorld.jsp<
/to-view-id>
> > > > > > > >          </navigation-case>
> > > > > > > >      </navigation-rule>
> > > > > > > >  </faces-config>
> > > > > > > >
> > > > > > > >  Where the bleep is the problem. Any Idea.
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Matthias Wessendorf
> > > > > > >
> > > > > > > further stuff:
> > > > > > > blog: http://matthiaswessendorf.wordpress.com/
> > > > > > > mail: matzew-at-apache-dot-org
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > >
> > > --
> > >
> > > http://www.irian.at
> > >
> > > Your JSF powerhouse -
> > > JSF Consulting, Development and
> > > Courses in English and German
> > >
> > > Professional Support for Apache MyFaces
> >
> >
> >
>
>
> --
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>

Mime
View raw message