有一个像这样的NamedQuery:
@NamedQuery(name = "getOpakOdeslaniForPartner", query = "select
new com.vo.OpakOdeslaniVO(opak.pocetPokusu,opak.idSekvenceOpakovani.idOpakSekvence,opak.idSekvenceOpakovani.sekvence) 来自GmOpakOdeslani opak,GmPrijemce prij 其中opak.idTypZpravy.idTypZpravy =:typZpravy和opak.idPrijemce = prij和prij.idPrijemceTyp.idPrijemceTyp =:typPrijemce“
value对象具有带三个参数的单个构造函数。
有一个这样的日志(WebLogic 11g,HP-UX):
Caused by: <openjpa-1.1.1-SNAPSHOT-r422266:1172209 nonfatal user error> org.apache.openjpa.util.UserException: There was an error packing the projection and/or aggregate results of the query into result type "class com..vo.OpakOdeslaniVO". See the nested Throwable exception for details.
at org.apache.openjpa.kernel.ResultPacker.packUserType(ResultPacker.java:262)
at org.apache.openjpa.kernel.ResultPacker.pack(ResultPacker.java:225)
at org.apache.openjpa.kernel.QueryImpl$PackingResultObjectProvider.getResultObject(QueryImpl.java:1960)
at com..service.OpakOdeslani.getOpakOdeslaniForPartner(.java:52)
at sun.reflect.GeneratedMethodAccessor1516.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
Caused by: java.lang.IllegalArgumentException
at sun.reflect.GeneratedConstructorAccessor747.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.apache.openjpa.kernel.ResultPacker.packUserType(ResultPacker.java:235) ... 114 more
实际上我觉得卡住了,因为IllegalArgumentException没有解释消息,我找不到GeneratedConstructorAccessor747类的源代码。任何想法,发生了什么以及如何解决这个问题?我想值对象构造函数或类必定存在一些问题。
谢谢
答案 0 :(得分:0)
确保opak.pocetPokusu, opak.idSekvenceOpakovani.idOpakSekvence, opak.idSekvenceOpakovani.sekvence
的类型与com.vo.OpakOdeslaniVO的构造函数提供的类型相同。
作为调试点,您可以选择这些字段以确保返回数据吗?