Saving data through JPA sometime causes strange error: java.lang.String cannot be cast to enum -


i'm trying save data database through jpa. here's entity , enum:

public enum myenum implements java.io.serializable {     myvalue,     myothervalue }  @entity public class myentity implements java.io.serializable {     @enumerated(enumtype.string)     @column(name = "myenum")     private myenum myenum;      public myenum getmyenum() { return myenum; }     public void setmyenum(myenum parameter) { this.myenum = parameter; } } 

and try save entity calling entitymanager's merge method.

what is: "java.lang.string cannot cast myenum". strange part possibility of scenario 80% on our production environment, , 20% on our test environment.

i tried debug code see happens inside, reached error once. restarted our webserver (wildfly) , can't reproduce.

so problem?

update: if restart wildfly, problem not comes out while... after unknown time or don't know what, can't save entity again because of casting error.


Comments

Popular posts from this blog

methods - python can't use function in submodule -

Java 3D LWJGL collision -

c# - ErrorThe type or namespace name 'AxWMPLib' could not be found (are you missing a using directive or an assembly reference?) -