Forums de discussion

Big trouble with JSF2 CDI Portlet Example

Adi Schlemm, modifié il y a 10 années.

Big trouble with JSF2 CDI Portlet Example

New Member Publications: 16 Date d'inscription: 17/01/14 Publications récentes
Hi
I'm running jboss-EAP 6.2 with Liferay-Portal 6.2.
If i deploy the Demo JSF2 CDI Portlet (3.1.3-ga4 (Liferay 6.1.x))
i got the following 2 errors.
- First com.sun.faces.config.Configurelistener already configured for this context, but the Demo has
no call in it's config-files for com.sun.faces.config.Configurelistener.
- Second, an IllegalArgumentException occurs for WELD with the message: cannot pass null expressionFactory
What is wrong there?
thumbnail
Neil Griffin, modifié il y a 10 années.

RE: Big trouble with JSF2 CDI Portlet Example

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Until we have our 3.2 release in production, you will need to Build Liferay Faces From Source but with "git checkout 3.2.x"

In order to build the jsf2-cdi-portlet for use with JBoss, do this:

cd liferay-faces/demos/bridge/jsf2-cdi-portlet
mvn -P jboss clean install
Adi Schlemm, modifié il y a 10 années.

RE: Big trouble with JSF2 CDI Portlet Example

New Member Publications: 16 Date d'inscription: 17/01/14 Publications récentes
Hi Neil

I have in the moment no maven.
Do you mean i must compile the sources new?

I use my liferay as a war (runs correct, not ROOT context ).
Must i use for all demos a jboss-web.xml?
My deploying shows no errors, but i can not set a context where the
demo can run.
In the jboss-web.xml it is set to
<jboss-web>
<context-root>/all</context-root>
</jboss-web>


but under http://localhost:8080/all there is nothing.

(Use JBOSS-EAP-6.2, Liferay-Portal-6.2 (as war) and java 1.7.0_45)
thumbnail
Neil Griffin, modifié il y a 10 années.

RE: Big trouble with JSF2 CDI Portlet Example

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
The Liferay Faces project is built with Maven, and we use Maven Profiles in order to build portlet WARs for different servers.

So in order to build a version of the jsf2-cdi-portlet for JBoss, you would need to build it with the "-P jboss" option on the mvn command line.

We provide demos like the jsf2-cdi-portlet in order to help you know what files and/or descriptors are necessary in order to make a portlet work properly.
Adi Schlemm, modifié il y a 10 années.

RE: Big trouble with JSF2 CDI Portlet Example

New Member Publications: 16 Date d'inscription: 17/01/14 Publications récentes
Thanks for your hints.

The liferay example has 2 jsf-jars and one weld-jar.
Conflicts that not with jboss jsf-and-weld jars?
thumbnail
Neil Griffin, modifié il y a 10 années.

RE: Big trouble with JSF2 CDI Portlet Example

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
If you build the jsf2-cdi-portlet from source with "mvn clean package -P jboss" then the two Mojarra/JSF jars and the weld jar should not appear in the WAR under the target/ folder. Those dependencies are provided by JBoss. For more details, please read the Developing JSF Portlets with CDI wiki article and make sure that you upgrade both Mojarra and Weld in JBoss.
Adi Schlemm, modifié il y a 10 années.

RE: Big trouble with JSF2 CDI Portlet Example

New Member Publications: 16 Date d'inscription: 17/01/14 Publications récentes
Thanks for your help
Adi Schlemm, modifié il y a 10 années.

RE: Big trouble with JSF2 CDI Portlet Example

New Member Publications: 16 Date d'inscription: 17/01/14 Publications récentes
Now it looks better, but ich think in faces-config.xml for the CDI-faces example
there was references to a message bundle "i18nFaces" and
resource bundle "i18n" what is not in the example.
Is there something what i need, what is not in the Example?
Also the taglib "http://liferay.com/faces/aui" is not matching for the
example. Is this a new taglib?
My Portlet looks not good für pime faces (see attachment).
What can it be?

Pièces jointes:

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

RE: Big trouble with JSF2 CDI Portlet Example

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

The jsf2-cdi-portlet/src/main/webapp/WEB-INF/faces-config.xml descriptor mentions both i18n and i18nFaces. Those files are provided here, but only for the default language (English in this demo):

Also, thanks for the screenshot -- I do have one concern though. It shows "Weld Servlet (Uber Jar) 1.1.10.Final" which means that WEB-INF/lib/weld-servlet.jar is probably in your deployed WAR. That jar shouldn't be there when deploying on JBoss. It's only necessary for servlet containers like Tomcat and Jetty.

Kind Regards,

Neil
Adi Schlemm, modifié il y a 10 années.

RE: Big trouble with JSF2 CDI Portlet Example

New Member Publications: 16 Date d'inscription: 17/01/14 Publications récentes
Hi Neil

Thanks for your help, I have added the property-files.
Jboss has its own weld classes, so i have not deployed some weld stuff.
But i must change the weld to version 1.1.10 in jboss, the original delivered weld classes
from jboss does not correct run with this example.
Now the example looks better, but can't see the prime faces working.

My deployed jar's are:

cdi-portlet-bridge-shared-6.2.0.1.jar
commons-fileupload-1.2.2.jar
commons-io-1.3.2.jar
jboss-el-2.0.0.GA.jar
liferay-faces-alloy-3.1.3-ga4.jar
liferay-faces-bridge-api-3.1.3-ga4.jar
liferay-faces-bridge-impl-3.1.3-ga4.jar
liferay-faces-util-3.1.3-ga4.jar
primefaces-3.5.jar
thumbnail
Neil Griffin, modifié il y a 10 années.

RE: Big trouble with JSF2 CDI Portlet Example

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

The deployed jars in WEB-INF/lib look correct, except that the following:

cdi-portlet-bridge-shared-6.2.0.1.jar

Should be upgraded to:

cdi-portlet-bridge-shared-6.2.0.2.jar

Please provide more detail of what you mean by:
but can't see the prime faces working.


Do you see any error messages in the web page or in the JBoss Log?

Neil
Adi Schlemm, modifié il y a 10 années.

RE: Big trouble with JSF2 CDI Portlet Example

New Member Publications: 16 Date d'inscription: 17/01/14 Publications récentes
Hi Neil

In my portlet i can't see the look and feel from prime faces.
I mean the prime faces components are not visible in my example, button's an so...
The attachment looks very better.

Where i can find the cdi-portlet-bridge-shared-6.2.0.2.jar ?

Adi

Pièces jointes:

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

RE: Big trouble with JSF2 CDI Portlet Example

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
You can specify version 6.2.0.2 by changing the value of the <version> element in the pom.xml descriptor of the project. The jar is available in Maven Central.

Regarding what you wrote:
prime faces components are not visible in my example


Have you changed any of the standard JSF component tags (using the h: namespace prefix) in the view to use the PrimeFaces p: namespace prefix?
Adi Schlemm, modifié il y a 10 années.

RE: Big trouble with JSF2 CDI Portlet Example

New Member Publications: 16 Date d'inscription: 17/01/14 Publications récentes
Hi Neil

Awfulemoticon, it works. Thanks!

Adi
thumbnail
Neil Griffin, modifié il y a 10 années.

RE: Big trouble with JSF2 CDI Portlet Example

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
I'm glad to hear that it is working now. Thanks for using Liferay Faces emoticon