wood burning stoves 2.0*
The moose likes Portals and Portlets and the fly likes Migrating from WPS 6.0 to 6.1 - API related problem.txt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "Migrating from WPS 6.0 to 6.1 - API related problem.txt" Watch "Migrating from WPS 6.0 to 6.1 - API related problem.txt" New topic
Author

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

Dorothy Taylor
Ranch Hand

Joined: Nov 26, 2007
Posts: 104
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
Ayub ali khan
Ranch Hand

Joined: Oct 20, 2005
Posts: 380
    
    2



I suggest you cast to HttpSessionFacade instead of PortletSession as thats the type which is being reported in the error message.


SCEA part I,TOGAF Foundation
Dorothy Taylor
Ranch Hand

Joined: Nov 26, 2007
Posts: 104
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

Joined: Oct 20, 2005
Posts: 380
    
    2
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

Joined: Nov 26, 2007
Posts: 104
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Migrating from WPS 6.0 to 6.1 - API related problem.txt
 
Similar Threads
IllegalStateException: Cannot forward. Response already committed.
Websphere Portal NullPointerException
Not able to send data from one struts portlet to another struts portlet
Struts - JSR168 Ajax Portlet - Problem!
Struts + Portlets