Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0
-
Fix Version/s: 1.1-beta-1
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, org.jboss.seam.example.jpa.RegisterAction: 3: Unknown type: STATIC_IMPORT at line: 3 column: 1. File: org.jboss.seam.example.jpa.RegisterAction @ line 3, column 1.
1 error
at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:326)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:851)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:480)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:306)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:275)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:270)
at groovy.lang.GroovyClassLoader.recompile(GroovyClassLoader.java:714)
at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:673)
at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:728)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
package org.jboss.seam.example.jpa;
import static org.jboss.seam.ScopeType.EVENT;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.jboss.seam.annotations.Destroy;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.core.FacesMessages;
@Scope(EVENT)
@Name("register")
class RegisterAction
{
@In
User user;
@In
EntityManager em;
@In
FacesMessages facesMessages;
String verify;
boolean registered;
void register()
{
if ( user.password == verify )
{
existing = em.createQuery('''
select u.username
from User u
where u.username=#{user.username}
''').getResultList()
if (existing.size()==0)
{
em.persist(user)
facesMessages.add("Successfully registered as #{user.username}");
registered = true
}
else
{
facesMessages.addToControl("username", "Username #{user.username} already exists")
}
}
else
}
void invalid()
{ facesMessages.add("Please try again") }}
Oups, I validated the form too fast
It's based on Wednesday's trunk