lastcow
lastcow

Reputation: 137

JSF 2.0 f:ajax submission java.lang.IllegalStateException error: Parameters processing failed

I developing web application with JBOSS AS-7.1.1 Final, and Seam 3.1.0 Final. I just beginning working, but struck with following problem: I have a submission button with following code:

    <h:commandButton action="#{projectController.create}" value="Create Project" styleClass="greyishBtn submitForm">
        <f:ajax execute="@form" event="click" render="tblObject"/>
    </h:commandButton>

When I click on button, following error occur:

    java.lang.IllegalStateException error: Parameters processing failed.

The action is not trigger, but if I remove the tag, everything works fine, just non-ajax.

Here is the backend code:

    @Named
@RequestScoped
@Model
public class ProjectController implements Serializable {

/**
 * 
 */
private static final long serialVersionUID = 3572096930093985831L;

@Inject private EntityManager em;
@Inject private Logger log;
//@Inject private FacesContext facesContext;
@Inject private Event<Project> projectEventSrc;

private String projectId;

@Produces
@Named
private Project project;

private Query query;

private List<Project> projectList;
private List<ProjectDTO> projectDtoList;



public ProjectController() {
    // Default constructor.
}

@PostConstruct
public void postInit(){
    // Init project
    project = new Project();

    // Get project list.
    query = em.createQuery("select project from Project project");
    projectList = query.getResultList();
    projectDtoList = new ArrayList<ProjectDTO>();

    for(Project project : projectList){
        ProjectDTO projectDTO = new ProjectDTO();
        projectDTO.setProjectId(project.getProjectId());
        projectDTO.setProjectName(project.getProjectName());
        projectDTO.setProjectStatus(23.4d);
        // Add to list.
        projectDtoList.add(projectDTO);
    }

}

public void loadProject(){
    // Load project here based on project id.
    if(projectId == null){
        // Do nothing.
        return;
    }

    // Load from DB.
    project = em.find(Project.class, projectId);
}

/**
 * Create new project.
 * @throws Exception
 */
public void create() throws Exception{
    log.info("Creating: " + project.getProjectName());
    project.setProjectId(UUID.randomUUID().toString());
    em.persist(project);
    //facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Registered!", "Registration successful"));
    projectEventSrc.fire(project);

    // Reinit.
    project = new Project();
}

public void setProjectId(String projectId) {
    this.projectId = projectId;
}

public String getProjectId(){
    return this.projectId;
}


public List<Project> getProjectList() {
    return projectList;
}

public void setProjectList(List<Project> projectList) {
    this.projectList = projectList;
}

public List<ProjectDTO> getProjectDtoList() {
    return projectDtoList;
}

public void setProjectDtoList(List<ProjectDTO> projectDtoList) {
    this.projectDtoList = projectDtoList;
}

}

anyone have any idea?

Upvotes: 2

Views: 3329

Answers (3)

rvillar
rvillar

Reputation: 1

In my case, the problem occurred because there was one of my custom components being rendered without the attribute 'name'. The problem was gone after I include the attribute on the encoding method. jboss. 7.1.1/jsf 2.1.10/Eclipse Juno

Upvotes: 0

CCob
CCob

Reputation: 1246

I had the same problem, as a work around, if you are happy to include a 3rd party library, you can use PrimeFaces commandButton instead. It uses ajax by default and this appears to work

Upvotes: 0

BalusC
BalusC

Reputation: 1108922

This is a bug in JBoss AS 7.1.1 and occurs only when IE browser is been used. See also issue AS7-5143.

As of now, the only solution seems to be to downgrade to JBoss AS 7.1.0.

Upvotes: 1

Related Questions