0

I apparently doing something wrong in the configuration of a jdbcRealm. But I don't know what exactly.

error

This is my configuration:

config

What else is needed to help me?

@Entity
@Table(name = "gebruiker")
public class User implements Serializable  {

@Id  @Column(name="User_NAME")
private String name;

@ManyToOne
@JoinTable(name = "groep_gebruiker")
private Role rol;

@Entity
@Table(name = "groep")
public class Role implements Serializable {
@Id 
private String rol;

@OneToMany(mappedBy = "rol")

private Collection<User> gebruikers = new ArrayList();
Community
  • 1
  • 1
Aldwoni
  • 1,168
  • 10
  • 24
  • possible duplicate of [Java EE declarative security, Cannot load group for JDBC realm user](http://stackoverflow.com/questions/10483132/java-ee-declarative-security-cannot-load-group-for-jdbc-realm-user) – kolossus Feb 27 '14 at 20:22

1 Answers1

0

Obviously this is because you did not create a JDBC realm user /Hans/

CodeFanatic
  • 11,434
  • 1
  • 20
  • 38
  • In my database in the gebruiker table there is a user with the name Hans. So what did I do wrong? – Aldwoni Feb 27 '14 at 14:37
  • yes, I also made a user admin and he got the same error. Would it help if I post all info from inside my database? – Aldwoni Feb 27 '14 at 14:39
  • 1
    @Aldwoni is your user column in the user table the same name as the user column in the USER_GROUPS table? because the matching is done by the column names. – CodeFanatic Feb 28 '14 at 09:07
  • I have a gebruiker table with a NAME column.(my current user name column) And I have a groep_gebruiker table with a User_NAME column(my current group name column). both with Hans in it. – Aldwoni Mar 02 '14 at 14:54
  • @aldwoni name the columns the same, the matching is done by column names – CodeFanatic Mar 02 '14 at 22:13
  • I currently get the following error: jdbcrealm.invaliduserreason, I changed the gebruiker table to also have User_NAME so the columns have exactly the same name – Aldwoni Mar 03 '14 at 11:14
  • I added some code to the question, I hope it helps you – Aldwoni Mar 03 '14 at 13:10