You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Michael Szalay <mi...@basis06.com> on 2008/03/17 08:26:23 UTC

[Orchestra] Question to myFaces Orchestra configuration (Error on each request)

Hi all

I want to add the "conversation"-scope to my jsf-webapp, without support for JPA (just the new scopes to be used in JSF).

I 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>
     
</beans>


At application startup, I see the following in the log:

INFO  2008-03-17 08:22:51,940 [main] org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/b06Skel]: Initializing Spring root WebApplicationContext
INFO  2008-03-17 08:22:51,940 [main] org.springframework.web.context.ContextLoader: Root WebApplicationContext: initialization started
INFO  2008-03-17 08:22:52,012 [main] org.springframework.web.context.support.XmlWebApplicationContext: Refreshing org.springframework.web.context.support.XmlWebApplicationContext@1c21ece: display name [Root WebApplicationContext]; startup date [Mon Mar 17 08:22:52 CET 2008]; root of context hierarchy
INFO  2008-03-17 08:22:52,909 [main] org.springframework.beans.factory.xml.XmlBeanDefinitionReader: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
INFO  2008-03-17 08:22:53,105 [main] org.springframework.beans.factory.xml.XmlBeanDefinitionReader: Loading XML bean definitions from URL [jar:file:/opt/jakarta-tomcat-5.5.9/webapps/b06Skel/WEB-INF/lib/myfaces-orchestra-core-1.1.jar!/META-INF/spring-orchestra-init.xml]
INFO  2008-03-17 08:22:53,180 [main] org.springframework.web.context.support.XmlWebApplicationContext: Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@1c21ece]: org.springframework.beans.factory.support.DefaultListableBeanFactory@29d65b
INFO  2008-03-17 08:22:53,394 [main] org.springframework.beans.factory.support.DefaultListableBeanFactory: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@29d65b: defining beans [org.apache.myfaces.orchestra.conversation.AccessScopeManager,org.apache.myfaces.orchestra.conversation.AccessScopeManagerConfiguration,org.springframework.beans.factory.config.CustomScopeConfigurer#0]; root of factory hierarchy
INFO  2008-03-17 08:22:53,398 [main] org.springframework.web.context.ContextLoader: Root WebApplicationContext: initialization completed in 1458 ms

so it seems that the spring stuff gets correctly initialized.

But every time a request is coming to this app, I get the following exception:

ERROR 2008-03-17 08:24:35,110 [http-8000-Processor25] org.ajax4jsf.resource.ResourceLifecycle: Exception in PhaseListener, render view : beforePhase
java.lang.IllegalArgumentException: No AccessScopeManager found. Probably you forgot to add <import resource="classpath*:/META-INF/spring-orchestra-init.xml" /> to your spring configuration.
        at org.apache.myfaces.orchestra.conversation.AccessScopeManager.getInstance(AccessScopeManager.java:97)
        at org.apache.myfaces.orchestra.conversation.jsf.AccessScopePhaseListener.beforePhase(AccessScopePhaseListener.java:91)
        at org.ajax4jsf.resource.ResourceLifecycle.send(ResourceLifecycle.java:165)
        at org.ajax4jsf.resource.InternetResourceService.load(InternetResourceService.java:336)
        at org.ajax4jsf.cache.LRUMapCache.load(LRUMapCache.java:116)
        at org.ajax4jsf.cache.LRUMapCache.get(LRUMapCache.java:87)
        at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:198)
        at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:144)
        at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:265)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at com.basis06.b06Skel.webapp.filter.XSSCheckFilter.doFilter(XSSCheckFilter.java:69)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)


Any suggestions?

Regards



_________________________________________________________________________

Michael Szalay | michael.szalay@basis06.com | Software Engineer
basis06 AG | Effingerstrasse 25 | CH-3008 Bern
Fon +41 31 311 3222 | Fax +41 31 311 3242 | http://www.basis06.com

Re: [Orchestra] Question to myFaces Orchestra configuration (Error on each request)

Posted by Mario Ivankovits <ma...@ops.co.at>.
>
> Hi Mario
>
> yes, I'm using RichFaces 3.1.0. There is actually no real problem with the application (it works fine), but there is always this error in the log...
>   
Ah ... got it. You have to configure the DelegatingVariableResolver in
your faces-config.xml to make the variable lookup of beans configured in
spring work correctly. Some bits missing in our documentation it seems.

With:
    <application>
       
<variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
    </application>

your exception is gone.

Thanks for providing your application! That made it easy to figure out
what was wrong.
Ciao,
Mario

> I sent you my application as an attachment.
>
> Regards
>
> Michael
>
>
> -----Ursprüngliche Nachricht-----
> Von: Mario Ivankovits [mailto:mario@ops.co.at]
> Gesendet: Montag, 17. März 2008 11:42
> An: MyFaces Discussion
> Betreff: Re: [Orchestra] Question to myFaces Orchestra configuration
> (Error on each request)
>
>
> Hi Michael!
>   
>> > ERROR 2008-03-17 08:24:35,110 [http-8000-Processor25] org.ajax4jsf.resource.ResourceLifecycle: Exception in PhaseListener, render view : beforePhase
>> > java.lang.IllegalArgumentException: No AccessScopeManager found. Probably you forgot to add <import resource="classpath*:/META-INF/spring-orchestra-init.xml" /> to your spring configuration.
>> >         at org.apache.myfaces.orchestra.conversation.AccessScopeManager.getInstance(AccessScopeManager.java:97)
>> >         at org.apache.myfaces.orchestra.conversation.jsf.AccessScopePhaseListener.beforePhase(AccessScopePhaseListener.java:91)
>> >         at org.ajax4jsf.resource.ResourceLifecycle.send(ResourceLifecycle.java:165)
>> >   
>>     
> Is see nothing bad. You are using RichFaces? Which version?
>
> Hmmm .... for me, it seems like a Spring setup problem when it comes to
> resource delivery with ajax4jsf, but have not clue what that can be.
>
> Is it possible for you to provide a simple webapp setup with a
> hello-world example where we easily can debug the problem? Else I have
> to setup such a project first and this might take a day or two - and
> probably I might not be able to reproduce that bug then  :-( 
>
> Thanks!
> Ciao,
> Mario
>   


Re: [Orchestra] Question to myFaces Orchestra configuration (Error on each request)

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi Michael!
> ERROR 2008-03-17 08:24:35,110 [http-8000-Processor25] org.ajax4jsf.resource.ResourceLifecycle: Exception in PhaseListener, render view : beforePhase
> java.lang.IllegalArgumentException: No AccessScopeManager found. Probably you forgot to add <import resource="classpath*:/META-INF/spring-orchestra-init.xml" /> to your spring configuration.
>         at org.apache.myfaces.orchestra.conversation.AccessScopeManager.getInstance(AccessScopeManager.java:97)
>         at org.apache.myfaces.orchestra.conversation.jsf.AccessScopePhaseListener.beforePhase(AccessScopePhaseListener.java:91)
>         at org.ajax4jsf.resource.ResourceLifecycle.send(ResourceLifecycle.java:165)
>   
Is see nothing bad. You are using RichFaces? Which version?

Hmmm .... for me, it seems like a Spring setup problem when it comes to
resource delivery with ajax4jsf, but have not clue what that can be.

Is it possible for you to provide a simple webapp setup with a
hello-world example where we easily can debug the problem? Else I have
to setup such a project first and this might take a day or two - and
probably I might not be able to reproduce that bug then :-(

Thanks!
Ciao,
Mario