PortletFaces Problem on liferay 6.0.2 (jboss 5.1.0.GA)

PortletFaces Community Member, modified 15 Years ago. Regular Member Posts: 199 Join Date: 4/3/12 Recent Posts
Dear PortletFaces-Team,
i am trying to deploy the example of the job-applicant jsf2-portlet with portletfaces on a liferay installation (running on JBoss 5.1.0.GA).

When i try to deploy the example (compiling went well, I modified the POM to take the release of FCS 2.0.3 into account), an exception is thrown:
javax.faces.context.FacesContextFactory not found.

The problem seams to reside in the classloader of the find method of java server faces.
The jsf-impl and api is installed under <server>/deploy/jbossweb.sar/jsflibs/, as it normally should be.
My first step was to remove the libraries under WEB-INF/lib of the web-archive, since i thought they might be doubling and thus resulting in a conflict, but the exception remained be thrown.

Since I had a full stacktrace (see below), I went into the code and debugged the server and found out that in that particular named method (getFactory of FactoryManager), none of the necessary factories are registered in the variables used, so I went for the classloader used in that method, (it was one of the tomcatwebctx classloaders) and it seems like that particular classloader has no real registered classes.

Can somebody reproduce that problem or give any hints to resolve it?

If needed, I can provide further details of the issue.

Sincerely,

Christian Heike



java.lang.IllegalStateException: Die Anwendung wurde bei Systemstart nicht einwandfrei initialisiert, Factory konnte nicht gefunden werden: javax.faces.application.ApplicationFactory
        at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:800)
        at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:302)
        at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:104)
        at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:312)
        at org.jboss.web.jsf.integration.config.JBossJSFConfigureListener.contextDestroyed(JBossJSFConfigureListener.java:69)
        at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3949)
        at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4615)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4437)
        at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
        at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
        at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
        at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
        at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
        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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
        at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
        at $Proxy38.start(Unknown Source)
        at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
        at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
        at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
        at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
        at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
        at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
        at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
        at org.jboss.system.ServiceController.start(ServiceController.java:460)
        at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
        at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
        at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
        at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
        at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
        at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
        at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
        at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
        at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
        at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
thumbnail
Neil Griffin, modified 15 Years ago. Liferay Legend Posts: 2655 Join Date: 7/27/05 Recent Posts
The portlet's WEB-INF/web.xml contains the following markup which I thought would address this problem:


	<context-param>
		<param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
		<param-value>true</param-value>
	</context-param>


But I guess this isn't working...

The jsf-api.jar and jsf-impl.jar found in the jsf2-portlet (Job Application) contain a custom compiled version of Mojarra that has a fix for Mojarra issue#1604. See: https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1604

So my recommendation would be that you copy them from the portlet's WEB-INF/lib folder to the JBoss <server>/deploy/jbossweb.sar/jsflibs folder and give that a try.
thumbnail
Travis De Silva, modified 15 Years ago. New Member Posts: 11 Join Date: 3/21/10 Recent Posts
Hi,

After going through a bit of pain, I was able to get the example JSF2 Job application working with Liferay 6.0.2 (JBoss 5.1.0GA bundle)

As suggested by Neil, you need to copy the jsf-api.jar and jsf-impl.jar from the portlet's WEB-INF/lib folder to the JBoss <server>/deploy/jbossweb.sar/jsflibs folder

And then make sure to delete it from the portlet's WEB-INF/lib folder if not you get errors on startup.

In addition, I had to add the following to the portlet's web.xml

	<listener>
		<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
	</listener>


This was described in this article http://www.jroller.com/HazemBlog/entry/java_lang_illegalstateexception_application_was

With Liferay 6.0.2, you get an error with the opensocial-portlet.war. This is fixed in version 6.0.3. So I tried the JSF2 Job application on Liferay 6.0.3 and everything starts up properly but when I add the JSF2 portlet to a page, it just hangs (the loading image gets into a never ending loop) and on the console I get the following log message

21:17:40,784 DEBUG [BridgeImpl:196] doFacesRequest(renderRequest, renderResponse) this=[BridgeImpl.java@1410757]
21:17:40,784 DEBUG [BridgeImpl:196] doFacesRequest(renderRequest, renderResponse) this=[BridgeImpl.java@1410757]


I think Liferay 6.0.3 has a lot of issues based on comments in the Liferay forums. So maybe we should get this working on 6.0.4. I think Neil and his team are working hard on this as there seem to be some other issues when you add ICEfaces libs.

Hope the above helps someone.

Travis