Forums de discussion

Deploying JSF on WebLogic wiki

thumbnail
Bernd Prager, modifié il y a 10 années.

Deploying JSF on WebLogic wiki

Junior Member Publications: 42 Date d'inscription: 20/12/12 Publications récentes
Quick questions:

I am trying to follow the instructions on how to deploy JSF Porlets in WebLogic as described in the wiki here.

The folder layout in weblogic-10.3.6.0/lib shows a Mojarra jsf-api.jar but not a jsf-impl jar. The article also states:
jsf-api.jar and jsf-impl.jar must not be included in WEB-INF/lib

So where do I put the jsf-impl.jar?

Thank you,
-- Bernd
thumbnail
Kyle Joseph Stiemann, modifié il y a 10 années.

RE: Deploying JSF on WebLogic wiki

Liferay Master Publications: 760 Date d'inscription: 14/01/13 Publications récentes
Hi Bernd,
Please follow these instructions on upgrading mojarra in weblogic. The wiki explains how to install the jsf-shared-library.war, which contains the jsf-impl.jar.

- Kyle
thumbnail
Vernon Singleton, modifié il y a 10 années.

RE: Deploying JSF on WebLogic wiki

Expert Publications: 315 Date d'inscription: 14/01/13 Publications récentes
Kyle Joseph Stiemann:
Please follow these instructions ...

Aww, you beat me to it.

.
thumbnail
Vernon Singleton, modifié il y a 10 années.

RE: Deploying JSF on WebLogic wiki

Expert Publications: 315 Date d'inscription: 14/01/13 Publications récentes
Bernd Prager:
Quick questions:

I am trying to follow the instructions on how to deploy JSF Porlets in WebLogic as described in the wiki here.

The folder layout in weblogic-10.3.6.0/lib shows a Mojarra jsf-api.jar but not a jsf-impl jar. The article also states:
jsf-api.jar and jsf-impl.jar must not be included in WEB-INF/lib

So where do I put the jsf-impl.jar?

Thank you,
-- Bernd


Welcome to the land of WebLogic. You will notice that there is a section on the page you referenced called "Mojarra JSF API and Implementation" which points you to another set of instructions for Upgrading Mojarra in Oracle WebLogic, which in turn points to another set of instructions used for Building Liferay Faces from Source.

Turns out when you build Liferay Faces from source in accord with those instructions, a WebLogic shared library war is also prepared for you, which can then be installed using the WebLogic Console ... the Upgrading Mojarra page states "Mojarra must be installed as a Shared Library WAR via the WebLogic Console". Mojarra includes the jsf-impl, in case you were wondering where the actual impl is in all these instructions. I heard someone put it this way, "WebLogic provides this feature for you".

Hope that helps,
Vernon Singleton
Liferay Faces Team
thumbnail
Bernd Prager, modifié il y a 10 années.

RE: Deploying JSF on WebLogic wiki

Junior Member Publications: 42 Date d'inscription: 20/12/12 Publications récentes
Gentlemen,

I went successfully through all steps explained in the wiki.

During deployment I am getting now:
INFO: Initializing Mojarra 2.2.4 ( 20131003-1354 https://svn.java.net/svn/mojarra~svn/tags/2.2.4@12574) for context '/jsf-test'
Oct 10, 2013 2:16:17 PM com.liferay.faces.servers.weblogic.InjectionProviderWebLogicImpl <init>
INFO: Wrapping InjectionProvider=com.bea.faces.WeblogicInjectionProvider@50a80e9d
Oct 10, 2013 2:16:17 PM com.sun.faces.config.ConfigureListener contextInitialized
SEVERE: Critical error during deployment:
java.lang.NoClassDefFoundError: com/sun/faces/spi/InjectionProvider
        at javax.faces.FactoryFinder$FactoryManager.copyInjectionProviderFromFacesContext(FactoryFinder.java:1051)
        at javax.faces.FactoryFinder$FactoryManager.<init>(FactoryFinder.java:1035)
        at javax.faces.FactoryFinder$FactoryManagerCache.getApplicationFactoryManager(FactoryFinder.java:856)
        at javax.faces.FactoryFinder$FactoryManagerCache.getApplicationFactoryManager(FactoryFinder.java:793)
        at javax.faces.FactoryFinder$FactoryManagerCache.access$100(FactoryFinder.java:768)
        at javax.faces.FactoryFinder.setFactory(FactoryFinder.java:409)</init></init>

Next steps (I thought) was to provide jsf-spi with my war file. That didn't go well either:
INFO: Initializing Mojarra 2.2.4 ( 20131003-1354 https://svn.java.net/svn/mojarra~svn/tags/2.2.4@12574) for context '/jsf-test'
Oct 10, 2013 3:31:20 PM com.sun.faces.config.ConfigureListener contextInitialized
SEVERE: Critical error during deployment:
java.lang.ExceptionInInitializerError
        at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361)
        at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:214)
        at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
..
Caused By: java.lang.NullPointerException
        at com.sun.faces.spi.InjectionProviderFactory.<clinit>(InjectionProviderFactory.java)
        at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361)
        at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:214)
        at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
 </clinit>

Beyond jsf-api 2.2.4 as explained in the wiki I am using liferay-faces-bridge 3.1.3-ga4.
What do I need to do?
Any help would be greatly appreciated.
thumbnail
Juan Gonzalez, modifié il y a 10 années.

RE: Deploying JSF on WebLogic wiki

Liferay Legend Publications: 3089 Date d'inscription: 28/10/08 Publications récentes
Hi Bern,

seems you are using JSF 2.2.

For that Liferay Faces version, you should use JSF 2.1 instead.
thumbnail
Bernd Prager, modifié il y a 10 années.

RE: Deploying JSF on WebLogic wiki

Junior Member Publications: 42 Date d'inscription: 20/12/12 Publications récentes
I changed the pom.xml of liferay-faces to compile with JSF 2.1: <mojarra.version>2.1.26</mojarra.version>

Maven now fails with:

[INFO] Compiling 8 source files to C:\bin\cygwin\home\bernd_prager\Projects\liferay-faces\demos\bridge\jsf2-cdi-portlet\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/bin/cygwin/home/bernd_prager/Projects/liferay-faces/demos/bridge/jsf2-cdi-portlet/src/main/java/com/liferay/faces/demos/bean/ApplicantViewBean.java:[19,24] cannot find symbol
  symbol:   class ViewScoped
  location: package javax.faces.view
[ERROR] /C:/bin/cygwin/home/bernd_prager/Projects/liferay-faces/demos/bridge/jsf2-cdi-portlet/src/main/java/com/liferay/faces/demos/bean/ApplicantViewBean.java:[27,2] cannot find symbol
  symbol: class ViewScoped
[ERROR] /C:/bin/cygwin/home/bernd_prager/Projects/liferay-faces/demos/bridge/jsf2-cdi-portlet/src/main/java/com/liferay/faces/demos/bean/ApplicantModelBean.java:[21,24] cannot find symbol
  symbol:   class ViewScoped
  location: package javax.faces.view
[ERROR] /C:/bin/cygwin/home/bernd_prager/Projects/liferay-faces/demos/bridge/jsf2-cdi-portlet/src/main/java/com/liferay/faces/demos/bean/ApplicantModelBean.java:[34,2] cannot find symbol
  symbol: class ViewScoped
[INFO] 4 errors
thumbnail
Juan Gonzalez, modifié il y a 10 années.

RE: Deploying JSF on WebLogic wiki

Liferay Legend Publications: 3089 Date d'inscription: 28/10/08 Publications récentes
Hi Bernd,

seems you changed the pom.xml and/or ApplicantBackingBean from the cdi demo portlet.

Can you reset all your changes? That should work and will let you start with a good starting point.

Probably you cloned/downloaded the wrong liferay-faces branch/version for your target Liferay version.
thumbnail
Neil Griffin, modifié il y a 10 années.

RE: Deploying JSF on WebLogic wiki

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Hi Bernd,

I think Juan is right. You probably need to "git checkout 3.1.x" (Liferay 6.1) or "git checkout 3.2.x" (Liferay 6.2) at the command line and then try "mvn clean install" again.

Neil
thumbnail
Bernd Prager, modifié il y a 10 années.

RE: Deploying JSF on WebLogic wiki

Junior Member Publications: 42 Date d'inscription: 20/12/12 Publications récentes
Juan, Neil,

Thank you. I might still be on the wrong path though.

I was successfully able to build and install the shared WebLogic libraries for JSF2.1.
I am still facing deployment issues (NPE from com.liferay.portal.kernel.deploy.hot.HotDeployEvent) and I believe the issue is somewhere else:

In order to deploy Liferay6.1 on WebLogic, JSF1.2 has to be installed as shared library first. (Also documented here.)
When I was deploying JSF 2.1 WebLogic complained that a library with name JSF already existed.
I boldly removed the JSF1.2 one and installed the JSF2.1 shared lib instead. In hindsight that was probably not a good idea.

I discovered the same exceptions when I was trying to re-install Liferay on top of the JSF2.1 lib. I will now try to find a way to have both JSF version co-exist. I will keep you posted.

Can you share how your configuration looks like?

Thank you,
-- Bernd
thumbnail
Bernd Prager, modifié il y a 10 années.

RE: Deploying JSF on WebLogic wiki

Junior Member Publications: 42 Date d'inscription: 20/12/12 Publications récentes
Reading the wiki all over again, I noticed it says:
please follow the instructions in the Liferay documentation
, which covers installing Liferay6.1 on WebLogic.
After that it mentions
However, you must skip the following sections:

(which talk about installing JSF 1.2 as shared library. The reason why is explained and it concludes:
this will not be necessary in Liferay 6.2
.
Now I am a little puzzled. Is this wiki actually implying the installation of Liferay 6.2?
thumbnail
Neil Griffin, modifié il y a 10 années.

RE: Deploying JSF on WebLogic wiki

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Hi Bernd,

In order to deploy Liferay6.1 on WebLogic, JSF 1.2 has to be installed as shared library first. (Also documented here.) When I was deploying JSF 2.1 WebLogic complained that a library with name JSF already existed. I boldly removed the JSF1.2 one and installed the JSF2.1 shared lib instead. In hindsight that was probably not a good idea. I discovered the same exceptions when I was trying to re-install Liferay on top of the JSF2.1 lib. I will now try to find a way to have both JSF version co-exist. I will keep you posted.


Liferay Portal 6.1 requires the JSF API (either JSF 1.2 or JSF 2.1) to be in the classpath, because unlike all other servers, WebLogic pro-actively tries to instantiate classes found in the util-taglib.jar!META-INF/liferay-faces.tld descriptor which contains references to JSF related classes like PhoneNumberConverterTag.java. Although the descriptor contains the name "liferay-faces" it actually pre-dates the current Liferay Faces project by many years. Those are legacy classes that no longer belong inside of util-taglib.jar.

Since Liferay Faces currently depends on JSF 2.1, the wiki article attempts to communicate that it is necessary to have the JSF 2.1 API in the classpath. This can be accomplished by simply copying jsf-api-2.1.jar into the weblogic/lib folder. Therefore you did the correct thing by removing the JSF 1.2 shared library that was accidentally installed.

Can you share how your configuration looks like?


The Liferay Faces team follows the steps in the wiki in the same manner (step by step) as you have in order to perform our testing on WebLogic.

Now I am a little puzzled. Is this wiki actually implying the installation of Liferay 6.2?


The Deploying JSF Portlets on Oracle WebLogic wiki article assumes that you are installing Liferay Portal 6.1 into WebLogic. The reason why the wiki article mentions LPS-34945 with respect to Liferay 6.2 was simply to provide assurance to the reader that things will be easier in the future, when Liferay 6.2 is released. Would you recommend that we delete that sentence, or fortify it in some way in order to avoid confusion?

Thanks,

Neil
thumbnail
Bernd Prager, modifié il y a 10 années.

RE: Deploying JSF on WebLogic wiki

Junior Member Publications: 42 Date d'inscription: 20/12/12 Publications récentes
Neil,

Thank you for clarification.

I am still not able to follow the instructions on the wiki page. Liferay won't start with JSF 2.1 in place.

I get
16:16:28,559 ERROR [[STANDBY] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'][BasePortalLifecycle:34] java.lang.NullPointerException
java.lang.NullPointerException
        at com.liferay.portal.kernel.deploy.hot.HotDeployEvent.initDependentServletContextNames(HotDeployEvent.java:93)
        at com.liferay.portal.kernel.deploy.hot.HotDeployEvent.<init>(HotDeployEvent.java:53)
        at com.liferay.portal.kernel.deploy.hot.HotDeployEvent.<init>(HotDeployEvent.java:41)
        at com.liferay.portal.kernel.servlet.PluginContextListener.fireva.lang.NullPointerException
        at com.liferay.portal.kernel.deploy.hot.HotDeployEvent.initDependentServletContextNames(HotDeployEvent.java:93)
        at com.liferay.portal.kernel.deploy.hot.HotDeployEvent.<init>(HotDeployEvent.java:53)
        at com.liferay.portal.kernel.deploy.hot.HotDeployEvent.<init>(HotDeployEvent.java:41)
        at com.liferay.portal.kernel.servlet.PluginContextListener.fireUndeployEvent(PluginContextListener.java:170)
        at com.liferay.portal.kernel.servlet.PluginContextListener.doPortalDestroy(PluginContextListener.java:132)UndeployEvent(PluginContextListener.java:170)
        at com.liferay.portal.kernel.servlet.PluginContextListener.doPortalDestroy(PluginContextListener.java:132)</init></init></init></init>


I had to rollback to JSF1.2 for now.

I won't have time prior to the Liferay Symposium to test this further but will continue after I come back.