Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Stack Overflow by Display Name
, 1 year ago
java.lang.String cannot be cast to java.lang.Enum Query: ReadAllQuery(name="MyEntity.findEnum" referenceClass=MyEntity jpql="SELECT myEntity FROM MyEntity myEntity WHERE myEntity.myEnum = 'ENUM'")
via Eclipse Bugzilla by dennis.fuglsang, 2 years ago
java.lang.String cannot be cast to org.eclipse.persistence.internal.descriptors.PersistenceObject Query: ReadAllQuery(referenceClass=Zinstance jpql="SELECT a FROM Zinstance a WHERE 'b54f6d66-07fe-4d04-97f6-acff6722236a' NOT MEMBER OF a.groupUUIDs")
via Eclipse Bugzilla by pascal.filion, 2 years ago
org.eclipse.persistence.internal.jpa.parsing.ModNode cannot be cast to org.eclipse.persistence.internal.jpa.parsing.AliasableNode Query: JPAQuery(name="address.joinFetch" )
via Stack Overflow by lage
, 2 years ago
org.eclipse.persistence.eis.mappings.EISOneToOneMapping cannot be cast to org.eclipse.persistence.mappings.OneToOneMapping Query: ReadAllQuery(referenceClass=Order jpql="Select o from Order o where o.customer.id = "ID"")
via GitHub by mydeadlyvenoms
, 5 months ago
java.lang.Integer cannot be cast to java.lang.Enum Query: ReadAllQuery(referenceClass=User )
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.EnumQuery: ReadAllQuery(name="MyEntity.findEnum" referenceClass=MyEntity jpql="SELECT myEntity FROM MyEntity myEntity WHERE myEntity.myEnum = 'ENUM'") at org.eclipse.persistence.exceptions.QueryException.prepareFailed(QueryException.java:1590) at org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:680) at org.eclipse.persistence.queries.ObjectLevelReadQuery.checkPrepare(ObjectLevelReadQuery.java:901) at org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:613) at org.eclipse.persistence.internal.jpa.QueryImpl.getDatabaseQueryInternal(QueryImpl.java:341) at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createNamedQuery(EntityManagerImpl.java:1124) at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createNamedQuery(EntityManagerImpl.java:1144) at com.istvanmosonyi.dbtest.Main.main(Main.java:29)Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Enum at org.eclipse.persistence.mappings.converters.EnumTypeConverter.convertObjectValueToDataValue(EnumTypeConverter.java:160) at org.eclipse.persistence.mappings.foundation.AbstractDirectMapping.getFieldValue(AbstractDirectMapping.java:776) at org.eclipse.persistence.internal.expressions.QueryKeyExpression.getFieldValue(QueryKeyExpression.java:420) at org.eclipse.persistence.internal.expressions.ConstantExpression.printSQL(ConstantExpression.java:152) at org.eclipse.persistence.expressions.ExpressionOperator.printDuo(ExpressionOperator.java:2239) at org.eclipse.persistence.internal.expressions.CompoundExpression.printSQL(CompoundExpression.java:286) at org.eclipse.persistence.internal.expressions.RelationExpression.printSQL(RelationExpression.java:899) at org.eclipse.persistence.internal.expressions.ExpressionSQLPrinter.translateExpression(ExpressionSQLPrinter.java:306) at org.eclipse.persistence.internal.expressions.ExpressionSQLPrinter.printExpression(ExpressionSQLPrinter.java:129) at org.eclipse.persistence.internal.expressions.SQLSelectStatement.printSQL(SQLSelectStatement.java:1683) at org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.printSQLSelectStatement(DatabasePlatform.java:3178) at org.eclipse.persistence.platform.database.PostgreSQLPlatform.printSQLSelectStatement(PostgreSQLPlatform.java:530) at org.eclipse.persistence.internal.expressions.SQLSelectStatement.buildCall(SQLSelectStatement.java:782) at org.eclipse.persistence.internal.expressions.SQLSelectStatement.buildCall(SQLSelectStatement.java:792) at org.eclipse.persistence.descriptors.ClassDescriptor.buildCallFromStatement(ClassDescriptor.java:813) at org.eclipse.persistence.internal.queries.StatementQueryMechanism.setCallFromStatement(StatementQueryMechanism.java:390) at org.eclipse.persistence.internal.queries.StatementQueryMechanism.prepareSelectAllRows(StatementQueryMechanism.java:315) at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.prepareSelectAllRows(ExpressionQueryMechanism.java:1721) at org.eclipse.persistence.queries.ReadAllQuery.prepareSelectAllRows(ReadAllQuery.java:813) at org.eclipse.persistence.queries.ReadAllQuery.prepare(ReadAllQuery.java:744) at org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:661) ... 6 more