3
我用proguard混淆了我的jar應用程序。當我運行該程序,我收到以下錯誤:ProGuard java和反射
java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflec
t.ParameterizedType
at gr.analysis.synchronizer.bridge.dao.HibernateDAO.HibernateGenericDAO.
<init>(Unknown Source)
at gr.analysis.synchronizer.bridge.dao.HibernateDAO.HibernateDBSynchroni
zerDAO.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at gr.analysis.synchronizer.bridge.dao.HibernateDAO.HibernateBridgeDAOFactory.instantiateDAO(Unknown Source)
at gr.analysis.synchronizer.bridge.dao.HibernateDAO.HibernateBridgeDAOFactory.getDBSynchronizerDAO(Unknown Source)
at gr.analysis.synchronizer.forms.synchronizer.SynchronizersDialog.initSynchronizers(Unknown Source)
at gr.analysis.synchronizer.forms.synchronizer.SynchronizersDialog.perform(Unknown Source)
at gr.analysis.synchronizer.forms.synchronizer.SynchronizersDialog.access$1400(Unknown Source)
at gr.analysis.synchronizer.forms.synchronizer.SynchronizersDialog$13$1.
run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
ERROR [Performer] (?:?) - java.lang.RuntimeException: Can not instantiate DAO: class gr.analysis.synchronizer.bridge.dao.HibernateDAO.HibernateDBSynchronizerDAO
我用註釋和DAO模式休眠
proguard相關的配置是:
-dontnote
-verbose
-printmapping out.map
-keepattributes *Annotation*
-keepdirectories
# The main entry points.
-keep public class gr.analysis.synchronizer.ApplicationSupport {
public static void main(java.lang.String[]);
}
-keep class gr.analysis.synchronizer.**{*; }