users@glassfish.java.net

help with the EmbeddedWebContainer?

From: Gregory Gerard <ggerard_at_mac.com>
Date: Tue, 13 Apr 2010 16:39:51 -0700

I'm not using JSF but probing the variables inside the stack has the look of it:
InjectionManagerImpl.injectInstance(Object, boolean) line: 143
com.sun.faces.config.ConfigureListener_at_59c749fc

which bubbles up into the console output below. The webapp does not deploy. web.xml is version 2.5. I've tried ContainerBuilder.Type.all but that's never worked for me.

By itself, the webapp works fine (mvn embedded-glassfish:run works like a champ).

Here's how I'm starting (which I got from Justing Lee's article: http://www.antwerkz.com/wicket-and-embedded-glassfish/

Why is Faces causing a blowup? Is it really Faces?

thanks,
greg

    public void start()
        throws IOException {
        final Server theServer = new Server.Builder("testBuilder").build();
        ContainerBuilder theContainerBuilder = theServer.createConfig(ContainerBuilder.Type.web);

        theServer.addContainer(theContainerBuilder);
        final EmbeddedWebContainer theEmbeddedWebContainer = (EmbeddedWebContainer) theContainerBuilder.create(theServer);

        theEmbeddedWebContainer.setLogLevel(Level.ALL);

        theServer.createPort(8888);
        final EmbeddedDeployer theEmbeddedDeployer = theServer.getDeployer();
        DeployCommandParameters theDeployCommandParameters = new DeployCommandParameters();

        theDeployCommandParameters.contextroot = "/";
        theDeployCommandParameters.logReportedErrors = Boolean.TRUE;

        File theTargetDirectoryFile = new File("target/blah").getAbsoluteFile();

        System.out.println("Deployed: " + theEmbeddedDeployer.deploy(theTargetDirectoryFile, theDeployCommandParameters));
    }


...
classLoader = WebappClassLoader (delegate=true; repositories=WEB-INF/classes/)
SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7_at_45609812
Apr 13, 2010 4:24:01 PM org.apache.catalina.core.StandardContext callServletContainerInitializers
SEVERE: PWC1420: Error invoking ServletContainerInitializer org.apache.jasper.runtime.TldScanner
org.apache.jasper.JasperException: PWC6180: Unable to initialize TldScanner
        at org.apache.jasper.runtime.TldScanner.scanTlds(TldScanner.java:287)
        at org.apache.jasper.runtime.TldScanner.onStartup(TldScanner.java:228)
        at org.apache.catalina.core.StandardContext.callServletContainerInitializers(StandardContext.java:5279)
        at com.sun.enterprise.web.WebModule.callServletContainerInitializers(WebModule.java:550)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:5190)
        at com.sun.enterprise.web.WebModule.start(WebModule.java:499)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:928)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:912)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:694)
        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1933)
        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1605)
        at com.sun.enterprise.web.WebApplication.start(WebApplication.java:90)
        at org.glassfish.internal.data.EngineRef.start(EngineRef.java:126)
        at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:241)
        at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:236)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:339)
        at org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:214)
        at org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:144)
        at com.ggerard.blah.service.WebContainerTest.start(WebContainerTest.java:86)
        at com.ggerard.blah.service.WebContainerTest.main(WebContainerTest.java:55)
Caused by: java.lang.IllegalArgumentException: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class com.sun.faces.config.ConfigureListener
        at org.apache.catalina.core.StandardContext.addListener(StandardContext.java:2659)
        at org.apache.catalina.core.StandardContext.addListener(StandardContext.java:2642)
        at org.apache.catalina.core.ApplicationContext.addListener(ApplicationContext.java:1270)
        at org.apache.catalina.core.ApplicationContextFacade.addListener(ApplicationContextFacade.java:665)
        at org.apache.jasper.runtime.TldScanner.addListener(TldScanner.java:435)
        at org.apache.jasper.runtime.TldScanner.scanJar(TldScanner.java:420)
        at org.apache.jasper.runtime.TldScanner.scanJars(TldScanner.java:633)
        at org.apache.jasper.runtime.TldScanner.scanTlds(TldScanner.java:282)
        ... 19 more
Caused by: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class com.sun.faces.config.ConfigureListener
        at org.apache.catalina.core.StandardContext.createListener(StandardContext.java:2769)
        at org.apache.catalina.core.StandardContext.loadListener(StandardContext.java:4646)
        at com.sun.enterprise.web.WebModule.loadListener(WebModule.java:1583)
        at org.apache.catalina.core.StandardContext.addListener(StandardContext.java:2656)
        ... 26 more
Caused by: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class com.sun.faces.config.ConfigureListener
        at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:312)
        at com.sun.enterprise.web.WebContainer.createListenerInstance(WebContainer.java:730)
        at com.sun.enterprise.web.WebModule.createListenerInstance(WebModule.java:1958)
        at org.apache.catalina.core.StandardContext.createListener(StandardContext.java:2767)
        ... 29 more
Caused by: com.sun.enterprise.container.common.spi.util.InjectionException: No descriptor registered for current invocation : com.sun.enterprise.web.WebComponentInvocation_at_7141cf63
        at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.injectInstance(InjectionManagerImpl.java:143)
        at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.injectInstance(InjectionManagerImpl.java:127)
        at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:306)
        ... 32 more
Apr 13, 2010 4:24:01 PM org.apache.catalina.core.StandardContext start
SEVERE: PWC1306: Startup of context failed due to previous errors
Apr 13, 2010 4:24:01 PM org.apache.catalina.core.StandardContext start
SEVERE: PWC1305: Exception during cleanup after start failed