Forums de discussion

BridgeFactoryFinderImpl class cast exception with ICEFaces

PortletFaces Community Member, modifié il y a 13 années.

BridgeFactoryFinderImpl class cast exception with ICEFaces

Regular Member Publications: 199 Date d'inscription: 03/04/12 Publications récentes
I'm trying to convert a functioning portlet to use the newest ICEFaces under Liferay 6.0.6. Old version of ICEFaces was 1.8, converting to 2.0.1, running under Tomcat 6.0.29 and PortletFaces Bridge 2.0.0.RC1.

I'm getting the following exception when the portlet is deployed:
21:10:11,433 INFO  [PortletHotDeployListener:220] Registering portlets for myportlet
21:10:12,094 ERROR [FacesConfigurationImpl:140] org.portletfaces.bridge.BridgeFactoryFinderImpl cannot be cast to org.portletfaces.bridge.scope.BridgeRequestScopeFactory
java.lang.ClassCastException: org.portletfaces.bridge.BridgeFactoryFinderImpl cannot be cast to org.portletfaces.bridge.scope.BridgeRequestScopeFactory
	at org.portletfaces.bridge.config.FacesConfigurationImpl.init(FacesConfigurationImpl.java:128)
	at org.portletfaces.bridge.BridgeUtil.getFacesConfiguration(BridgeUtil.java:86)
	at org.portletfaces.bridge.BridgeFactoryFinder.getFactory(BridgeFactoryFinder.java:42)
	at BridgeImpl.java.init(BridgeImpl.java:322)
	at org.portletfaces.bridge.GenericFacesPortlet.init(GenericFacesPortlet.java:126)
	at com.liferay.portlet.InvokerPortletImpl.init(InvokerPortletImpl.java:245)
	at com.liferay.portlet.PortletInstanceFactoryImpl.init(PortletInstanceFactoryImpl.java:216)
	at com.liferay.portlet.PortletInstanceFactoryImpl.create(PortletInstanceFactoryImpl.java:139)
	at com.liferay.portlet.PortletInstanceFactoryUtil.create(PortletInstanceFactoryUtil.java:40)
	at com.liferay.portlet.PortletBagFactory.create(PortletBagFactory.java:290)
	at com.liferay.portal.deploy.hot.PortletHotDeployListener.initPortlet(PortletHotDeployListener.java:456)
	at com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy(PortletHotDeployListener.java:253)
	at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:101)
	at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent(HotDeployUtil.java:109)
	at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUtil.java:182)
	at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:38)
	at com.liferay.portal.kernel.servlet.PortletContextListener.doPortalInit(PortletContextListener.java:99)
	at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42)
	at com.liferay.portal.kernel.util.PortalLifecycleUtil.flushInits(PortalLifecycleUtil.java:41)
	at com.liferay.portal.servlet.MainServlet.initPlugins(MainServlet.java:803)
	at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:355)
	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
	at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
	at org.apache.catalina.core.StandardService.start(StandardService.java:519)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

The portlet.xml includes:
portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
	<portlet>
		<portlet-name>PP_TREETASKLIST</portlet-name>
		<display-name>Accomplish Task List</display-name>
		<portlet-class>org.portletfaces.bridge.GenericFacesPortlet</portlet-class>
		<init-param>
			<name>com.icesoft.faces.EDIT</name>
			<value>/Edit.iface</value>
		</init-param>
		<init-param>
			<name>com.icesoft.faces.HELP</name>
			<value>/Help.iface</value>
		</init-param>
                ...
</portlet>

Any ideas? Thanks.
thumbnail
Neil Griffin, modifié il y a 13 années.

RE: BridgeFactoryFinderImpl class cast exception with ICEFaces

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
If you look at the following portlet.xml as a reference:
https://github.com/liferay/liferay-faces/blob/master/demos/bridge/icefaces3-portlet/src/main/webapp/WEB-INF/portlet.xml

Then I would suggest that the problem you're seeing is that you're not using the "javax.portlet.faces.defaultViewId.XYZ" key names.
PortletFaces Community Member, modifié il y a 13 années.

RE: BridgeFactoryFinderImpl class cast exception with ICEFaces

Regular Member Publications: 199 Date d'inscription: 03/04/12 Publications récentes
Thanks for the reply Neil. I think the portlet.xml file is in the correct format, so the problem may indeed be the javax.portlet.faces.defaultViewId.XYZ specifier.

Unfortunately, due to a system crash I lost several of my experiments that weren't mature enough to check in. I'll have to recreate this over the next few days.

It might also be worthwhile to augment the list of ICEFaces 1.8 -> 2.0 changes with changes oriented towards the portlet bridge. I know there were at least a couple of other changes required in faces.xml during the conversion.
thumbnail
Neil Griffin, modifié il y a 13 années.

RE: BridgeFactoryFinderImpl class cast exception with ICEFaces

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
ICEsoft has a general porting wiki page which includes a small section about portlets:
http://wiki.icefaces.org/display/ICE/ICEfaces+1.x+Compatibility

That page also includes a link to the Portlet development wiki page:
http://wiki.icefaces.org/display/ICE/Portlet+Development

My current understanding is that ICEsoft will be fortifying these wiki pages in the near future. Thanks.
PortletFaces Community Member, modifié il y a 12 années.

RE: BridgeFactoryFinderImpl class cast exception with ICEFaces

Regular Member Publications: 199 Date d'inscription: 03/04/12 Publications récentes
In the interest of completeness I'll summarize what I've found so far, although at this point it does not include a solution.

I was able to recreate my experiment and make some progress. Per Neil's suggestion, I did switch to using javax.portlet.faces.defaultViewId.view. I also went through the ICEfaces checklists once again.

This got me a little further, but not far enough. I got the error "The FacesServlet cannot have a url-pattern of /*. Please define a different url-pattern." and joined the discussion at http://www.liferay.com/community/forums/-/message_boards/message/7536705.