I occuring CastClass Exception on JSF classes.
I deploy myfaces and utilities jar files in every WAR on WEB-INF/lib directory.
Maybe one Web Application is trying to cast an object as an class (with same name an package) of another Web Application.
Does anybody configured two JSF enabled portlet on same portal page?
I never tried it actually.
one thing you can try is to put the JSF classes in lib of the application server.
normally if each web app has its own set of library it should not raise issues unless some classes are loaded at an higher level in the classloader heirarchy.
can you provide us a test case with the two jars on the same page ?
Stan had the same problem prior to his Java1 speech. (http://jboss.org/jbossBlog/blog/Stan%20Silvert/2005/07/01/Follow_up_to_my_JavaOne_talk.txt)
I don't remember, but I think the problem was still in 2.0 Final and was fixed after that. He said he had to grab the fix from HEAD.
I have read several posts about multiple JSF portlets running in the portal with most not concluding with a solution. I decided to see what did and did not work and see if we can, as a community, determine what is currently possible.
I am working with JBoss 4.0.3RC2, JBoss Portal 2.0 and MyFaces 1.0.9.
I have tested the following configurations:
1) JSFPortlet1 on Page1, JSFPortlet2 on Page2. One JSF portlet per page works great.
2) JSFPortlet1-Instance1 on Page1, JSFPortlet1-Instance2 on Page2. Same JSF Portlet, two instances, different pages, works great. (Note: Under no permutations was I able to get the same instance of a portlet to work on two different pages, or on the same page -- not sure that it should, but I did try to test it unsuccessfully.)
3) JSFPortlet1 and JSFPortlet2 on same page. The portlets display properly, but only one accepts actions. I believe this to be because both portlets have an <f:view> tag and the resulting "portal" page has two forms with the same ID value "_ID0" (one form for each portlet). Apparently, the JSF integration does not provide any namespace isolation by default. I read somewhere on this forum that this might be a 2.2 enhancement.
In an attempt to circumvent the issue in 3) above, I modified the rather simple 2ColumnLayout.jsp provided in the cardemo's demoLayout to include a parent <f:view> and a <f:subview> for each region, and then modified each portlet to assume life under the <f:subview>. I have been unable to get the layout to properly load the FacesContext properly. I am not sure this is a good solution anyway. It would not be too accommodating to require portlets under a specific layout to meet JSF subview constraints.
In summary, I am unable to get two JSF portlets to work properly on a single JBoss Portal page.
I had solved the problem downloading the 2.0 src that is in maintainance from CVS (see the CVS topic in forum) and building it.