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
[EMAIL PROTECTED]: 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 [EMAIL PROTECTED]: [EMAIL PROTECTED]
INFO 2008-03-17 08:22:53,394 [main]
org.springframework.beans.factory.support.DefaultListableBeanFactory:
Pre-instantiating singletons in [EMAIL PROTECTED]: 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 | [EMAIL PROTECTED] | Software Engineer
basis06 AG | Effingerstrasse 25 | CH-3008 Bern
Fon +41 31 311 3222 | Fax +41 31 311 3242 | http://www.basis06.com