I'm trying to use the Primefaces-Extensions library in a Liferay JSF Portlet that is already using primefaces 4.0.
When I include any pe component, e.g a <pe:timer>, I get this error:
javax.faces.view.facelets.TagException: /html/editDoc/myProjects.xhtml #32,39 <pe:timer> Tag Library supports namespace: http://primefaces.org/ui/extensions, but no tag was defined for name: timer
at com.sun.faces.facelets.compiler.CompilationManager.pushTag(CompilationManager.java:304)
at com.sun.faces.facelets.compiler.SAXCompiler$CompilationHandler.startElement(SAXCompiler.java:255)
at com.sun.faces.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:423)
at com.sun.faces.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:399)
at com.sun.faces.facelets.compiler.Compiler.compile(Compiler.java:124)
The only component I've managed to use without crashing is pe:ckEditor, which is however rendering as an inputTextarea (no toolbox etc)
I probably did something wrong setting up the primefaces-extensions library, but I don't know where to look.
I'm using:
Liferay 6.2.2 ce
primefaces 4.0
primefaces-extensions 1.2.1 (I guess this is the proper version to work with pf 4.0)
About the steps I followed: (I had a perfectly working pf 4.0 setup)
Added libs in [portlet docroot]/WEB-INF/lib/ :
primefaces-extensions-1.2.1.jar
resources-ckeditor-1.2.1.jar
commons-lang3-3.1.jar
gson-2.2.4.jar
Added xmlns:pe="http://primefaces.org/ui/extensions in xhtml file's namespaces
I had the same problem
to solve it, you should have 3 jars:
commons-lang3-3.1.jar
gson-2.2.4.jar
primefaces-extensions-2.1.0.jar
!!! you can find in the internet other version of PFE 3..., don't use it, because it's not compatible with the other jars
Related
I am using trinindad-2.0.1 with JSF2.0 and it is working fine with IE8 browser. I tried to use same application in IE11 but I am getting following exception when try to use the application:
java.lang.NullPointerException at
org.apache.myfaces.trinidadinternal.ui.RootRenderingContext.getRendererManager.
There is an open and unresolved query in Trinidad for this:
https://issues.apache.org/jira/browse/TRINIDAD-2451
Can any one let me know which version of trinidad and JSF combination should be used for IE11?
There are some workarounds to make version 2.0.1 to work with IE9+, implementing a custom filter for example:
http://jonasdegraaff.blogspot.com.es/2013/11/how-to-run-your-adf-111x-application.html
But the latest stable version (2.1.0+) works with IE9+. The official download page is finally updated with it:
https://myfaces.apache.org/trinidad/download.html
You can also download it from here:
http://mvnrepository.com/artifact/org.apache.myfaces.trinidad/
Adding dropdown list tag in my xhtml page and using title attribute trying to display the tooltip value.
The tooltip option is working fine when I deploy the application in Tomcat where as the samething is not working in wepsphere application server.
Can anyone please suggest me on this?
Tomcat does as being a barebones JSP/Servlet container not ship with any JSF libraries bundled and will use the webapp-supplied JSF libraries. WebSphere does as being a full fledged Java EE container already ship with JSF libraries bundled and will by default ignore the webapp-supplied JSF libraries.
Your concrete problem suggests that WebSphere is using an older JSF version which exposes a bug wherein the tooltip of the dropdown won't be properly rendered. You've basically 2 options:
Upgrade WebSphere-bundled JSF version to be the same version as the one which you initially used in Tomcat. Refer WebSphere administration manual for upgrade instructions, or if that isn't your responsibility, tell/ask the server admin to upgrade.
Tell WebSphere to use webapp-bundled JSF libraries instead. You can do that in WAS admin console by configuring the "Classloading Policy" of the application to "module" or "PARENT_LAST", depending on WAS version.
I am using JSF 2 and Richfaces 4.2.3.Final on a Websphere AS 8 (I think it ships with MyFaces 2.0.2)
I get a javascript error when trying to upload a document with the rich:fileUpload
this._q._curReq is null
I found this solution
https://issues.jboss.org/browse/RF-10128
So I downloaded the latest MyFaces version, placed myfaces-api.jar and myfaces-impl.jar in my lib folder and configured the application classloader-order to "Classes loaded with local class loader first (parent last) " and restarted my server.
It seems to have no effect at all, i still get the same error.
Is there more configuration needed on the WAS?
Someone has the same issue?
Thanks in advance
Regards
Edit: is there any way of finding out which Myfaces implementation is actually used for this application? In the server log I only find a warning that says MyFaces 2 is running in development mode, but it doesn't log the actual version
Ok, I found the solution. There actually is another configuration I needed to do in Websphere.
Admin Console - Applications - Websphere Enterprise applications - appName - Manage Modules - moduleName - Class loader order:classes loaded with local class loader first (parent last)
After that the latest myfaces version applies correctly and the fileUpload works.
Hope that helps people with the same problem.
I have created web dynamic project with jsf2, Primefaces 3.4, Tomcat7.Application runs fine. If i deploy the EAR of the same project on Websphere8 instead of Tomcat7, I am getting Exceptions.I am not sure of what is happening. I am new to JSF2 and Wepshere8.
can you provide me the links on how to start sample jsf2 + primefaces project on Websphere 8
Thanks in advance.
Got it. Try to add com.sun.faces.config.ConfigureListener instead of org.apache.myfaces.webapp.StartupServletContextListener in your web.xml, restart your server and then run it.
The code should look like the following.
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
For using different implementations of JSF, the WebSphere Application Server JSF engine determines if the SUN RI or Apache MyFaces is used from the application server run time. After the JSF engine determines the implementation that is used, the correct listener class is registered with the web container. You do not need to add the com.sun.faces.ConfigureListener or the org.apache.myfaces.StartupConfigureListener to the web.xml file.
http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.0.0/com.ibm.websphere.nd.doc/info/ae/ae/cweb_javaserver_faces.html
Please see above...
I too faced the same problem.
Websphere by default support sun impl and apache myfaces and its jsf 1.2.
To use jsf 2 implementation.
1.Make sure to remove servlet.jar from your application.Its need for tomcat however not in websphere.
2.Change the classloader policy for ear to parent last.Parent last means lib in your app will have higher priority.if not found will load from WAS class path.
3.Also make sure to change the webmodule class loader policy to parent last.
4.Restart websphere.
To solve the classloader of primefaces in websphere 8.5 classes replace the jsf
jsf-api
jsf-impl
javaee-api
for the native implementation of websphere
myfaces-api
myfaces-impl
I am having some trouble with JSF2 and websphere 7.0. I have searched in the internet but nothing. The thing looks to be that websphere puts its 1.2 libraries and override my 2.0 libs. The app is working fine in apache-tomcat
Thirst of all, when i try to get an xhtml page (with simple html the app works, the problem is with jsf) the server shows the error:
could not find factory: javax.faces.context.FacesContextFactory
i've read that i had to use the "parent last" option in the class loader section, but it didn't worked. Then i went to jsp and jsf options on the web module properties, and there i can choose between Sun reference implementation 1.2 and MyFaces 1.2, the sun was selected, so i choose myfaces and now the error is another one: if i try to go to "something.xhtml", it redirects to "something.jsf", which doesn't exists..
any idea?
thanks!
It seems that you didn't include the JSF implementation on your classpath.
Here's how I solved it.
Use the following library: javax.faces-2.1.7.jar
If you are on PrimeFaces 3.1: primefaces-3.1.1.jar
Application Server instance: Class Loading - Parent Last
Enterprise Application instance (war Module): Class Loading - Parent Last
Make sure to remove all Servlet Container libraries such as those needed by Tomcat.