每次我尝试从我从 jpa 调用中拉回的实体列表中获取一组实体时,我都会遇到一个强制转换异常。例子...
QuickLaunch[] qLaunchArr = null;
List<QuickLaunch> listQL = null;
try
{
System.out.println("testing 1..2..3");
//qLaunchArr
listQL = emf.createNamedQuery("getQuickLaunch").getResultList();
Object[] objArr = listQL.toArray();
//System.out.println(listQL.size());
qLaunchArr = (QuickLaunch[]) listQL.toArray();
}
catch (Exception e)
{
System.out.println("Bull Hockey!!!! I can't believe it's not butter!: "+e.toString());
}
[Ljava.lang.Object; incompatible with [Lcom.upmc.esdm.messaging.entities.QuickLaunch;
那是在我的服务器日志中......(我正在使用 WID)而且我也得到了这个异常......
commonj.connector.runtime.DataHandlerException: CWLAP0507E: The response bean class for java class method GetAllQuickLaunchComponents cannot be created. Reason java.lang.IllegalArgumentException: argument type mismatch.