开发者

grails portlet FlashScope

I am using def liferay_portlet_private_session_attributes = false in grails portlet for liferay . This i was using to share session values with other portlet .

session.getAttribute("orgid", PortletSession.APPLICATION_SCOPE) 

I was getting this error when build,deployed each time refresh the url.

Caused 开发者_StackOverflowby: java.lang.ClassCastException: org.codehaus.groovy.grails.web.servlet.GrailsFlashScope cannot be cast to org.codehaus.groovy.grails.web.servlet.FlashScope

If i logout and login it works good . But i am unable to understand how to fix it keeping the same settings.

Could any one please tell me is there any fix .


As discussed via email, I think this is a ClassLoader issue. An object of type GrailsFlashScope (loaded in one portlet) is trying to be cast to FlashScope (loaded in the second portlet).

Even though GrailsFlashScope implements FlashScope, the FlashScope class loaded from two different class loaders are not considered equal and will throw CCE's.

The only way I can think to fix it is to move the grails-*.jar files (e.g. grails-web.jar) to some kind of shared jar folder (not sure where that is in Liferay) and remove them from the portlet WAR files.

cheers

Lee

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜