3 Replies Latest reply: May 7, 2012 2:26 AM by Marc Schmucki RSS

"Unable to parse document" error when setting PortletBridge 3.0.0 for Public Render Parameter

Miguel Escaja Newbie

Hi

 

I´m trying setup a portlet with a Public Render Parameter. I´m using Porlet Bridge 3.0.0 version. Here´s my faces-config.xml. The bit causing trouble is highlighted in red.

 

<?xml version='1.0' encoding='UTF-8'?>

<faces-config version="2.0"

    xmlns="http://java.sun.com/xml/ns/javaee"

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    xmlns:bridge="http://myfaces.apache.org/portletbridge"

    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee

    http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">

    <managed-bean>

        <managed-bean-name>user</managed-bean-name>

        <managed-bean-class>com.escaja.portlets.UserJSFManagedBean</managed-bean-class>

        <managed-bean-scope>request</managed-bean-scope>

    </managed-bean>

    <navigation-rule>

        <from-view-id>/view.xhtml</from-view-id>

        <navigation-case>

            <from-outcome>SayHello</from-outcome>

            <to-view-id>/view2.xhtml</to-view-id>

        </navigation-case>

    </navigation-rule>

    <navigation-rule>

        <from-view-id>/view2.xhtml</from-view-id>

        <navigation-case>

            <from-outcome>TryAgain</from-outcome>

            <to-view-id>/view.xhtml</to-view-id>

        </navigation-case>

    </navigation-rule>

    <application>

        <application-extension>

            <bridge:public-parameter-mappings>

                <bridge:public-parameter-mapping>

                    <parameter>JsfRichFacesHelloUserPortlet:prpExample</parameter>

                    <model-el>#{user.prpExampleMember}</model-el>        

                </bridge:public-parameter-mapping>

            </bridge:public-parameter-mappings>   

        </application-extension>

    </application>

</faces-config>

 

The error below comes up when deploying the portlet war file to a Tomcat 7.0.23 instance packaged with GateIn 3.2. The portlet does not appears in the Application Registry in GateIn after deployment.

 

When I remove the bit in red from the faces-config.xml file, the error goes away, the war file gets deployed fine, It shows in the Applicaiton Registry, I´m able to add the portlet on to a page in GateIn and the portlet functions correctly.

 

Error message below. By the looks it seems that it can´t resolve <bridge:public-parameter-mapping>

 

INFO: Inicializando Mojarra 2.1.1 (FCS 20110408) para el contexto '/FirstJsfRichFacesPortlet'

12-ene-2012 9:49:13 com.sun.faces.config.ConfigManager initialize

INFO: Unsanitized stacktrace from failed start...

com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: com.sun.faces.config.ConfigurationException: Unable to parse document 'jndi:/localhost/FirstJsfRichFacesPortlet/WEB-INF/faces-config.xml': null

    at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:675)

    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:322)

    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225)

    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4765)

    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5260)

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)

    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:842)

    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)

    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)

    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)

    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

    at java.util.concurrent.FutureTask.run(FutureTask.java:138)

    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

    at java.lang.Thread.run(Thread.java:662)

Caused by: java.util.concurrent.ExecutionException: com.sun.faces.config.ConfigurationException: Unable to parse document 'jndi:/localhost/FirstJsfRichFacesPortlet/WEB-INF/faces-config.xml': null

    at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)

    at java.util.concurrent.FutureTask.get(FutureTask.java:83)

    at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:673)

    ... 16 more

Caused by: com.sun.faces.config.ConfigurationException: Unable to parse document 'jndi:/localhost/FirstJsfRichFacesPortlet/WEB-INF/faces-config.xml': null

    at com.sun.faces.config.ConfigManager$ParseTask.call(ConfigManager.java:923)

    at com.sun.faces.config.ConfigManager$ParseTask.call(ConfigManager.java:868)

    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

    at java.util.concurrent.FutureTask.run(FutureTask.java:138)

    at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:659)

    ... 16 more

Caused by: java.lang.NullPointerException

    at com.sun.faces.config.ConfigManager$ParseTask.getDocument(ConfigManager.java:967)

    at com.sun.faces.config.ConfigManager$ParseTask.call(ConfigManager.java:914)

    ... 20 more

12-ene-2012 9:49:13 com.sun.faces.config.ConfigureListener contextInitialized

GRAVE: Critical error during deployment:

com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! null

    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:379)

    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225)

    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4765)

    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5260)

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)

    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:842)

    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)

    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)

    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)

    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

    at java.util.concurrent.FutureTask.run(FutureTask.java:138)

    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

    at java.lang.Thread.run(Thread.java:662)

Caused by: java.lang.NullPointerException

    at com.sun.faces.config.ConfigManager$ParseTask.getDocument(ConfigManager.java:967)

    at com.sun.faces.config.ConfigManager$ParseTask.call(ConfigManager.java:914)

    at com.sun.faces.config.ConfigManager$ParseTask.call(ConfigManager.java:868)

    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

    at java.util.concurrent.FutureTask.run(FutureTask.java:138)

    at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:659)

    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:322)

    ... 15 more

12-ene-2012 9:49:13 org.apache.catalina.core.StandardContext startInternal

GRAVE: Error listenerStart

12-ene-2012 9:49:13 org.apache.catalina.core.StandardContext startInternal

GRAVE: Falló en arranque del Contexto [/FirstJsfRichFacesPortlet] debido a errores previos

12-ene-2012 9:49:13 com.sun.faces.config.ConfigureListener contextDestroyed

GRAVE: Unexpected exception when attempting to tear down the Mojarra runtime

java.lang.IllegalStateException: La aplicación no se ha inicializado correctamente durante el inicio, no se encuentra la fábrica: javax.faces.application.ApplicationFactory

    at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:894)

    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:319)

    at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:112)

    at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:325)

    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4805)

    at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5453)

    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)

    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)

    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:842)

    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)

    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)

    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)

    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

    at java.util.concurrent.FutureTask.run(FutureTask.java:138)

    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

    at java.lang.Thread.run(Thread.java:662)

12-ene-2012 9:49:13 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks

GRAVE: La aplicación web [/FirstJsfRichFacesPortlet] creó un ThreadLocal con clave del tipo [javax.faces.context.FacesContext$1] (valor [javax.faces.context.FacesContext$1@60c9326f]) y un valor del tipo [com.sun.faces.config.InitFacesContext] (valor [com.sun.faces.config.InitFacesContext@390e470d]) pero no pudo quitarlo cuando la aplicación web se paró. Los hilos se van a renovar con el tiempo para intentar evitar in posible fallo de memoria.