You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by gretchch <ch...@us.ibm.com> on 2008/05/28 01:45:38 UTC

[Orchestra]: NullPointerException in AbstractViewControllerManager

I want to add "conversation"-scope to my existing JSF application, without
the JPA support.  I have added the following listeners to my web.xml:
    <!-- spring listeners -->
    <listener>
       
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <listener>
       
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    </listener>
    <listener>
        <listener-class>
           
org.apache.myfaces.orchestra.conversation.servlet.ConversationManagerSessionListener
        </listener-class>
    </listener>

Here is my applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
       http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
       http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
   
    <!-- 1. initialization of all orchestra modules (required for core15
module) -->
    <import resource="classpath*:/META-INF/spring-orchestra-init.xml" />
   
    <!-- 2. the conversation scopes -->
    <bean
class="org.springframework.beans.factory.config.CustomScopeConfigurer">
        <property name="scopes">
            <map>
                <entry key="conversation.manual">
                    <bean
class="org.apache.myfaces.orchestra.conversation.spring.SpringConversationScope">
                        <property name="timeout" value="30" />
                    </bean>
                </entry>
               
                <entry key="conversation.access">
                    <bean
class="org.apache.myfaces.orchestra.conversation.spring.SpringConversationScope">
                        <property name="timeout" value="30" />
                        <property name="lifetime" value="access"/>
                    </bean>
                </entry>
            </map>
        </property>
    </bean>
     
    <bean id="testBean" class="beans.TestBean" scope="session" />
    <bean id="pc_TestPage" class="pagecode.TestPage" scope="request" />
</beans>

Here is my faces-config.xml
<?xml version="1.0"?>

<!DOCTYPE faces-config PUBLIC
  "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
  "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">

<!-- =========== FULL CONFIGURATION FILE ==================================
-->

<faces-config>
    <application>
      
<variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
    </application>
</faces-config>

I have a simple test page that attempts to use the testBean in an
<h:outputText> tag.  When I deploy the ear that contains this page, the
deploy goes fine, and I get the following on my log:
[5/27/08 19:13:09:785 EDT] 00000014 ApplicationMg A   WSVR0200I: Starting
application: TestAPP
[5/27/08 19:13:09:795 EDT] 00000014 ApplicationMg A   WSVR0204I:
Application: TestAPP  Application build level: Unknown
[5/27/08 19:13:10:015 EDT] 00000014 WebGroup      A   SRVE0169I: Loading Web
Module: Test.
[5/27/08 19:13:10:476 EDT] 00000014 WebApp        A   SRVE0180I:
[TestAPP#Test.war] [/test] [Servlet.LOG]: Initializing Spring root
WebApplicationContext
[5/27/08 19:13:10:616 EDT] 00000014 ContextLoader I
org.springframework.web.context.ContextLoader initWebApplicationContext Root
WebApplicationContext: initialization started
[5/27/08 19:13:10:736 EDT] 00000014 XmlWebApplica I
org.springframework.context.support.AbstractApplicationContext
prepareRefresh Refreshing
org.springframework.web.context.support.XmlWebApplicationContext@58fc58fc:
display name [Root WebApplicationContext]; startup date [Tue May 27 19:13:10
EDT 2008]; root of context hierarchy
[5/27/08 19:13:10:927 EDT] 00000014 XmlBeanDefini I
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions Loading XML bean definitions from ServletContext
resource [/WEB-INF/applicationContext.xml]
[5/27/08 19:13:11:007 EDT] 00000014 XmlBeanDefini I
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions Loading XML bean definitions from URL
[wsjar:file:/C:/ProjectsRAD/workspace/IW/Test/WebContent/WEB-INF/lib/myfaces-orchestra-core-1.1.jar!/META-INF/spring-orchestra-init.xml]
[5/27/08 19:13:11:337 EDT] 00000014 XmlWebApplica I
org.springframework.context.support.AbstractApplicationContext
obtainFreshBeanFactory Bean factory for application context
[org.springframework.web.context.support.XmlWebApplicationContext@58fc58fc]:
org.springframework.beans.factory.support.DefaultListableBeanFactory@359e359e
[5/27/08 19:13:11:648 EDT] 00000014 DefaultListab I
org.springframework.beans.factory.support.DefaultListableBeanFactory
preInstantiateSingletons Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@359e359e:
defining beans
[org.apache.myfaces.orchestra.conversation.AccessScopeManager,org.apache.myfaces.orchestra.conversation.AccessScopeManagerConfiguration,org.springframework.beans.factory.config.CustomScopeConfigurer#0,testBean];
root of factory hierarchy
[5/27/08 19:13:11:888 EDT] 00000014 ContextLoader I
org.springframework.web.context.ContextLoader initWebApplicationContext Root
WebApplicationContext: initialization completed in 1272 ms
[5/27/08 19:13:11:898 EDT] 00000014 ServletWrappe I   SRVE0242I: [TestAPP]
[/test] [Faces Servlet]: Initialization successful.
[5/27/08 19:13:11:908 EDT] 00000014 ServletWrappe I   SRVE0242I: [TestAPP]
[/test] [JavaScript Resource Servlet]: Initialization successful.
[5/27/08 19:13:11:908 EDT] 00000014 VirtualHost   I   SRVE0250I: Web Module
Test has been bound to default_host[*:9080,*:80,*:9443,*:5060,*:5061,*:443].
[5/27/08 19:13:12:058 EDT] 00000014 ApplicationMg A   WSVR0221I: Application
started: TestAPP

When I try to display the page:
http://localhost:9080/test/TestPage.faces

I get the following in my log:
[5/27/08 19:13:49:472 EDT] 00000029 ServletWrappe E   SRVE0068E: Uncaught
exception thrown in one of the service methods of the servlet: Faces
Servlet. Exception thrown : java.lang.NullPointerException
	at
org.apache.myfaces.orchestra.viewController.AbstractViewControllerManager.getViewController(AbstractViewControllerManager.java:59)
	at
org.apache.myfaces.orchestra.viewController.AbstractViewControllerManager.executeInitView(AbstractViewControllerManager.java:69)
	at
org.apache.myfaces.orchestra.viewController.jsf.ViewControllerPhaseListener.postRestoreView(ViewControllerPhaseListener.java:203)
	at
org.apache.myfaces.orchestra.viewController.jsf.ViewControllerPhaseListener.executeInitView(ViewControllerPhaseListener.java:174)
	at
org.apache.myfaces.orchestra.viewController.jsf.ViewControllerPhaseListener.afterPhase(ViewControllerPhaseListener.java:107)
	at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:228)
	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
	at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1070)
	at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:544)
	at
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:486)
	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3357)
	at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
	at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
	at
com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
	at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:115)
	at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
	at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
	at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263)
	at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
	at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
	at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
	at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
	at
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
	at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)

This is running on WebSphere 6.1.0.15 with the EJB3.0 Feature Pack installed
(although I'm not using any of the features of the feature pack at this
point, just trying to get SOMETHING to work).
-- 
View this message in context: http://www.nabble.com/-Orchestra-%3A-NullPointerException-in-AbstractViewControllerManager-tp17502517p17502517.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.