| JSF support? [message #77024] | 
Tue, 14 November 2006 05:27   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Originally posted by: user.domain.invalid 
 
Hi, 
 
I write a webapp bundle and I want to integrate JSF. My server is the  
jettybundle. 
But I get allways this error when running the webapp bundle: 
 
org.mortbay.jetty.servlet.ServletHandler handle 
SCHWERWIEGEND: /faces/index.jsp: 
java.lang.IllegalStateException: Application was not properly  
initialized at startup, could not find Factory:  
javax.faces.context.FacesContextFactory 
	at  javax.faces.FactoryFinder.getFactory(FactoryFinder.java:263) 
	at javax.faces.webapp.FacesServlet.init(FacesServlet.java:142) 
	at  
 org.eclipse.equinox.http.registry.internal.ServletManager$Se rvletWrapper.initializeDelegate(ServletManager.java:144) 
	at  
 org.eclipse.equinox.http.registry.internal.ServletManager$Se rvletWrapper.service(ServletManager.java:128) 
	at  
 org.eclipse.equinox.http.servlet.internal.ServletRegistratio n.handleRequest(ServletRegistration.java:91) 
	at  
 org.eclipse.equinox.http.servlet.internal.ProxyServlet.proce ssAlias(ProxyServlet.java:110) 
	at  
 org.eclipse.equinox.http.servlet.internal.ProxyServlet.servi ce(ProxyServlet.java:68) 
	at  javax.servlet.http.HttpServlet.service(HttpServlet.java:689) 
	at  org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder .java:428) 
	at  
 org.mortbay.jetty.servlet.ServletHandler.dispatch(ServletHan dler.java:677) 
	at  org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandl er.java:568) 
	at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) 
	at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) 
	at org.mortbay.http.HttpServer.service(HttpServer.java:909) 
	at  org.mortbay.http.HttpConnection.service(HttpConnection.java: 820) 
	at  org.mortbay.http.HttpConnection.handleNext(HttpConnection.ja va:986) 
	at  org.mortbay.http.HttpConnection.handle(HttpConnection.java:8 37) 
	at  
 org.mortbay.http.SocketListener.handleConnection(SocketListe ner.java:245) 
	at  org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:3 57) 
	at  org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:5 34) 
 
 
 
But the Factory is available in the bundle! 
Is there any support for JSF in an equinox bundle? 
Or can anybody help me or give me a hint? 
 
Best regards, 
Sabine
 |  
 |  
  | 
 | 
| Re: JSF support? [message #77367 is a reply to message #77223] | 
Thu, 16 November 2006 14:26    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Originally posted by: user.domain.invalid 
 
Hi Simon, 
 
thanks for your reply. 
I solved the problem with the FacesContextFactory. But now I have the  
problem that there's no ServletContextListener registered. And I don't  
know how to to register the Listener without web.xml. 
You mentioned that it's possible to simulate this with a servlet. 
Can you post a small example servlet, please! 
 
Best regards, 
Sabine 
 
 
 
Simon Kaegi schrieb: 
> Hi Sabine, 
>  
> Equinox currently doesn't have a JSF bundle. 
> That said, it should be feasible to add support, it's more a matter of 
> finding the time to take a look. 
> (contributions welcome) 
>  
> With that said, as I recall JSF uses a ServletContextListener to do some 
> initialization work as the context gets created so I suspect the error 
> you're seeing is related to not having an attribute set. 
>  
> The OSGi HttpService does not have the concept of a ServletContextListener 
> however (if you're determined) you can simulate the initialization with 
> either another servlet or by wrapping the Faces servlet with another servlet 
> that can do the initialization. The first approach is probably sufficient 
> for testing. Eventually we might look at doing the second approach and 
> offering good out-of-the-box support. 
>  
> HTH 
> -Simon 
>  
> "Sabine Wagner" <user@domain.invalid> wrote in message 
> news:ejc5p6$jgi$1@utils.eclipse.org... 
>  
>>Hi, 
>> 
>>I write a webapp bundle and I want to integrate JSF. My server is the 
>>jettybundle. 
>>But I get allways this error when running the webapp bundle: 
>> 
>>org.mortbay.jetty.servlet.ServletHandler handle 
>>SCHWERWIEGEND: /faces/index.jsp: 
>>java.lang.IllegalStateException: Application was not properly 
>>initialized at startup, could not find Factory: 
>>javax.faces.context.FacesContextFactory 
>>at  javax.faces.FactoryFinder.getFactory(FactoryFinder.java:263) 
>>at javax.faces.webapp.FacesServlet.init(FacesServlet.java:142) 
>>at 
>> 
>  
>  org.eclipse.equinox.http.registry.internal.ServletManager$Se rvletWrapper.ini 
> tializeDelegate(ServletManager.java:144) 
>  
>>at 
>> 
>  
>  org.eclipse.equinox.http.registry.internal.ServletManager$Se rvletWrapper.ser 
> vice(ServletManager.java:128) 
>  
>>at 
>> 
>  
>  org.eclipse.equinox.http.servlet.internal.ServletRegistratio n.handleRequest( 
> ServletRegistration.java:91) 
>  
>>at 
>> 
>  
>  org.eclipse.equinox.http.servlet.internal.ProxyServlet.proce ssAlias(ProxySer 
> vlet.java:110) 
>  
>>at 
>> 
>  
>  org.eclipse.equinox.http.servlet.internal.ProxyServlet.servi ce(ProxyServlet. 
> java:68) 
>  
>>at  javax.servlet.http.HttpServlet.service(HttpServlet.java:689) 
>>at  org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder .java:428) 
>>at 
>> org.mortbay.jetty.servlet.ServletHandler.dispatch(ServletHan dler.java:677) 
>>at 
>  
>  org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandl er.java:568) 
>  
>>at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) 
>>at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) 
>>at org.mortbay.http.HttpServer.service(HttpServer.java:909) 
>>at  org.mortbay.http.HttpConnection.service(HttpConnection.java: 820) 
>>at  org.mortbay.http.HttpConnection.handleNext(HttpConnection.ja va:986) 
>>at  org.mortbay.http.HttpConnection.handle(HttpConnection.java:8 37) 
>>at 
>> org.mortbay.http.SocketListener.handleConnection(SocketListe ner.java:245) 
>>at  org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:3 57) 
>>at  org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:5 34) 
>> 
>> 
>> 
>>But the Factory is available in the bundle! 
>>Is there any support for JSF in an equinox bundle? 
>>Or can anybody help me or give me a hint? 
>> 
>>Best regards, 
>>Sabine 
>> 
>  
>  
>
 |  
 |  
  | 
| Re: JSF support? [message #77462 is a reply to message #77367] | 
Fri, 17 November 2006 00:01    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Originally posted by: skaegi.sympatico.ca 
 
Sure, here's a quick example 
If you know exactly which classes are involved you can create a no argument 
constructor by extending this and setting the instances (or just take a look 
and do your own thing.) 
 
HTH 
-Simon 
 
-- 
package some.package 
import java.io.IOException; 
import javax.servlet.*; 
 
public class ServletCotextListenerServletAdaptor implements Servlet { 
 private ServletConfig config; 
 private ServletContextListener listener; 
 private Servlet delegate; 
 
 public ServletCotextListenerServletAdaptor(ServletContextListener listener, 
Servlet delegate) { 
  this.listener = listener; 
  this.delegate = delegate; 
 } 
 
 public void init(ServletConfig config) throws ServletException { 
  this.config = config; 
  listener.contextInitialized(new 
ServletContextEvent(config.getServletContext())); 
  delegate.init(config); 
 } 
 
 public void service(ServletRequest req, ServletResponse resp) throws 
ServletException, IOException { 
  delegate.service(req, resp); 
 } 
 
 public void destroy() { 
  delegate.destroy(); 
  listener.contextDestroyed(new 
ServletContextEvent(config.getServletContext())); 
  config = null; 
 } 
 
 public ServletConfig getServletConfig() { 
  return config; 
 } 
 
 public String getServletInfo() { 
  return ""; 
 } 
} 
 
 
 
 
 
"Sabine Wagner" <user@domain.invalid> wrote in message 
news:ejie3m$jlf$1@utils.eclipse.org... 
> Hi Simon, 
> 
> thanks for your reply. 
> I solved the problem with the FacesContextFactory. But now I have the 
> problem that there's no ServletContextListener registered. And I don't 
> know how to to register the Listener without web.xml. 
> You mentioned that it's possible to simulate this with a servlet. 
> Can you post a small example servlet, please! 
> 
> Best regards, 
> Sabine 
> 
> 
> 
> Simon Kaegi schrieb: 
> > Hi Sabine, 
> > 
> > Equinox currently doesn't have a JSF bundle. 
> > That said, it should be feasible to add support, it's more a matter of 
> > finding the time to take a look. 
> > (contributions welcome) 
> > 
> > With that said, as I recall JSF uses a ServletContextListener to do some 
> > initialization work as the context gets created so I suspect the error 
> > you're seeing is related to not having an attribute set. 
> > 
> > The OSGi HttpService does not have the concept of a 
ServletContextListener 
> > however (if you're determined) you can simulate the initialization with 
> > either another servlet or by wrapping the Faces servlet with another 
servlet 
> > that can do the initialization. The first approach is probably 
sufficient 
> > for testing. Eventually we might look at doing the second approach and 
> > offering good out-of-the-box support. 
> > 
> > HTH 
> > -Simon 
> > 
> > "Sabine Wagner" <user@domain.invalid> wrote in message 
> > news:ejc5p6$jgi$1@utils.eclipse.org... 
> > 
> >>Hi, 
> >> 
> >>I write a webapp bundle and I want to integrate JSF. My server is the 
> >>jettybundle. 
> >>But I get allways this error when running the webapp bundle: 
> >> 
> >>org.mortbay.jetty.servlet.ServletHandler handle 
> >>SCHWERWIEGEND: /faces/index.jsp: 
> >>java.lang.IllegalStateException: Application was not properly 
> >>initialized at startup, could not find Factory: 
> >>javax.faces.context.FacesContextFactory 
> >>at  javax.faces.FactoryFinder.getFactory(FactoryFinder.java:263) 
> >>at javax.faces.webapp.FacesServlet.init(FacesServlet.java:142) 
> >>at 
> >> 
> > 
> > 
 org.eclipse.equinox.http.registry.internal.ServletManager$Se rvletWrapper.ini 
> > tializeDelegate(ServletManager.java:144) 
> > 
> >>at 
> >> 
> > 
> > 
 org.eclipse.equinox.http.registry.internal.ServletManager$Se rvletWrapper.ser 
> > vice(ServletManager.java:128) 
> > 
> >>at 
> >> 
> > 
> > 
 org.eclipse.equinox.http.servlet.internal.ServletRegistratio n.handleRequest( 
> > ServletRegistration.java:91) 
> > 
> >>at 
> >> 
> > 
> > 
 org.eclipse.equinox.http.servlet.internal.ProxyServlet.proce ssAlias(ProxySer 
> > vlet.java:110) 
> > 
> >>at 
> >> 
> > 
> > 
 org.eclipse.equinox.http.servlet.internal.ProxyServlet.servi ce(ProxyServlet. 
> > java:68) 
> > 
> >>at  javax.servlet.http.HttpServlet.service(HttpServlet.java:689) 
> >>at 
 org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder .java:428) 
> >>at 
> 
>> org.mortbay.jetty.servlet.ServletHandler.dispatch(ServletHan dler.java:677) 
> >>at 
> > 
> >  org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandl er.java:568) 
> > 
> >>at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) 
> >>at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) 
> >>at org.mortbay.http.HttpServer.service(HttpServer.java:909) 
> >>at  org.mortbay.http.HttpConnection.service(HttpConnection.java: 820) 
> >>at  org.mortbay.http.HttpConnection.handleNext(HttpConnection.ja va:986) 
> >>at  org.mortbay.http.HttpConnection.handle(HttpConnection.java:8 37) 
> >>at 
> 
>> org.mortbay.http.SocketListener.handleConnection(SocketListe ner.java:245) 
> >>at  org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:3 57) 
> >>at  org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:5 34) 
> >> 
> >> 
> >> 
> >>But the Factory is available in the bundle! 
> >>Is there any support for JSF in an equinox bundle? 
> >>Or can anybody help me or give me a hint? 
> >> 
> >>Best regards, 
> >>Sabine 
> >> 
> > 
> > 
> > 
>
 |  
 |  
  | 
 | 
 | 
Powered by 
FUDForum. Page generated in 0.04706 seconds