File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JBoss/WildFly and the fly likes JBOSS Seam registration problem.  Please help.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBOSS Seam registration problem.  Please help...." Watch "JBOSS Seam registration problem.  Please help...." New topic

JBOSS Seam registration problem. Please help....

Benson Fung
Ranch Hand

Joined: Apr 10, 2003
Posts: 214
Hi all,

I followed the JBOSS Seam tutorial to develop registration seam application.
Unfortunately, I always got 3 'Conversion error' messages when I clicked the 'Register' button. There is no any error message in the console so I can't debug what is going on. I had been stuck to this problem for a long time. Please help. The followings are the files :

register.jsp :
<%@ taglib uri="" prefix="h" %>
<%@ taglib uri="" prefix="f" %>
<%@ taglib uri="" prefix="s" %>
<title>Register New User</title>
<table border="0">

<td><h:inputText value="#{user.username}"/></td>
<td>Real Name</td>
<td><h:inputText value="#{}"/></td>

<td><h:inputSecret value="#{user.password}"/></td>


<h:commandButton type="submit" value="Register" action="#{register.register}"/>

web.xml :
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"

<!-- Seam -->


<!-- MyFaces -->



<servlet-name>Faces Servlet</servlet-name>

<!-- Faces Servlet Mapping -->
<servlet-name>Faces Servlet</servlet-name>


faces-config.xml :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config
PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
<!-- A phase listener is needed by all Seam applications -->


</faces-config> :
package com.myseam.entity;


import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.validator.NotNull;
import org.hibernate.validator.Length;

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;

public class User implements Serializable
private static final long serialVersionUID = 1881413500711441951L;

private String username;
private String password;
private String name;

public User(String name, String password, String username)
{ = name;
this.password = password;
this.username = username;

public User() { System.out.println("Creating user project.");}

@NotNull @Length(min=5, max=15)
public String getPassword()
return password;

public void setPassword(String password)
System.out.println("password=" + password);
this.password = password;

public String getName()
return name;

public void setName(String name)
System.out.println("name=" + name); = name;

@Id @NotNull @Length(min=5, max=15)
public String getUsername()
return username;

public void setUsername(String username)
System.out.println("username=" + username);
this.username = username;

package com.myseam.session;

import java.util.List;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.core.FacesMessages;
import org.jboss.seam.log.Log;

import com.myseam.entity.User;
import com.myseam.inf.Register;
import org.jboss.seam.annotations.Name;

@Stateless //(1)
public class RegisterAction implements Register

@In //(2)
private User user;

@PersistenceContext //(3)
private EntityManager em;

@Logger //(4)
private Log log;

public String register() // (5)
List existing = em.createQuery(
"select username from User where username=#{user.username}") //(6)

if (existing.size()==0)
em.persist(user);"Registered new user #{user.username}"); //(7)
return "/registered.jsp"; // (8)
FacesMessages.instance().add("User #{user.username} already exists"); // (9)
return null;


Please help
I agree. Here's the link:
subject: JBOSS Seam registration problem. Please help....
jQuery in Action, 3rd edition