当前位置: 代码迷 >> 高性能WEB开发 >> JPA错误java.lang.reflect.InvocationTargetException。
  详细解决方案

JPA错误java.lang.reflect.InvocationTargetException。

热度:1080   发布时间:2012-03-18 13:55:39.0
JPA异常java.lang.reflect.InvocationTargetException。。。。
[color=#FF0000][/color]大致就是下面谢谢你们帮看看

java.lang.reflect.InvocationTargetException
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:440)
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279)
......
root cause 

java.lang.NoClassDefFoundError: antlr/RecognitionException
java.lang.Class.getDeclaredMethods0(Native Method)
java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
java.lang.Class.getDeclaredMethod(Class.java:1935)
java.io.ObjectStreamClass.getPrivateMethod(ObjectStreamClass.java:1382)
java.io.ObjectStreamClass.access$1700(ObjectStreamClass.java:52)
java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:438)
java.security.AccessController.doPrivileged(Native Method)
java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:413)
java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:310)
java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:547)
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)

org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:102)


root cause 

java.lang.ClassNotFoundException: antlr.RecognitionException
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
java.lang.ClassLoader.loadClass(ClassLoader.java:307)
java.lang.ClassLoader.loadClass(ClassLoader.java:252)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
java.lang.Class.getDeclaredMethods0(Native Method)
java.lang.Class.privateGetDeclaredMethods(Class.java:2427)


我的dao为 sql
String sql="select inves from InvestmentProject inves ,in(inves.subModes) subMode,in(msg.districts) dist where 1=1";
if((Integer)map.get("target") == 1){ 
if (!map.get("keyword").equals("")) {
sql+=" and inves.keyword like '%"+map.get("keyword")+"%' ";
}

}else if ((Integer)map.get("target") == 2){
if (!map.get("keyword").equals("")) {
sql+=" and inves.name like '%"+map.get("name")+"%' ";
}
}
 
if((Integer)map.get("industry")>0){
sql+=" and theIndustry.id="+(Integer)map.get("industry")+" ";
}

if(map.get("district_ids")!=null){
Set<Integer> set = (Set<Integer>)map.get("district_ids");
  相关解决方案