Appfoundation : Registering User

Hi,

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:
com.vaadin.event.ListenerMethod$MethodException
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(ListenerMethod.java:510)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:162)
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1166)
at com.vaadin.ui.Button.fireClick(Button.java:380)
at com.vaadin.ui.Button.changeVariables(Button.java:196)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1297)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1217)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:733)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:296)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:483)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)

Will Appreciate all help.

Thanks

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:
FacadeFactory.registerFacade(“mysql”,true);

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.