Vue combinée Vue Plate Arborescence
Sujets [ Précédent | Suivant ]
toggle
Bernd Prager
Deploying JSF on WebLogic wiki
8 octobre 2013 13:48
Réponse

Bernd Prager

Rang: Junior Member

Publications: 40

Date d'inscription: 20 décembre 2012

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
Kyle Joseph Stiemann
RE: Deploying JSF on WebLogic wiki
8 octobre 2013 14:10
Réponse

Kyle Joseph Stiemann

LIFERAY STAFF

Rang: Regular Member

Publications: 128

Date d'inscription: 14 janvier 2013

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
Vernon Singleton
RE: Deploying JSF on WebLogic wiki
8 octobre 2013 14:16
Réponse

Vernon Singleton

LIFERAY STAFF

Rang: Regular Member

Publications: 172

Date d'inscription: 14 janvier 2013

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
Vernon Singleton
RE: Deploying JSF on WebLogic wiki
8 octobre 2013 14:22
Réponse

Vernon Singleton

LIFERAY STAFF

Rang: Regular Member

Publications: 172

Date d'inscription: 14 janvier 2013

Publications Récentes

Kyle Joseph Stiemann:
Please follow these instructions ...

Aww, you beat me to it.

.
Bernd Prager
RE: Deploying JSF on WebLogic wiki
10 octobre 2013 12:44
Réponse

Bernd Prager

Rang: Junior Member

Publications: 40

Date d'inscription: 20 décembre 2012

Publications Récentes

Gentlemen,

I went successfully through all steps explained in the wiki.

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

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

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.
Juan Gonzalez
RE: Deploying JSF on WebLogic wiki
10 octobre 2013 23:32
Réponse

Juan Gonzalez

LIFERAY STAFF

Rang: Liferay Legend

Publications: 1931

Date d'inscription: 28 octobre 2008

Publications Récentes

Hi Bern,

seems you are using JSF 2.2.

For that Liferay Faces version, you should use JSF 2.1 instead.
Bernd Prager
RE: Deploying JSF on WebLogic wiki
11 octobre 2013 06:35
Réponse

Bernd Prager

Rang: Junior Member

Publications: 40

Date d'inscription: 20 décembre 2012

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:
 1
 2[INFO] Compiling 8 source files to C:\bin\cygwin\home\bernd_prager\Projects\liferay-faces\demos\bridge\jsf2-cdi-portlet\target\classes
 3[INFO] -------------------------------------------------------------
 4[ERROR] COMPILATION ERROR :
 5[INFO] -------------------------------------------------------------
 6[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
 7  symbol:   class ViewScoped
 8  location: package javax.faces.view
 9[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
10  symbol: class ViewScoped
11[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
12  symbol:   class ViewScoped
13  location: package javax.faces.view
14[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
15  symbol: class ViewScoped
16[INFO] 4 errors
Juan Gonzalez
RE: Deploying JSF on WebLogic wiki
11 octobre 2013 06:50
Réponse

Juan Gonzalez

LIFERAY STAFF

Rang: Liferay Legend

Publications: 1931

Date d'inscription: 28 octobre 2008

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.
Neil Griffin
RE: Deploying JSF on WebLogic wiki
11 octobre 2013 11:26
Réponse

Neil Griffin

LIFERAY STAFF

Rang: Liferay Legend

Publications: 2097

Date d'inscription: 26 juillet 2005

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
Bernd Prager
RE: Deploying JSF on WebLogic wiki
11 octobre 2013 14:01
Réponse

Bernd Prager

Rang: Junior Member

Publications: 40

Date d'inscription: 20 décembre 2012

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
Bernd Prager
RE: Deploying JSF on WebLogic wiki
11 octobre 2013 18:08
Réponse

Bernd Prager

Rang: Junior Member

Publications: 40

Date d'inscription: 20 décembre 2012

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?
Neil Griffin
RE: Deploying JSF on WebLogic wiki
14 octobre 2013 12:54
Réponse

Neil Griffin

LIFERAY STAFF

Rang: Liferay Legend

Publications: 2097

Date d'inscription: 26 juillet 2005

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
Bernd Prager
RE: Deploying JSF on WebLogic wiki
14 octobre 2013 14:39
Réponse

Bernd Prager

Rang: Junior Member

Publications: 40

Date d'inscription: 20 décembre 2012

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
 116:16:28,559 ERROR [[STANDBY] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'][BasePortalLifecycle:34] java.lang.NullPointerException
 2java.lang.NullPointerException
 3        at com.liferay.portal.kernel.deploy.hot.HotDeployEvent.initDependentServletContextNames(HotDeployEvent.java:93)
 4        at com.liferay.portal.kernel.deploy.hot.HotDeployEvent.<init>(HotDeployEvent.java:53)
 5        at com.liferay.portal.kernel.deploy.hot.HotDeployEvent.<init>(HotDeployEvent.java:41)
 6        at com.liferay.portal.kernel.servlet.PluginContextListener.fireva.lang.NullPointerException
 7        at com.liferay.portal.kernel.deploy.hot.HotDeployEvent.initDependentServletContextNames(HotDeployEvent.java:93)
 8        at com.liferay.portal.kernel.deploy.hot.HotDeployEvent.<init>(HotDeployEvent.java:53)
 9        at com.liferay.portal.kernel.deploy.hot.HotDeployEvent.<init>(HotDeployEvent.java:41)
10        at com.liferay.portal.kernel.servlet.PluginContextListener.fireUndeployEvent(PluginContextListener.java:170)
11        at com.liferay.portal.kernel.servlet.PluginContextListener.doPortalDestroy(PluginContextListener.java:132)UndeployEvent(PluginContextListener.java:170)
12        at com.liferay.portal.kernel.servlet.PluginContextListener.doPortalDestroy(PluginContextListener.java:132)


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.