This works! Thanks again Michael
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Jakob Korherr Sent: Dienstag, 22. Dezember 2009 10:01 To: MyFaces Discussion Subject: Re: Servlets return 404 after update to 1.2 Hi Michael, Your problem is the following line: // set a new viewRoot, otherwise context.getViewRoot returns null UIViewRoot view = facesContext.getApplication().getViewHandler().createView(facesContext, ""); In this line the current view handler trys to build the view "", which, of course, does not exist and so the view handler sends a 404 not found. To fix this problem just remove the code that sets the UIViewRoot in the FacesContext (if you don't need it) or replace it with: facesContext.setViewRoot(new UIViewRoot()); This should work for you! Regards, Jakob 2009/12/22 Michael Heinen <[email protected]> > Hi, > > After my update from myfaces 1.1.6 to to 1.2.8 I got a strange error in my > Non-Faces Servlets. > All Servlets are working well until I access the Faces Context as described > in the WIKI: > http://wiki.apache.org/myfaces/AccessFacesContextFromServlet > > After this all responses are empty and status is 404. > Responses are sent correctly I don't access the FacesContext in the > Servlet. > This was of course working with myFaces 1.1.6 > > The workaround is obvious: Do no access FC in Servlets. > > But I would like to know the cause for this strange behavior. > I can't find anything in the logfiles and didn't find anything during > debugging. > > Stack of my servlet call: > MyServlet.service(HttpServletRequest, HttpServletResponse) line: 72 > MyServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 717 > ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) > line: 290 > ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206 > CacheFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: > 114 > ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) > line: 235 > ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206 > StandardWrapperValve.invoke(Request, Response) line: 233 > StandardContextValve.invoke(Request, Response) line: 191 > BasicAuthenticator(AuthenticatorBase).invoke(Request, Response) line: 433 > StandardHostValve.invoke(Request, Response) line: 128 > ErrorReportValve.invoke(Request, Response) line: 102 > StandardEngineValve.invoke(Request, Response) line: 109 > CoyoteAdapter.service(Request, Response) line: 286 > Http11Processor.process(Socket) line: 845 > > > Michael >

