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

Gautam Marwaha commented on ORCHESTRA-25:
-----------------------------------------

We got things to work on WSRP portlets on BEA Portal 9.2. Two additional things 
were needed other than what's mentioned above:
1. Register the servlet filters on an additional URL pattern to allow WSRP 
requests to be serviced. In case of BEA Portal, the URL pattern is "/producer/*"
2. In WSRP environments, request objects are not retained end-to-end from 
Consumer to Producer. So, request parameters like "conversationContext" 
parameter used in Orchestra do not pass through. However, WSRP passes along 
request "attributes". In case of Orchestra, there is a request attribute called 
"org.apache.myfaces.ConversationManager.conversationContext" (comes from 
ConversationManager.CONVERSATION_CONTEXT_REQ) that contained the conversation 
context value. So, to retain conversations across requests, we inserted a 
hidden field in forms present within JSPs that store the request attribute 
value in "conversationContext" parameter:
<input type="hidden" name="conversationContext" 
value="<%=request.getAttribute("org.apache.myfaces.ConversationManager.conversationContext")%>"/>

> Orchestra does not work within BEA WebLogic JSF portlet - FacesContextFactory 
> related problem
> ---------------------------------------------------------------------------------------------
>
>                 Key: ORCHESTRA-25
>                 URL: https://issues.apache.org/jira/browse/ORCHESTRA-25
>             Project: MyFaces Orchestra
>          Issue Type: Bug
>          Components: FrameworkAdapter
>    Affects Versions: 1.1
>         Environment: BEA WebLogic Portal 9.2,  BEA WebLogic JSF portlets,  
> Sun JSF RI 1.1_01, MyFaces Orchestra 1.2 snapshot
>            Reporter: Gautam Marwaha
>         Attachments: stacktrace_1.txt, stacktrace_2.txt
>
>
> I have read about the Orchestra's support for conversation scope and think it 
> is very promising for an application we're building that needs to support 1) 
> updates in wizard kind of screens where users submit changes made in multiple 
> tabs and 2) have this working in scenarios where users do a ctrl+n / open new 
> browser windows (=> session scope is ruled out)
> To get things started I am trying to get an Orchestra example (multiBean) 
> working on our tech stack - BEA WebLogic Portal 9.2,  BEA WebLogic JSF 
> portlets, Sun JSF RI 1.1_01 and MyFaces Orchestra 1.2 snapshot. We are not 
> going to have any non-JSF functionality in our application.
> So far I have been successful in running the example on BEA WebLogic Portal 
> 9.2 *without* wrapping the JSPs within a JSF portlet. However, as soon as I 
> wrap the JSP within a JSF portlet, I get the following error on the examples 
> home page (/start.jsp):
> java.lang.ClassCastException: 
> com.sun.faces.context.MyHttpServletRequestWrapper
>       at 
> com.bea.portlet.adapter.faces.lifecycle.LifecycleImpl.restore(LifecycleImpl.java:308)
>       at 
> com.bea.portlet.adapter.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:199)
>       at 
> com.bea.portlet.adapter.faces.FacesContentStubImpl.render(FacesContentStubImpl.java:224)
>       at 
> com.bea.netuix.servlets.controls.content.FacesContent.beginRender(FacesContent.java:312)
> This issue is showing up because 
> myfaces-orchestra-core-1.2-SNAPSHOT.jar!faces-config.xml contains Orchestra 
> related FacesContextFactory classes that are loaded by Faces Servlet upon 
> startup. Looks like these factories 
> (org.apache.myfaces.orchestra.lib.jsf.OrchestraFacesContextFactory is one of 
> them) are not returning valid FacesContext objects (they're returning an 
> object meant for servlet / non-portlet environments) and cause a 
> ClassCastException in BEA Portal's classes that appear to be casting the 
> request to FacesRequest, something like:
> (FacesRequest)context.getExternalContext().getRequest();
> To fix this problem, I added the BEA Portal specific FacesContextFactory 
> (present in their faces-adapter.jar!faces-config.xml) into my applications's 
> faces-config.xml. i.e. the following lines:
> <factory>
>     ....
>     
> <faces-context-factory>com.bea.portlet.adapter.faces.context.FacesContextFactoryImpl</faces-context-factory>
>     
>     ....
> </factory>
> This atleast got me to the examples home page (/start.jsp) since the server 
> appears to have picked up the factory it last loaded. But, there is a side 
> effect of this change. Now I find that FrameworkAdapter has not been 
> initialized properly. The error is:
> Caused by: java.lang.IllegalStateException: FrameworkAdapter not found
>       at 
> org.apache.myfaces.orchestra.conversation.ConversationManager.getInstance(ConversationManager.java:111)
>       at 
> org.apache.myfaces.orchestra.conversation.ConversationManager.getInstance(ConversationManager.java:86)
>       at 
> org.apache.myfaces.orchestra.conversation.spring.AbstractSpringOrchestraScope.getRealBean(AbstractSpringOrchestraScope.java:311)
>       at 
> org.apache.myfaces.orchestra.conversation.spring.ScopedBeanTargetSource.getTarget(ScopedBeanTargetSource.java:71)
>       at 
> org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.getTarget(Cglib2AopProxy.java:666)
>       at 
> org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:616)
>       at 
> org.apache.myfaces.examples.multibean.Multibean$$EnhancerByCGLIB$$510f5a89.getBeanName()Ljava.lang.String;(:???)
> BEA Portal seems to be over-riding the Orchestra FacesContextFactory impl and 
> not letting it do its per-request operations.
> I have looked around for a way of getting the same thing done via Orchestra 
> filters. The following Orchestra filters are in my web.xml and haven't helped:
> - 
> org.apache.myfaces.orchestra.frameworkAdapter.basic.BasicFrameworkAdapterFilter
> - 
> org.apache.myfaces.orchestra.requestParameterProvider.RequestParameterServletFilter
> Even tried adding the 
> org.apache.myfaces.orchestra.conversation.jsf.filter.OrchestraServletFilter 
> filter but it did not help.
> I am not expecting BEA to fix/change anything on their side. Any chance this 
> can be fixed in Orchestra?
> Thanks,
> Gautam
> PS - will attach full stacktraces after I create this JIRA item

-- 
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