Appfoundation : Registering User


I am a trying to register a user using appfoundation as detailed on the demo but having difficulties when i click on the register button.

03-May-2011 15:17:02 com.vaadin.Application terminalError
SEVERE: Terminal error:
Cause: java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
Exception Description: Error compiling the query [SELECT u FROM User u WHERE u.username = :username]
. Unknown entity type [User]
at com.vaadin.event.ListenerMethod.receiveEvent(
at com.vaadin.event.EventRouter.fireEvent(
at com.vaadin.ui.AbstractComponent.fireEvent(
at com.vaadin.ui.Button.fireClick(
at com.vaadin.ui.Button.changeVariables(
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
at Source)

Will Appreciate all help.


Are you using the plain User entity or have you extended it? How does your persistence.xml file look like?

I Extended the user Entity.and this is ,y persistence.xml

org.eclipse.persistence.jpa.PersistenceProvider com.example.logintest.TestUser false

and i registered the facade in my contextListener class as thus:

This is probably because your user entity is called TestUser and the Authentication module expects it to be called User. What you can try is to rename your class to User, but to be able to do that, you’ll need to add this to your own User entity.

private String username;
private String password;

public void setUsername(String username) {
   this.username = username;

public String getUsername() {
   return username;

public void setPassword(String password) {
   this.password = password;

public String getPassword() {
   return password;

Thanks Kim.

Apologies for the delayed reply.

I finally resolved the issue with your help.