proguard-找不到apache cxf/java.lang.illegalargumentexception的公共超类异常

c6ubokkw  于 2021-07-03  发布在  Java
关注(0)|答案(1)|浏览(398)

当我尝试用proguard构建时,我遇到了这样的异常

Class       = [org/apache/cxf/io/CachedOutputStream]
  Class       = [org/apache/cxf/io/CachedWriter]
  Method      = [getInputStream()Ljava/io/InputStream;]
  Method      = [getReader()Ljava/io/Reader;]
  Exception   = [java.lang.IllegalArgumentException] (Can't find common super class of [org/apache/cxf/io/CachedOutputStream$TransferableFileInputStream] (with 4 known super classes) and [org/apache/cxf/io/CachedOutputStream$1] (with 1 known super classes))

我用的是-java8-渐变6.7-proguard 6.2.2
我在互联网上搜索了这个异常,尝试了很多配置,但都没有成功。我无法传递这个异常。我不太了解proguard,所以需要一些关于这个异常的帮助。
我的proguard.txt

-libraryjars  <java.home>/lib/rt.jar

-printmapping proguard.map

-dontnote
-dontskipnonpubliclibraryclassmembers
-dontskipnonpubliclibraryclasses

-keepattributes SourceFile, LineNumberTable
-keepattributes *Annotation*,EnclosingMethod,Signature
-keepnames public class * {
  public static**classTag();
  }
-keepclasseswithmembers public class * {
   public static void main(java.lang.String[]);
  }

-keepclassmembers class * {

**MODULE$;

  } 
-keepclasseswithmembernames,includedescriptorclasses class * {
  native <methods>;
  }  

-keepclassmembers,allowoptimization enum * {
  public static**[] values();
  public static**valueOf(java.lang.String);
  }  
-optimizations !method/inlining/*

-keep class com.fasterxml.jackson.**{ *; }
-keep class java.io.**{*;}
-keep class org.everit.json.**{ *; }
-keep class org.json.**{ *; }
-keep class org.slf4j.**{ *; }
-keep class javax.crypto.**{ *; }
-keep class org.apache.**{ *; }
-keep class org.springframework.**{ *; }
-keep class org.pf4j.**{ *; }
-keep class org.jboss.**{ *; }
-keep class nl.basjes.**{ *; }
-keep class kotlin.**{ *; }
-keep class com.esotericsoftware.**{ *; }
-keep class javax.mail.**{ *; }
-keep class com.sun.**{ *; }
-keep class org.bouncycastle.**{ *; }
-keep class org.eclipse.jetty.**{ *; }
-keep class com.jcraft.**{ *; }
-keep class com.google.**{ *; }
-keep class javax.ejb.**{ *; }
-keep class gnu.io.**{ *; }
-keep class com.barchart.**{ *; }
-keep class com.zaxxer.hikari.**{ *; }
-keep class org.codehaus.**{ *; }
-keep class groovy.lang.**{ *; }
-keep class org.jvnet.**{ *; }
-keep class com.typesafe.**{ *; }
-keep class org.osgi.**{ *; }
-keep class javax.servlet.**{ *; }
-keep class org.relaxng.**{ *; }
-keep class com.bea.**{ *; }
-keep class org.locationtech.**{ *; }
-keep class org.mockito.**{ *; }
-keep class commonj.work.**{ *; }
-keep class javax.transaction.**{ *; }
-keep class org.quartz.**{ *; }
-keep class org.terracotta.**{ *; }
-keep class joptsimple.**{ *; }
-keep class javax.xml.**{ *; }
-keep class reactor.**{ *; }
-keep class org.wildfly.**{ *; }
-keep class org.postgresql.**{ *; }
-keep class org.tartarus.**{ *; }
-keep class org.mozilla.**{ *; }
-keep class org.joda.**{ *; }
-keep class org.jgroups.**{ *; }
-keep class org.elasticsearch.**{ *; }
-keep class org.w3.**{ *; }
-keep class org.openxmlformats.**{ *; }
-keep class org.etsi.**{ *; }
-keep class com.microsoft.**{ *; }
-keep class org.apache.cxf.io.*$* { *; }

-dontwarn com.fasterxml.jackson.**
-dontwarn org.everit.**
-dontwarn org.json.**
-dontwarn org.slf4j.**
-dontwarn javax.crypto.**
-dontwarn org.springframework.**
-dontwarn org.pf4j.**
-dontwarn com.ihs.tmg.**
-dontwarn org.jboss.**
-dontwarn nl.basjes.**
-dontwarn kotlin.**
-dontwarn com.esotericsoftware.**
-dontwarn javax.mail.**
-dontwarn com.sun.**
-dontwarn org.bouncycastle.**
-dontwarn org.eclipse.jetty.**
-dontwarn com.jcraft.**
-dontwarn com.google.**
-dontwarn javax.ejb.**
-dontwarn gnu.io.**
-dontwarn com.barchart.**
-dontwarn com.zaxxer.hikari.**
-dontwarn org.codehaus.**
-dontwarn groovy.lang.**
-dontwarn org.jvnet.**
-dontwarn com.typesafe.**
-dontwarn org.osgi.**
-dontwarn javax.servlet.**
-dontwarn org.relaxng.**
-dontwarn com.bea.**
-dontwarn org.locationtech.**
-dontwarn org.mockito.**
-dontwarn commonj.work.**
-dontwarn javax.transaction.**
-dontwarn org.quartz.**
-dontwarn org.terracotta.**
-dontwarn joptsimple.**
-dontwarn javax.xml.**
-dontwarn reactor.**
-dontwarn org.wildfly.**
-dontwarn org.postgresql.**
-dontwarn org.tartarus.**
-dontwarn org.mozilla.**
-dontwarn org.joda.**
-dontwarn org.jgroups.**
-dontwarn org.elasticsearch.**
-dontwarn org.apache.cxf.io.**
-dontwarn org.springframewrok.context.**
-dontwarn java.io.**
-dontwarn org.w3.**
-dontwarn org.openxmlformats.**
-dontwarn com.microsoft.**
-dontwarn org.etsi.**
-dontwarn org.apache.commons.**
-dontwarn org.apache.xmlbeans.**
-dontwarn org.apache.lucene.**
-dontwarn org.apache.neethi.**
-dontwarn org.apache.poi.**
-dontwarn org.apache.tika.**
-dontwarn org.apache.activemq.**
-dontwarn com.mchange.**
-dontwarn io.netty.**
-dontwarn org.apache.xerces.**
-dontwarn org.apache.aries.**
-dontwarn javax.validation.**
-dontwarn org.apache.cxf.staxutils.**
-dontwarn  org.apache.cxf.tools.**
-dontwarn org.apache.cxf.common.**
-dontwarn org.apache.log4j.**
-dontwarn  net.sf.**
-dontwarn  org.apache.cxf.binding.**
-dontwarn  org.apache.cxf.jaxws.**
-dontwarn  org.apache.cxf.transport.**
-dontwarn  org.apache.cxf.endpoint.**
-dontwarn  org.apache.cxf.io.**
epfja78i

epfja78i1#

我终于找到了解决办法。添加到proguard.txt此行

-libraryjars  <java.home>/lib/jce.jar

相关问题