• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Migrating from WPS 6.0 to 6.1 - API related problem.txt

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All

I am facing problem in migrating the portlet code from WPS 6.0 to 6.1. the problem is that the conversion from page scope to portlet scope using the pageContext does not work in 6.1 for eg., if I have the following JSP in my portlet :


[tt][/tt]


I get the following error message:
Error 500: java.lang.ClassCastException: com.ibm.ws.session.HttpSessionFacade incompatible with javax.portlet.PortletSession

Can anyone please advise what is the problem and how can we fix it?

Thanks
 
Ranch Hand
Posts: 399
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



I suggest you cast to HttpSessionFacade instead of PortletSession as thats the type which is being reported in the error message.
 
Dorothy Taylor
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We cannot cast to HttpSessionFacade as well. Further pageContext.getSession() returns HttpSession. Actually the problem arises when the HttpSession is cast to PortletSession
 
Ayub ali khan
Ranch Hand
Posts: 399
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In that case you may have to use HttpSession itself since you do not have an option here.

Also just curious, the initial code you mentioned does nothing with psession reference.

 
Dorothy Taylor
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, I guess the problem is solved. The problem is not with teh conversion of session on page scope(PageContext) to session on PortletScope. The problem is the conversion of HttpSession to PortletSession which is invalid. PageContext.getSession returns HttpSession. Till that it is fine. Now when we typecast it to PortletSession, then it fails because HttpSession does not superclass PortletSession.

Actually this will fail on WPS 5.1 or 6.0 as well since this is incorrect API usage
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic