0

i need to change the default jsf impl provided with glassfish 3.0.1 The one provided is version 2.0.2 but i need something higher like 2.1.x because i use liferay portal 6.0.6 and it throws exception while trying to cast ResourceResponseImpl to HttpServletResponse. I got a tip that if i change the jsf impl to 2.1.x it should work. Anyway, i just want to make sure i do it right.. Should i change only the jsf-impl and jsf-api jars or do something else as well. There is two jars that i am not sure if i should change, that is jsftemplating and jsf-connector..

Thanks

stefo0O0o
  • 119
  • 1
  • 11
  • Anyway the jsf-impl and jsf-api are located in modules folder inside glassfish. I tried just to swap the impl and api with with newer versions (version 2.1.3.b02) but then i get exception that my beans are null.. so i assume there is something more to be done except just swapping the jars. I have big doubts about the jsftemplating and jsf-connector jars because i think there are newer versions for those as well, the ones used in 3.0.1 are (jsf-connector 3.1.2, jsftemplating couldn't find the version in the manifest) thanks! – stefo0O0o Feb 13 '13 at 08:59

1 Answers1

1

You can package the desired jsf implementation with your application. You need to add the following to lines to your glassfish-web.xml:

<class-loader delegate="false" />
<property name="useBundledJsf" value="true" />


You can alternativly update the jsf implementation shipped with glassfish. You need to delete (or backup somewhere) the files jsf-api.jar and jsf-impl.jar from glassfish3\glassfish\modules\and place the new jsf implementation, e.g. the latest binary version from javaserverfaces.java.net there.

unwichtich
  • 13,712
  • 4
  • 53
  • 66
  • i tried to just copy and paste the 2.1.3 jsf api and impl but then i get error messages that my beans are null. Target unreachable 'userBean' is null, something like this i get..I don't know why this happens but it seems that the faces servlet is not fired to scan the app classpath and can't instantiate the beans, so when the jsf is rendered they are null.. hmm? – stefo0O0o Feb 13 '13 at 13:01
  • This error should not be caused by updating the JSF implementation...there is probably something wrong in your code or configuration. – unwichtich Feb 13 '13 at 13:45
  • Hmm, i think it might be my config. I see faces-config.xml has version=2.0 and the schema is for 2.0 Can this cause the impl to ignore the faces-config.xml? – stefo0O0o Feb 13 '13 at 14:28
  • I changed the faces-config.xml to 2.1 (actually generated it with eclipse so i can't be wrong here) but still it's not working, my beans are null.. When i swap back the old jsf impl and api the app works ok, but the problem is with the ajax, which can't work on jsf prior 2.1 so i must use 2.1 and the server has provided 2.0 which is not what i want.. – stefo0O0o Feb 13 '13 at 14:45
  • i managed to get it working, it seems that #{userBean.userName} is not working, but #{userBean} is working, but i hell i don't know how it figures out the property.. (i have one property in the bean tough) – stefo0O0o Feb 13 '13 at 14:57
  • Now i get strange stuff going on, i noted that jsf is not using the bean at all, it seems that when first it encounters a variable with the given name it uses some kind of variable or map that puts the values and the in the output retrieves the same value this is the form: As you can see it first encounters the userBean where the input form is... – stefo0O0o Feb 13 '13 at 15:08
  • the it uses the same variable to get the value that it put above – stefo0O0o Feb 13 '13 at 15:09
  • I assume that the FacesServlet is not being invoked and thus the faces-config.xml is not scanned at all.. What could be the cause of this? (i mapped the servlet on / so the config. is not wrong) I am using jsf in liferay with portlets just for reminder... – stefo0O0o Feb 13 '13 at 15:48
  • i fixed it, what i did was download newest version of glassfish (3.1.2.2) and downloaded the liferay-6.0.6 bundled with glassfish.. then i removed the server that was provided and replaced it with the new server, i added the jars in the lib of domans/domain1 from the old glassfish and woala it works! :) – stefo0O0o Feb 14 '13 at 14:25
  • but still i need to figure out how to use the old server since it is not allowable to change the server, there are about 32 servers (live, dev, test, etc) so i can't just go an swap servers, the risk of failure afterwards is unpredictable.. – stefo0O0o Feb 14 '13 at 14:55
  • anyway i can remove jsf impl and api completely from the server? i tried but it brokes the server and wont start it after i remove the jars.. – stefo0O0o Feb 14 '13 at 14:55