6

I downloaded binary which has javax.faces-2.1.13 as the latest binary release. I want to upgrade my GlassFish JSF library but it has jsf-api-jar and other impl. How do I update and where do I download the jars?

Tiny
  • 27,221
  • 105
  • 339
  • 599
kinkajou
  • 3,664
  • 25
  • 75
  • 128

2 Answers2

11

Just replace both jsf-api.jar and jsf-impl.jar in the Glassfish /modules folder by the single javax.faces.jar file.

Since Mojarra 2.1.6 the build system has been changed to comply Java EE Maven rules, see also issue 2028. This resulted in the API and impl being merged into a single JAR file.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Should I delete those jar in Glassfish and add javax.faces.jar ? That's it not configuration? – kinkajou Oct 09 '12 at 11:04
  • Surely. You don't want to have the older version hanging around conflicting the newer version, right? If you don't have full admin control over the server, then an alternative is to place the new JAR in webapp's own `/WEB-INF/lib` and configure `/WEB-INF/glassfish-web.xml` file to tell Glassfish to use it instead. – BalusC Oct 09 '12 at 11:05
  • what about jsftemplating and jsfconnector? – kinkajou Oct 09 '12 at 11:07
  • They are not part of standard JSF. As answered, just replace the API/impl JAR files by the single new JAR file. Please do it and report any problems instead of continuing asking irrelevant questions before ever having performed the upgrade. – BalusC Oct 09 '12 at 11:10
  • I did that now IDE shows error that like FacesContext is not present. import javax.faces.application.FacesMessage; has failed – kinkajou Oct 09 '12 at 11:14
  • In the future please tell that directly. As to the problem, have you rebuilt the project and retargeted the server? – BalusC Oct 09 '12 at 11:18
  • I can't built the project as it shows error.. retargeted the server means? – kinkajou Oct 09 '12 at 11:21
  • Sorry, this is beyond me. Try restarting the IDE. Try removing/adding the server in the IDE. Try removing/adding the server in the web project. – BalusC Oct 09 '12 at 11:25
  • I also had this problem with NetBeans7.1. Removing/adding the server did not help. I had deleted both osgi-cache and NetBeans ~/.netbeans/7.1/var/cache (on Mac OS X). NetBeans7.1 stubbornly refuses to show javax.faces.jar under the Glassfish server libs and I still get import errors. – Webel IT Australia - upvoter May 24 '13 at 03:24
  • Related/(near duplicate) http://stackoverflow.com/questions/16715314/jsf-how-upgrade-to-mojarra-2-1-21-in-netbeans7-1-just-sub-jsf-api-jar-and-jsf-i – Webel IT Australia - upvoter May 24 '13 at 04:04
  • Thought I had found the solution here https://weblogs.java.net/blog/edburns/archive/2011/09/26/try-out-mojarra-220-snapshot?force=714, says replace references to jsf-api.jar and jsf-impl.jar with javax.faces.jar in /domain/domain1/config/default-web.xml and /lib/templates/default-web.xml, but after multiple cache cleans, restart, remove/add server in Netbeans7.1 it sill does not see javax.faces.jar – Webel IT Australia - upvoter May 25 '13 at 03:02
0

if you having some issues after replacing faces files in glassfish/modules folder, like non-compatibility of you framework version with jsf 2.2,2.3 and etc (for example "icefaces 4.1.1 error 200 during update: javax.faces.viewstate not found") or some unexpected behaviour - dont forget to clean glassfish/domains/somedomain/osgi-cache

rustem.russia
  • 575
  • 5
  • 6