Wednesday, April 28, 2010

WebLogic Server 10.3.3.0 released. It now has JSF 2.0 support!!


Believe it or not. Here it is. WebLogic Server finaly supports JSF 2.0 with it's latest release 10.3.3.0.
And here is the short howto:

- Download and install one of the latest Oracle WebLogic Server 11g Rel 1 (10.3.3) Installers from OTN. (Give the ZIP Installer a try. Aweseome lightweight!)
- Create a new sample domain (call it whatever you want) and start the admin server
- Open the administration console (http://localhost:7001/console/)
- deploy the JSF 2.0 library (Deployments - Install - wlserver_10.3\common\deployable-libraries\jsf-2.0.war
- Find your favorite JSF 2.0 sample (I'll take the guessNumber thing from the mojarra-2.0.2 distribution)
- Add a weblogic.xml file to the WEB-INF/ folder with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app>
<library-ref>
<library-name>jsf</library-name>
<specification-version>2.0</specification-version>
<implementation-version>1.0.0.0_2-0-2</implementation-version>
<exact-match>true</exact-match>
</library-ref>
</weblogic-web-app>

- Package the guessNumber app
- Deploy the app to the WebLogic server
- give it a try: http://localhost:7001/guessNumber


As you can see, the new JSF 2.0 features are available :) great work!
And the best of all, this is not even explicitly mentioned in the "what's new documentation for WLS" :) A single line indicates JSF support for 2.0, 1.2, 1.1.

5 Comments:

imran raza khan said...

Hi,

How we can use JSF2.0 on weblogic 10.3.0?

Regards,
imran

myfear said...

Hi imran raza khan,

as far as I know, there is no way to do this. You need at alst 10.3.3

leofoto said...

Subject: JSF 2 annotations not working on weblogic 10.3.3


I have installed JSF 2 support on Weblogic 10.3.3 version using the above instructions

When I run a sample application which basically calls a bean action like
#{someBean.someMethod}

and that bean is declared SomeBean.java
with annotation @ManagedBean and @SessionScoped

(I am sure its not some capitalization error - I am aware the SomeBean.java can be used as someBean (with lowercase 's') in the xhtml page
when I simply use @ManagedBean annotation)

AT runtime I get the error
javax.el.PropertyNotFoundException:abc.xhtml
@25,55 action="#{someBean.someMethod}": Target Unreachable, identifier 'someBean' resolved to null

I can run this sample webapp without any problems (using annotations) on tomcat 6.0 web server.

I have packaged the following jars in the WEB-INF/lib folder to resolve compile-time dependencies.

jsf-api.jar
jsf-impl.jar
jstl-api-1.2.jar
jstl-impl-1.2.jar

PLEASE NOTE:
This sample webapp works fine on weblogic 10.3.3 - if I remove those annotations and declare the managed beans using traditional JSF 1.2.x way in faces-config.xml - and only fails when I bring back the annotations in the managed bean code (and remove the xml declaration from faces-config.xml)

which makes me believe that the annotations are not working.

please help.

myfear said...

Hi leofoto,

this sounds like the needed DI jar is not used. Have you tried tropping the jsf*.jars from WEB-INF lib? This should do the trick.

Let me know, if it helps.

leofoto said...

Thanks for your input.

i removed them. then I started getting ViewExpiredException on every button press.

seems like I have hit a bug in OEPE tooling. When I deploy the same application from with in eclipse environment by right clicking on the project --> Run on Server --> select weblogic 10.3.3 from the list of server --> Finish In this case my annotations in JSF2 web applications are not working. I get the above mentioned ViewExpiredException. But when I export the same project by right clicking --> export --> war file and drop the same war file into the same server's autodeploy folder everything works just fine in this second case. I have mentioned above the links to the app I'm deploying...

complete details for this issue can be read at :
http://stackoverflow.com/questions/3560534/jsf-2-annotations-not-working-on-weblogic-10-3-3

Post a Comment