Salut,
Jason Lee wrote:
> I'm trying to follow the ServletAdapter example from the javadocs and
> not having much luck. Here's my code
>
> GrizzlyWebServer ws = new GrizzlyWebServer("/Users/jasonlee/Sites");
> try {
> ServletAdapter sa = new ServletAdapter();
> ConfigureListener cl = new ConfigureListener();
> sa.addServletListener("com.sun.faces.config.ConfigureListener");
>
> sa.setRootFolder("/Users/jasonlee/src/glassfish/test/glassfish/lib/install/applications/__admingui/");
> FacesServlet fs = new FacesServlet();
> sa.setServletInstance(fs);
>
> sa.setProperty("display-name", "Admin GUI");
> sa.setServletPath("*.jsf");
> sa.setContextPath("/");
>
> ws.addGrizzlyAdapter(sa);
>
> ws.start();
> } catch (Exception ex) {
> ex.printStackTrace();
> }
> }
So far so good. Now you want to embed a JSF application, which is
something we never experimented. Fist, is the JSF application uses the
following:
+ RequestDispatcher/NameDispatcher
+ Error page mechanism
+ Authentication
+ No JSP
Grizzly Servlet Container is not yet compliant, being developed mainly
by the community.
>
> and here's the stack trace I'm getting:
> Jan 23, 2009 11:09:57 AM
> com.sun.faces.config.ConfigureListener$WebXmlProcessor scanForFacesServlet
> WARNING: Unable to process deployment descriptor for context '/'
> java.lang.IllegalArgumentException: InputStream cannot be null
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:194)
> at
> com.sun.faces.config.ConfigureListener$WebXmlProcessor.scanForFacesServlet(ConfigureListener.java:705)
> at
> com.sun.faces.config.ConfigureListener$WebXmlProcessor.<init>(ConfigureListener.java:676)
> at
> com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:164)
> at
> com.sun.grizzly.http.servlet.ServletContextImpl.initListeners(ServletContextImpl.java:150)
> at
> com.sun.grizzly.http.servlet.ServletAdapter.configureServletEnv(ServletAdapter.java:322)
> at
> com.sun.grizzly.http.servlet.ServletAdapter.start(ServletAdapter.java:198)
> at
> com.sun.grizzly.http.SelectorThread.initEndpoint(SelectorThread.java:1084)
> at
> com.sun.grizzly.http.SelectorThread.listen(SelectorThread.java:1135)
> at
> com.sun.grizzly.http.embed.GrizzlyWebServer.start(GrizzlyWebServer.java:544)
> at com.steeplesoft.grizzlyfaces.Main.main(Main.java:40)
> Jan 23, 2009 11:09:57 AM com.sun.faces.config.ConfigureListener
Can you point me to the code that is doing that? I guess I can find it
in the JSF project....
> contextInitialized
> INFO: Initializing Mojarra 2.0.0 (SNAPSHOT 20090123) for context '/'
> Jan 23, 2009 11:09:58 AM com.sun.faces.spi.InjectionProviderFactory
> createInstance
> INFO: JSF1048: PostConstruct/PreDestroy annotations present.
> ManagedBeans methods marked with these annotations will have said
> annotations processed.
> Jan 23, 2009 11:09:58 AM com.sun.faces.config.ConfigManager initialize
> INFO: Unsanitized stacktrace from failed start...
> java.lang.ClassCastException: java.io.File cannot be cast to
> java.lang.String
> at
> com.sun.faces.application.resource.ResourceCache$WebappResourceMonitor.createSnapshot(ResourceCache.java:534)
Same here.
> at
> com.sun.faces.application.resource.ResourceCache$WebappResourceMonitor.createSnapshot(ResourceCache.java:520)
> at
> com.sun.faces.application.resource.ResourceCache$WebappResourceMonitor.<init>(ResourceCache.java:472)
> at
> com.sun.faces.application.resource.ResourceCache.initMonitors(ResourceCache.java:303)
> at
> com.sun.faces.application.resource.ResourceCache.<init>(ResourceCache.java:148)
> at
> com.sun.faces.application.ApplicationAssociate.<init>(ApplicationAssociate.java:218)
> at
> com.sun.faces.application.ApplicationImpl.<init>(ApplicationImpl.java:205)
> at
> com.sun.faces.application.ApplicationFactoryImpl.getApplication(ApplicationFactoryImpl.java:107)
> at
> com.sun.faces.config.processor.AbstractConfigProcessor.getApplication(AbstractConfigProcessor.java:130)
> at
> com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:234)
> at
> com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114)
> at
> com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:114)
> at
> com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114)
> at
> com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:207)
> at
> com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:311)
> at
> com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:207)
> at
> com.sun.grizzly.http.servlet.ServletContextImpl.initListeners(ServletContextImpl.java:150)
> at
> com.sun.grizzly.http.servlet.ServletAdapter.configureServletEnv(ServletAdapter.java:322)
> at
> com.sun.grizzly.http.servlet.ServletAdapter.start(ServletAdapter.java:198)
> at
> com.sun.grizzly.http.SelectorThread.initEndpoint(SelectorThread.java:1084)
> at
> com.sun.grizzly.http.SelectorThread.listen(SelectorThread.java:1135)
> at
> com.sun.grizzly.http.embed.GrizzlyWebServer.start(GrizzlyWebServer.java:544)
> at com.steeplesoft.grizzlyfaces.Main.main(Main.java:40)
> Jan 23, 2009 11:09:58 AM com.sun.grizzly.http.servlet.ServletContextImpl
> initListeners
> SEVERE:
> com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED!
> java.io.File cannot be cast to java.lang.String
> at
> com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:331)
> at
> com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:207)
> at
> com.sun.grizzly.http.servlet.ServletContextImpl.initListeners(ServletContextImpl.java:150)
> at
> com.sun.grizzly.http.servlet.ServletAdapter.configureServletEnv(ServletAdapter.java:322)
> at
> com.sun.grizzly.http.servlet.ServletAdapter.start(ServletAdapter.java:198)
> at
> com.sun.grizzly.http.SelectorThread.initEndpoint(SelectorThread.java:1084)
> at
> com.sun.grizzly.http.SelectorThread.listen(SelectorThread.java:1135)
> at
> com.sun.grizzly.http.embed.GrizzlyWebServer.start(GrizzlyWebServer.java:544)
> at com.steeplesoft.grizzlyfaces.Main.main(Main.java:40)
> Caused by: java.lang.ClassCastException: java.io.File cannot be cast to
> java.lang.String
> at
> com.sun.faces.application.resource.ResourceCache$WebappResourceMonitor.createSnapshot(ResourceCache.java:534)
> at
> com.sun.faces.application.resource.ResourceCache$WebappResourceMonitor.createSnapshot(ResourceCache.java:520)
> at
> com.sun.faces.application.resource.ResourceCache$WebappResourceMonitor.<init>(ResourceCache.java:472)
> at
> com.sun.faces.application.resource.ResourceCache.initMonitors(ResourceCache.java:303)
> at
> com.sun.faces.application.resource.ResourceCache.<init>(ResourceCache.java:148)
> at
> com.sun.faces.application.ApplicationAssociate.<init>(ApplicationAssociate.java:218)
> at
> com.sun.faces.application.ApplicationImpl.<init>(ApplicationImpl.java:205)
> at
> com.sun.faces.application.ApplicationFactoryImpl.getApplication(ApplicationFactoryImpl.java:107)
> at
> com.sun.faces.config.processor.AbstractConfigProcessor.getApplication(AbstractConfigProcessor.java:130)
> at
> com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:234)
> at
> com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114)
> at
> com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:114)
> at
> com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114)
> at
> com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:207)
> at
> com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:311)
> ... 8 more
>
> The paths on disk exist, but I'm making semi-educated guesses on the
> rest of the values. Any nudges in the right direction?
I guess I need to see what JSF is trying to do. Can you file an issue:
https://grizzly.dev.java.net/issues/
so we can work on it. BTW You want to run the admin gui on Grizzly? This
is great .... and scary as well :-)
A+
-- Jeanfrancois
>
>
> <http://www.java.com> * Jason Lee *
> Senior Java Developer
> GlassFish Administration Console
>
> *Sun Microsystems, Inc.*
> Phone x31197/+1 405-343-1964
> Email jasondlee_at_sun.com <mailto:jasondlee_at_sun.com>
> Blog http://blogs.sun.com/jasondlee
> Blog http://blogs.steeplesoft.com
>
>