[ 
https://issues.apache.org/jira/browse/ORCHESTRA-43?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12735612#action_12735612
 ] 

Mario Ivankovits commented on ORCHESTRA-43:
-------------------------------------------

Does it makes sense to have a conversation scoped bean implementing the 
ApplicationListener?

I'd suggest to make a separate bean for the ApplicationListener use case, and 
then, inject that bean (I assume you need some informations from this event) 
into the conversation scoped bean.

Starting a conversation from within an application-start-event is not possible.

> IllegalStateException on application startup when using conversations with 
> beans that implement ApplicationListener
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: ORCHESTRA-43
>                 URL: https://issues.apache.org/jira/browse/ORCHESTRA-43
>             Project: MyFaces Orchestra
>          Issue Type: Bug
>    Affects Versions: 1.3.1
>         Environment: Spring 2.5.6
>            Reporter: Jose Luis Freire
>            Priority: Critical
>
> If we have a bean with conversation scope that implements 
> ApplicationListener, on application startup we get a 
> java.lang.IllegalStateException: FrameworkAdapter not found.
> This happens because a application start event is fired and at that time no 
> HTTP session is in progress.
> The stack trace is:
> java.lang.IllegalStateException: FrameworkAdapter not found
>       at 
> org.apache.myfaces.orchestra.conversation.ConversationManager.getInstance(ConversationManager.java:120)
>       at 
> org.apache.myfaces.orchestra.conversation.ConversationManager.getInstance(ConversationManager.java:96)
>       at 
> org.apache.myfaces.orchestra.conversation.spring.AbstractSpringOrchestraScope.getRealBean(AbstractSpringOrchestraScope.java:330)
>       at 
> org.apache.myfaces.orchestra.conversation.spring.ScopedBeanTargetSource.getTarget(ScopedBeanTargetSource.java:73)
>       at 
> org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.getTarget(Cglib2AopProxy.java:666)
>       at 
> org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:616)
>       at 
> com.vianobis.campaign.web.activity.ActivityListBackend$$EnhancerByCGLIB$$975174a6.onApplicationEvent(<generated>)
>       at 
> org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>       at 
> org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>       at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>       at 
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
>       at 
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
>       at 
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:383)
>       at 
> org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
>       at 
> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
>       at 
> org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
>       at 
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
>       at 
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
>       at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
>       at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
>       at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
>       at 
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
>       at 
> org.apache.catalina.core.StandardService.start(StandardService.java:516)
>       at 
> org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
>       at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:597)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to