Forums de discussion

Liferay 7 JSF Portlet

thumbnail
Kim Anna Kunc, modifié il y a 7 années.

Liferay 7 JSF Portlet

Junior Member Publications: 37 Date d'inscription: 18/02/09 Publications récentes
Hi all,
after three days of trying I finally managed to deploy a simple JSF portlet on Liferay 7.

I generated my portlet using the archetype as shown here:
https://liferayfaces.org/web/guest/home
I added a bnd.bnd file and using Gradle to build the war file I was able to deploy the .war archive on the server.

All my other attempts to deploy a maven generated .war file failed going through the WAB generator.
With either "java.lang.NoClassDefFoundError (Caused by: java.lang.ClassNotFoundException: javax.faces.FacesException)"
or other errors reading the manifest files of the jar files included in the war.

Is maven no longer supported with Liferay 7 ?

I'm using Standard JSF 2.2 and Liferay EE 7.0.10ga1.

Best Regards,
Kim
thumbnail
Neil Griffin, modifié il y a 7 années.

RE: Liferay 7 JSF Portlet

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

You did the right thing my starting with one of our archetypes found on the liferayfaces.org home page.

Maven and Gradle are equally supported. You can choose either one you want.

However, I would recommend that you do not add a bnd.bnd file, and that you do not use anything like the bnd-maven-plugin to build your war. Instead, simply use the defaults of the build system to build the war file.

If you need to add some BND related instructions, add them to the WEB-INF/lib/liferay-plugin-package.properties file. Here is an example for you to follow.

Kind Regards,

Neil
thumbnail
Kim Anna Kunc, modifié il y a 7 années.

RE: Liferay 7 JSF Portlet

Junior Member Publications: 37 Date d'inscription: 18/02/09 Publications récentes
Hi Neill,
thanks for answering my post.
You say Maven and Gradle builds are equally supported.
But a maven built .war file (created with the archetype and the exact pom as listed on your website) simply does not deploy on the server.
I can work with the Gradle build for now but it would be nicer to have it working with Maven as this is our company build framework.
Kind regards,
Kim
thumbnail
Juan Gonzalez, modifié il y a 7 années.

RE: Liferay 7 JSF Portlet

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

Please, can you post what is your Liferay DXP patch level? There were some problems in the first versions of DXP concerning Java EE/JSF webapps.

Additionally, can you tell which webapp server are you using?

Thanks.
thumbnail
Kim Anna Kunc, modifié il y a 7 années.

RE: Liferay 7 JSF Portlet

Junior Member Publications: 37 Date d'inscription: 18/02/09 Publications récentes
Juan Gonzalez:
Hi Kim.

Please, can you post what is your Liferay DXP patch level? There were some problems in the first versions of DXP concerning Java EE/JSF webapps.

Additionally, can you tell which webapp server are you using?

Thanks.


Hi Juan,

so I'm using Tomcat 8.0.32 and Liferay DXP 7.0.10ga1 Version
with liferay-fix-pack-de-10-7010 patched via patching-tool.

Best,
Kim
thumbnail
Neil Griffin, modifié il y a 7 années.

RE: Liferay 7 JSF Portlet

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

I'll let Juan comment about the DXP patch level that you specified.

But I wanted to mention that the resulting WAR artifact should be identical, whether you build your portlet with Maven or Gradle.

The entire Liferay Faces project (including our WAR demos) is built with Maven and we provide the Maven archetypes at liferayfaces.org in order to facilitate Maven-based projects.

When you get an opportunity, let us know what error(s) you see when you deploy the Maven version of your portlet project.

Also, I recommend that you download com.liferay.faces.demo.jsf.applicant.portlet-4.0.0.war and try it in your environment. Let us know if it deploys OK for you.

Kind Regards,

Neil
thumbnail
Kim Kunc, modifié il y a 7 années.

RE: Liferay 7 JSF Portlet

Junior Member Publications: 37 Date d'inscription: 18/02/09 Publications récentes
Neil Griffin:
Hi Kim,

When you get an opportunity, let us know what error(s) you see when you deploy the Maven version of your portlet project.

Also, I recommend that you download com.liferay.faces.demo.jsf.applicant.portlet-4.0.0.war and try it in your environment. Let us know if it deploys OK for you.



Hi Neill,
Thank you for the file!

I deployed com.liferay.faces.demo.jsf.applicant.portlet-4.0.0.war to my server and it produces the same errors as my own maven built jsf portlet.
"Unable to load manifest for javax.faces-2.2.13"

I attached the full stack trace.

Pièces jointes:

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

RE: Liferay 7 JSF Portlet

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

Thanks for posting the stacktrace.

I just downloaded liferay-dxp-digital-enterprise-tomcat-7.0-sp1-20161027112321352.zip from the customer portal and was able to deploy com.liferay.faces.demo.jsf.applicant.portlet-4.0.0.war from maven central without any errors.

When you get an opportunity, please download that version of Liferay DXP and let us know if it works in your environment.

Thanks again,

Neil
thumbnail
Kim Kunc, modifié il y a 7 années.

RE: Liferay 7 JSF Portlet

Junior Member Publications: 37 Date d'inscription: 18/02/09 Publications récentes
Neil Griffin:

When you get an opportunity, please download that version of Liferay DXP and let us know if it works in your environment.


I believe you emoticon
Unfortunately I can't change our production environment for now.
thumbnail
Neil Griffin, modifié il y a 7 années.

RE: Liferay 7 JSF Portlet

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

OK, it might be that you are using an older version of Liferay DXP that has a deployment problem. Perhaps you can upgrade your production environment in the future.

Regardless, the resulting WAR artifact should be almost identical, whether you build your portlet with Maven or Gradle. If you have time, perhaps you could run "jar tvf" on the WAR artifacts that are built by Maven and Gradle to see if there are any significant differences.

Thanks,

Neil
thumbnail
Juan Gonzalez, modifié il y a 7 années.

RE: Liferay 7 JSF Portlet

Liferay Legend Publications: 3089 Date d'inscription: 28/10/08 Publications récentes
Kim Kunc:
Neil Griffin:
Hi Kim,

When you get an opportunity, let us know what error(s) you see when you deploy the Maven version of your portlet project.

Also, I recommend that you download com.liferay.faces.demo.jsf.applicant.portlet-4.0.0.war and try it in your environment. Let us know if it deploys OK for you.



Hi Neill,
Thank you for the file!

I deployed com.liferay.faces.demo.jsf.applicant.portlet-4.0.0.war to my server and it produces the same errors as my own maven built jsf portlet.
"Unable to load manifest for javax.faces-2.2.13"

I attached the full stack trace.


Seems you are using some weird javax.faces-2.2.13 jar file, seems somehow corrupt. Where did you get it? Can you upload here so we can check?

Thanks!
thumbnail
Kim Kunc, modifié il y a 7 années.

RE: Liferay 7 JSF Portlet

Junior Member Publications: 37 Date d'inscription: 18/02/09 Publications récentes
Juan Gonzalez:


Seems you are using some weird javax.faces-2.2.13 jar file, seems somehow corrupt. Where did you get it? Can you upload here so we can check?

Thanks!


Hi Juan,
my javax.faces-2-2.13.jar came from maven.central and you're right it is corrupted.
I'm not sure why my gradle build worked for a while.

Today I deleted my local maven repository and installed javax.faces.2.2 jar manually from maven central and both my builds (Gradle and Maven)
were definitely broken. I got the same error (invalid LOC Header).

I have now switched to the glassfish version 2.2.14 (compile group: 'org.glassfish', name: 'javax.faces', version: '2.2.14')
and my build works again.

Thanks for your help Juan and Neill!
thumbnail
Neil Griffin, modifié il y a 7 années.

RE: Liferay 7 JSF Portlet

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

I'm glad that you identified the problem with the corrupted jar file.

Thanks for using Liferay Faces!

Neil