Liferay 4.3+Alfresco 2.1: MyFacesContextFactoryImpl problem
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2007 12:13 PM
Hi,
I've followed http://wiki.alfresco.com/wiki/Deploying_2.1WAR_Liferay4.3 on a fresh Liferay4.3 install to get both Liferay and Alfresco running. Unfortunately, at startup, I get an error complaining that class com.liferay.util.bridges.jsf.myfaces.MyFacesContextFactoryImpl cannot be found:
A grep on the tomcat installation shows me:
To me this looks like there *is* indeed a class MyFacesContextFactoryImpl but not under com.alfresco… but com.liferay…!? Is this a bug or am I doing something wrong?
Many thanks for a hint,
Kaspar
I've followed http://wiki.alfresco.com/wiki/Deploying_2.1WAR_Liferay4.3 on a fresh Liferay4.3 install to get both Liferay and Alfresco running. Unfortunately, at startup, I get an error complaining that class com.liferay.util.bridges.jsf.myfaces.MyFacesContextFactoryImpl cannot be found:
15:58:01,387 INFO [service.descriptor.DescriptorService] Alfresco started (Community Network): Current version 2.1.0 (482) schema 64 - Installed version 2.1.0 (482) schema 6415:58:06,640 ERROR [[Catalina].[localhost].[/alfresco]] StandardWrapper.Throwablejavax.faces.FacesException: java.lang.ClassNotFoundException: com.liferay.util.bridges.jsf.myfaces.MyFacesContextFactoryImpl at javax.faces.FactoryFinder.newFactoryInstance(FactoryFinder.java:174) at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:110) at javax.faces.webapp.FacesServlet.init(FacesServlet.java:91) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022) at org.apache.catalina.core.StandardHost.start(StandardHost.java:736) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:448) at org.apache.catalina.core.StandardServer.start(StandardServer.java:700) at org.apache.catalina.startup.Catalina.start(Catalina.java:552) 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:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)Caused by: java.lang.ClassNotFoundException: com.liferay.util.bridges.jsf.myfaces.MyFacesContextFactoryImpl at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1205) at javax.faces.FactoryFinder.newFactoryInstance(FactoryFinder.java:130) … 28 more15:58:06,647 ERROR [[Catalina].[localhost].[/alfresco]] Servlet /alfresco threw load() exceptionjava.lang.ClassNotFoundException: com.liferay.util.bridges.jsf.myfaces.MyFacesContextFactoryImpl at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1205) at javax.faces.FactoryFinder.newFactoryInstance(FactoryFinder.java:130) at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:110) at javax.faces.webapp.FacesServlet.init(FacesServlet.java:91) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022) at org.apache.catalina.core.StandardHost.start(StandardHost.java:736) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:448) at org.apache.catalina.core.StandardServer.start(StandardServer.java:700) at org.apache.catalina.startup.Catalina.start(Catalina.java:552) 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:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)Aug 17, 2007 3:58:09 PM org.apache.catalina.realm.JAASRealm setUseContextClassLoaderINFO: Setting useContextClassLoader = false15:58:10,285 INFO [[/tunnel-web]:647] Initializing Spring root WebApplicationContext15:58:17,160 INFO [[/tunnel-web]:647] Initializing Spring FrameworkServlet 'SpringServlet'Aug 17, 2007 3:58:22 PM org.apache.coyote.http11.Http11BaseProtocol startINFO: Starting Coyote HTTP/1.1 on http-8080Aug 17, 2007 3:58:22 PM org.apache.jk.common.ChannelSocket initINFO: JK: ajp13 listening on /0.0.0.0:8009Aug 17, 2007 3:58:22 PM org.apache.jk.server.JkMain startINFO: Jk running ID=0 time=0/69 config=nullAug 17, 2007 3:58:22 PM org.apache.catalina.storeconfig.StoreLoader loadINFO: Find registry server-registry.xml at classpath resourceAug 17, 2007 3:58:23 PM org.apache.catalina.startup.Catalina startINFO: Server startup in 130384 ms
A grep on the tomcat installation shows me:
hbf-laptop:/opt/liferay-portal-tomcat-5 root# grep -r MyFacesContextFactoryImpl *alfresco.log:javax.faces.FacesException: java.lang.ClassNotFoundException: com.liferay.util.bridges.jsf.myfaces.MyFacesContextFactoryImpl# MORE LOG FILES THAT MATCH…Binary file temp/liferay/com/liferay/portal/deploy/dependencies/util-bridges.jar matcheswebapps/alfresco/WEB-INF/faces-config.xml: <faces-context-factory>com.liferay.util.bridges.jsf.myfaces.MyFacesContextFactoryImpl</faces-context-factory>Binary file webapps/ROOT/WEB-INF/lib/util-bridges.jar matcheshbf-laptop:/opt/liferay-portal-tomcat-5 root#
To me this looks like there *is* indeed a class MyFacesContextFactoryImpl but not under com.alfresco… but com.liferay…!? Is this a bug or am I doing something wrong?
Many thanks for a hint,
Kaspar
Labels:
- Labels:
-
Archive
13 REPLIES 13

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2007 06:04 AM
I've tested this on 'liferay-portal-tomcat-jdk5-4.3.0' on windows with the files from the zip I updated. I don't get those errors. From looking at the portlet.xml and liferay-portlet.xml the names of the portlets in the 'portlet-name' field of each XML file match up correctly. I get some issues when trying to display the portlets:
10:03:04,858 WARN [service.impl.PortletLocalServiceImpl] Portlet not found for 1 AlfrescoDocList_WAR_alfresco
etc.
I'm not sure why yet…
Liferay will use the HSQL database, Alfresco will use MySQL if you deploy the WAR as per the wiki instructions.
Thanks,
Kevin
10:03:04,858 WARN [service.impl.PortletLocalServiceImpl] Portlet not found for 1 AlfrescoDocList_WAR_alfresco
etc.
I'm not sure why yet…
Liferay will use the HSQL database, Alfresco will use MySQL if you deploy the WAR as per the wiki instructions.
Thanks,
Kevin

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2007 06:36 AM
I'm not sure the use of the 'liferay-plugin-package.xml' is correct. Using this, Liferay deploys the webapp as "portlets" not as "alfresco" and then doesn't seem to find the portlets due to this naming confusion (which appear correct in files). The file 'portlet.xml' is now included so i'm not sure why it doesn't deploy on your system. Can you try with the modified instructions and just the portlet.xml not the liferay-plugin-package.xml? As that works for me…
Thanks,
Kevin
Thanks,
Kevin

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2007 11:46 AM
Oddly enough, I had to build util-bridges.jar myself before getting this to work, but otherwise the instructions worked well. Thanks for this.
In regards to the portlet.xml/liferay-plugin-package.xml, I've got both. I just threw together something based on the example in the liferay wiki, and it appears to have served the purpose of suppressing the notice that pops up when you don't have liferay-plugin-package.xml, and has had no further effect.
I was wondering about taking this to the next step, though. Once you get these two services married in this fashion, a Single Sign-On solution becomes a very worthwhile thing to implement. Liferay and Alfresco both work well with CAS when they're each running in their own servlet context, but it's my understanding that the CAS/HTTPRequest filter isn't used when Alfresco is deployed in the portlet environment. I know that Jonas Yuan has information on this subject, or at least a set a of files that do what I'm looking for, but I've yet to see someone completely explain what needs to happen to get Alfresco to rely on the portal for authentication when it's deployed as a portlet.
Am I just not searching well enough, or is my understand just way off? Feel fre(e) to slap me with RTFM links and ignore me. I'd be grateful if it was that simple.
Thanks again.
In regards to the portlet.xml/liferay-plugin-package.xml, I've got both. I just threw together something based on the example in the liferay wiki, and it appears to have served the purpose of suppressing the notice that pops up when you don't have liferay-plugin-package.xml, and has had no further effect.
I was wondering about taking this to the next step, though. Once you get these two services married in this fashion, a Single Sign-On solution becomes a very worthwhile thing to implement. Liferay and Alfresco both work well with CAS when they're each running in their own servlet context, but it's my understanding that the CAS/HTTPRequest filter isn't used when Alfresco is deployed in the portlet environment. I know that Jonas Yuan has information on this subject, or at least a set a of files that do what I'm looking for, but I've yet to see someone completely explain what needs to happen to get Alfresco to rely on the portal for authentication when it's deployed as a portlet.
Am I just not searching well enough, or is my understand just way off? Feel fre(e) to slap me with RTFM links and ignore me. I'd be grateful if it was that simple.
Thanks again.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2007 04:45 PM
Hi Kevin and all,
Thanks a lot for all your feed back and comments. Finally it's working now.
The procedure in wiki is ok, except I added some files to extensions to create the MySQL database. The files are custom-db-and-data-context.xml, custom-hibernate-dialect.properties, custom-repository.properties and custom-repository-context.xml.
Then place the war in the deploy and start liferay. The other thing was I had to drop and re-create the alfresco database again. It's also important to clear all the previous data and temp files i think.
I also upgraded jdk to 1.6. I'm not sure if it was any reason for the problem I had all this time.
Since I didn't use the file liferay-plugin-package.xml file, I get the following warning, but I guess it's ok. (I used portlet.xml)
Alfresco is also authenticating against LDAP with the configuration I had for 2.0. Now I guess it's time for the SSO to integrate.
Regards,
Lakmal
Thanks a lot for all your feed back and comments. Finally it's working now.
The procedure in wiki is ok, except I added some files to extensions to create the MySQL database. The files are custom-db-and-data-context.xml, custom-hibernate-dialect.properties, custom-repository.properties and custom-repository-context.xml.
Then place the war in the deploy and start liferay. The other thing was I had to drop and re-create the alfresco database again. It's also important to clear all the previous data and temp files i think.
I also upgraded jdk to 1.6. I'm not sure if it was any reason for the problem I had all this time.
Since I didn't use the file liferay-plugin-package.xml file, I get the following warning, but I guess it's ok. (I used portlet.xml)
WARN [com.liferay.portal.deploy.hot.PluginPackageHotDeployListener] Plugin package on context alfresco cannot be tracked because this WAR does not contain a liferay-plugin-package.xml file
Alfresco is also authenticating against LDAP with the configuration I had for 2.0. Now I guess it's time for the SSO to integrate.
Regards,
Lakmal
