Override jsf implentation in WAS - jsf

I want to develop richface implented app on Ibm Websphere. I include *.jars under
WEB-INF/libs and it runs succesfull. But first deployment proccess is realy terriable..
So I want to add libraries to server, not include in application.
(i belevie it could increase 1st deployment).. Is there a way to override server impelemented
JSf in server side?
Thanks

You need to set the webapp's classloading policy to module instead of application in the Websphere deploy manager.

Related

How can I migrate my JSF 1.2 project from WAS 7 to 9

Good afternoon, I have a project done in JSF version 1.2 which is on a WebSphere Application Server 7 server but I want to deploy it on a WebSphere Application Server 9. What points should I take into account so that everything goes well.
My project has the following libraries:
aopalliance-1.0.jar
asm-3.1.jar
asm-commons-3.1.jar
asm-tree-3.1.jar
aspectjtools-1.6.1.jar
commons-beanutils-1.7.jar
commons-codec-1.5.jar
commons-collections-2.1.jar
commons-digester-1.7.jar
commons-lang-2.3.jar
commons-logging-1.1.jar
DynamicJasper-4.0.3.jar
FlexiCoreProvider-1.7p2.signed.jar
freemarker-2.3.16.jar
hibernate-validator-4.3.1.Final.jar
IntegraUtil.jar
itext-2.1.7.jar
jasperreports-5.0.0.jar
javassist-3.11.0.GA.jar
jboss-logging-3.1.0.CR2.jar
jsf-api.jar
jsf-facelets.jar
jsf-impl.jar
jsf-tlds.jar
jstl.jar
jxl-2.6.10.jar
log4j-1.2.14.jar
ognl-3.0.1.jar
ojdbc6.jar
org.springframework.aop-3.1.0.M1.jar
org.springframework.asm-3.1.0.M1.jar
org.springframework.aspects-3.1.0.M1.jar
org.springframework.beans-3.1.0.M1.jar
org.springframework.context-3.1.0.M1.jar
org.springframework.context.support-3.1.0.M1.jar
org.springframework.core-3.1.0.M1.jar
org.springframework.expression-3.1.0.M1.jar
org.springframework.instrument-3.1.0.M1.jar
org.springframework.jdbc-3.1.0.M1.jar
org.springframework.orm-3.1.0.M1.jar
org.springframework.transaction-3.1.0.M1.jar
org.springframework.web-3.1.0.M1.jar
poi-3.9-20121203.jar
richfaces-api-3.3.2.SR1.jar
richfaces-impl-3.3.2.SR1.jar
richfaces-ui-3.3.2.SR1.jar
standard.jar
validation-api-1.0.0.GA.jar
Your recommendations would be helpful.
Thank you
In WebSphere Application server you have the option to switch the implementation of JSF at the application server level to Sun Reference Implementation 1.2 or My Faces 2.0. How to set the JSF version. I think this is a server level settings and applies to all the applications running there. You may also have to change the class loading order to parent last
There are a few changes that were introduced in the area of JSF. I would recommend running the WebSphere migration tools against your application so it can flag issues for JSF and other technologies.
You can run the binary scanner against your .war/.ear files: https://developer.ibm.com/wasdev/downloads/#asset/tools-Migration_Toolkit_for_Application_Binaries
If you're using Eclipse, you can run the source scanner against your Eclipse project: https://developer.ibm.com/wasdev/downloads/#asset/tools-WebSphere_Application_Server_Migration_Toolkit

Configure WebLogic application/Web Application to not use MOXy for JAXB

My company has a Web Application that uses the JAXB provider in the JDK
The application runs great in Tomcat.
We have a customer that want to to use WebLogic
The application fails when trying to create a JAXBContext.
This page https://docs.oracle.com/cd/E24329_01/web.1211/e24964/data_types.htm#WSGET347
documents how to configure a WebLogic application to not use MOXy for JAXB
When I use the "Global" solution, modifying the startup script to prepend modules/databinding.override.jar to the classpath, my Web App works fine
This is a rather large hammer as the customer has existing apps on an existing server and we are targeting that server.
When I try the Application level solution, no luck.
Any pointers as to where I going wrong?
Eclipse Workbench

Apache Karaf Deploying .War File

My purpose is to run a JSF application on OSGI Framework. So, I am trying to deploy a WAR file to a servlet container for OSGi web applications, called PAX-WEB. I have a proper working JSF implementation working on WildFly 8.0 application server. I succesfully created OSGi-ified WAR file from this application. When I try to deploy it into PAX-WEB using Maven the following error occurs:
missing requirement: javax.servlet.annotation
I have these JARs in /lib folder of my application: jsf-api-2.1.7, jsf-impl-2.1.7, jsp-api-2.1, jstl-1.2. When I add javax.servlet-api-3.0.1.jar to my WAR file and re-deploy it, this time the following error occurs:
javax.faces.webapp.FacesServlet cannot be cast to javax.servlet.Servlet
With this error, I can run my JSF page, but it is not displaying JSF tags.
You're mixing two issues here.
One, your framework setup is missing the servlet classes. So in that case I propose to use the pax-web-jetty-bundle. It's an uber bundle and also contains and exports the servlet classes. In that case make sure you don't have the servlet jars in your framework setup available. Btw. taking a look at the samples and Integration tests of Pax Web itself helps already to understand which libraries are needed.
The second issue you are facing is an issue of adding the servlet classes to the war, this is per OSGi and servlet spec forbidden to do.
So without any further knowledge of your scenario you might be better of with using the Apache Karaf server (it uses Pax Web), cause there all infrastructure bundles are already included and known to work together.
One more thing, you get more and better feedback at the ops4j mailinglist.

Is it possible to deploy JSF application on Bluemix?

I have installed IBM Bluemix tools on Eclipse and created a 'Hello World' JSF and EAR project. While creating I have chosen a Bluemix runtime environment. Now I try to deploy EAR from Eclipse, it successfully deployed and started but when I try to open it I get the following error:
Not Found The application or context root for this request has not been found: [Ljava.lang.Object;#bdb04149
What have I missed? Is there comprehensive tutorial to deploy Java EE web applications on Bluemix available anywhere?
You can deploy complete EAR files on Bluemix yes. Using the eclipse tools also makes it much easier. This link has steps on how you can do this https://www.ng.bluemix.net/docs/#manageapps/eclipsetools.html
Further down the page (you can use the menu on the left too) there are steps on how to push an EAR. It might be with pushing a complete Liberty profile to get finer control on the application behavior. This link has further details on pushing Liberty apps and the profile itself https://www.ng.bluemix.net/docs/#starters/liberty/index.html#liberty
If you deployed an EAR (containing your JSF app) you need to add the web module name to the URL, for example, if your project is called testJSF, your URL will look like this:
http://testApp.mybluemix.net/testJSF/
And of course, if your web page is not called index.xxx you need to add the web page name as well, for example:
http://testApp.mybluemix.net/testJSF/textPage.xhtml
or
http://testApp.mybluemix.net/testJSF/textPage.faces

How to use PrimeFaces websocks for server push with Glassfish 3.1 and JSF2

The PrimeFaces pdf says that websockets with server push is only available with Jetty but Glassfish3.1 does have a websockets component with grizzly. Is the documentation wrong? has anyone used these two for push with websockets? How was this done?
The PrimeFaces Users Guide documentation is right. Note that it's literally telling that the push servlet has to run in a different application than the JSF2 application itself.
6.1 Setup
Push Server
PrimeFaces Push uses a servlet as a dispatcher. This servlet should be in a different application than the JSF application and at the moment can only be deployed on jetty server.
So the Jetty-only support should be a non-issue. You can just keep running your JSF2 webapp in Glassfish. You just have to setup and run Jetty side by side on a different port if you have only one server machine.
The reason is most likely because the websockets are not supported by standard Servlet API spec (it's however planned for the upcoming Servlet 3.1). With Servlet 3.0 and older, you would need container specific code and libraries. It's for PrimeFaces likely not worth the
effort to ship the container specific code and libraries for a wide range of existing servletcontainers along with the PrimeFaces JAR.

Resources