我用 proguard 混淆了我的 jar 应用程序。当我运行程序时,我收到以下错误:
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.**{*; }