When I query through the EJB interface for a entity, under the console it is ok, but switch to query from Swing it throw this exception.
The exception:
It turns out it is a JRE bug. As my console env is 1.5 and swing is 1.6:
Bug reference:
We need to pass this argument to the JVM
-Dsun.lang.ClassLoader.allowArraySyntax=true
This exception is generated when the the class corresponding to the serialized object that is found by the JVM has the same serialVersionUid as the serialised class, but is actually a different version (ie: changes were made to the class without changing the version id).
Check that you have the relevant jar's/class files in the class path?