The enum constant . reference cannot be qualified in a case label
Friday, April 29, 2011
by
Iori Yagami
That's a very strange error, since the solution is quiet simple : juste remove the enum class name!
As an example :
public enum DAYS {
MONDAY,
THURSDAT,
WEDNESDAT,
...;
}
When you want to use this enum as a switcher case values, like this :
switch (myValue) {you got this error :
case DAYS.MONDAY :
break;
....
}
The enum constant DAYS.MONDAY reference cannot be qualified in a case label
Seems weird, but just remvoe "DAYS" and move on.
ERROR [STDERR] java.lang.IllegalStateException: Illegal to call this method from injected, managed EntityManager
Wednesday, April 27, 2011
by
Iori Yagami
Got this error while trying to create a new entity? just remove the use of transaction. em.persist doesn't need it.
em.getTransaction().begin();
em.persist(entity);
em.getTransaction().commit();