Take the 2-minute tour ×

What I do is pass no value in the fields and send to give the error message of the required fields and then I pass values ​​in the fields and sending again. Works in tomcat, glassfish in the request is not sent. Does anyone know what might be happening?

Picture of what happens

Picture of what happens, error on console javascript

I really don't know what happening, anyone knows? I using Tomcat 7 and Glassfish 3, Primefaces 3.4.2 e Primefaces Extensions 0.6.2. in a .ear Enterprise Project.

:===============: Supplement to enhance understanding. :===============:

Hello guys, this problem is difficult to solve then after searching elsewhere I saw (not sure where) that could be a problem in my project dependencies. So I decided to take the example of primefaces site and reproduce it in three perspectives.

  1. Running with Tomcat (Worked)
  2. Running with Glassfish (Worked)
  3. Running with Glassfish in my project (Not Worked)

On 1 and 2, just did a ctrl + C / ctrl + V of primefaces site example, in this way:


<html lang="pt-br" 
            <h:form id="form">  
                <p:panel id="panel" header="New Person">  
                    <p:messages id="msgs"/>  
                    <h:panelGrid columns="3">  
                        <h:outputLabel for="firstname" value="Firstname: *" />  
                        <p:inputText id="firstname" value="#{testMB.name}" required="true" label="Firstname">  
                            <f:validateLength minimum="2" />  
                        <p:message for="firstname" display="icon"/>  
                        <h:outputLabel for="surname" value="Surname: *" />  
                        <p:inputText id="surname" value="#{testMB.name}" label="Surname" required="true">  
                            <f:validateLength minimum="2" />  
                            <p:ajax update="msgSurname" event="keyup" />  
                        <p:message for="surname" id="msgSurname" display="icon"/>  
                    <p:commandButton id="btn" value="Save" update="panel" actionListener="#{testMB.save(actionEvent)}"/>  


public class TestManagedBean
  private String name;
  private String surname;

  public String getName()
    return this.name;

  public void setName(String name) {
    this.name = name;

    public String getSurname() {
        return surname;

    public void setSurname(String surname) {
        this.surname = surname;

  public void save(ActionEvent actionEvent) {
    addMessage(FacesMessage.SEVERITY_INFO, "TEST: " + this.name);

  public void addMessage(FacesMessage.Severity s, String summary) {
    FacesMessage message = new FacesMessage(s, summary, null);
    FacesContext.getCurrentInstance().addMessage(null, message);

At 3, I did likewise, but by to be using the architecture planned, is using security filters of shiro, facelets, layout primefaces extensions, etc... I checked the shiro and no filter is preventing something, other dependencies also have looked and what I found is that in the ejb module I declare the primefaces (because I'm using the SortOrder model class of primefaces) and web module also declare the primefaces and primefaces extensions.

Had the project dependancy something to do with the problem? It would be more appropriate to remove the dependence of primefaces in ejb module and declare the primefaces only in web module? (I tried here but the web module can see the ejb module but the reverse does not happen, how can I do that?)

Thanks everyone and sorry for my english, I'm Brazilian.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Your EJB's should not be referencing Primefaces and should be a platform independent as possible (though in fact it's sadly impractical to not have any dependencies on Hibernate/EclipseLink).

Here's the kind of structure I use:

  |- (1) WAR
  | \- Primefaces xhtml files etc.
  | |- backing beans (support components in the xhtml files)
  | |- dao beans (handle any interactions with the @Remote facades)
  | |- Dependencies: (2,3)
  |- (2) JAR @Remote interfaces
  | \- Dependencies: (3)
  |- (3) JAR @Entity objects
  | \- Dependencies: (none)
  |- (4) @EJB Module
    \- @Local interfaces
    |- @Local implementations
    |- @Remote implementations
    |- Dependencies: (2,3)

The two key parts are the WAR and EJB module. Both of these have dependencies on the @Remote and @Entity jars. They do not directly depend on each other at all.

When a ManagedBean communicates with an EJB it does it by calling the Remote interface e.g. @EJB RemoteMyBeanInterface myBean which actually returns the implementation in the EJB module (by magic).

Try separating the modules and see if that helps you. If not, then there could be some interference by a security filter (possibly silently). You should start a clean new project (+ new sever domain if necessary); start with the cut&pasted code from Primefaces and then start adding all the extras and filters one by one until you hit on what is causing the problem.

If you're still stumped, post to the Primefaces forum and/or try to get the attention of BalusC. Most of my problems have been solved thanks to answers he has posted here.

share|improve this answer
Hello @KidTempo, the problem really was on primefaces dependence who was in ejb module instead of being in the web module. After taking a deeper study, tried some possibilities, but the one that really worked was to isolate the primefaces only web module. Thank you!! –  Vinícius França Feb 11 '13 at 16:08

I suffered from a similar problem and while I'm afraid I can't remember exactly how I fixed it, I'm pretty sure it was solved by adding the following to web.xml:




I'm going to stick my neck out and say it was the first code snippet, but it may or may not depend on the state saving method being set to server.

share|improve this answer
I don't think it is yet. I tried with these options and the error persist. Another thing I noticed is that the forms in the application work when there is no validation error but when there is an error (for example, a validation error) no request can be sent. Why? –  Vinícius França Jan 30 '13 at 20:09
@ViníciusFrança I'm afraid you're going to have to update your question with some stacktraces and code samples. I'd recommend you try to cut your code down to the bare minimum to recreate the issue to make it easier for others to spot what's going wrong. –  KidTempo Jan 31 '13 at 11:20
Sorry for the delay comment again @KidTempo, I was on vacation and I was without internet for a few days. Gave an improved in question and hopefully now people can have a better understanding of the issue. Thanks for the tip. –  Vinícius França Feb 8 '13 at 2:51

Your Answer


