I made a few tweaks to my config, but still having issues. I can’t figure out what things I need to exclude (which I guess means ‘keep’). Not sure if my config is correct.
Posting my log, followed by my Proguard config and the mapping file (the maping file is big, so I’m only posting part of it)
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.torchai.service.synthetic.NexusSyntheticGraphqlApplication]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'a' for bean class [com.torchai.service.synthetic.a.a] conflicts with existing, non-compatible bean definition of same name and class [com.torchai.service.synthetic.configuration.a]
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:189)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:782)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:774)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:439)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:339)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1340)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1329)
at com.torchai.service.synthetic.NexusSyntheticGraphqlApplication.main(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'a' for bean class [com.torchai.service.synthetic.a.a] conflicts with existing, non-compatible bean definition of same name and class [com.torchai.service.synthetic.configuration.a]
at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.checkCandidate(ClassPathBeanDefinitionScanner.java:349)
at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:287)
at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:132)
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:296)
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:207)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:175)
... 22 common frames omitted
Config
-target 1.8 ##Specify the java version number
-printseeds
-printmapping obfuscation.map
-dontshrink ##Default is enabled, here the shrink is turned off, that is, the unused classes/members are not deleted.
-dontoptimize ##Default is enabled, here to turn off bytecode level optimization
-useuniqueclassmembernames ## Take a unique strategy for confusing the naming of class members
-adaptclassstrings ## After confusing the class name, replace it with a place like Class.forName('className')
-dontnote
-ignorewarnings
-dontwarn
-keep public class * extends org.springframework.boot.web.servlet.support.SpringBootServletInitializer
-keepdirectories
-keepclasseswithmembers public class * { public static void main(java.lang.String[]);} ##Maintain the class of the main method and its method name
-keepclassmembers enum * { *; } ##Reserving enumeration members and methods
-keepclassmembers class * {
@org.springframework.beans.factory.annotation.Autowired *;
@org.springframework.beans.factory.annotation.Qualifier *;
@org.springframework.beans.factory.annotation.Value *;
@org.springframework.security.access.prepost.PreAuthorize <methods>;
@org.springframework.beans.factory.annotation.Required *;
@org.springframework.context.annotation.Bean *;
@org.springframework.context.annotation.Primary *;
@org.springframework.boot.context.properties.ConfigurationProperties *;
@org.springframework.boot.context.properties.EnableConfigurationProperties *;
@javax.annotation.PostConstruct *;
@javax.annotation.PreDestroy *;
}
-keep @org.springframework.cache.annotation.EnableCaching class *
-keep @org.springframework.context.annotation.Configuration class *
-keep @org.springframework.boot.context.properties.ConfigurationProperties class *
-keep @org.springframework.boot.autoconfigure.SpringBootApplication class *
-keep public @org.springframework.stereotype.Component class **
-allowaccessmodification
-keepattributes *Annotation*
-keepclassmembers class * {
*** get*();
void set*(***);
}
-keepclassmembernames class * {
java.lang.Class class$(java.lang.String);
java.lang.Class class$(java.lang.String, boolean);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
public static ** fromValue(java.lang.String);
}
-keepnames class * implements java.io.Serializable
#-keepclassmembernames public class com.test.blah.config.liquibase.AsyncSpringLiquibase
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
!static !transient <fields>;
!private <fields>;
!private <methods>;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
Mapping
com.torchai.service.synthetic.NexusSyntheticGraphqlApplication -> com.torchai.service.synthetic.NexusSyntheticGraphqlApplication:
void <init>() -> <init>
void main(java.lang.String[]) -> main
com.torchai.service.synthetic.authorization.AuthorizationRules -> com.torchai.service.synthetic.authorization.AuthorizationRules:
com.torchai.security.jwt.domain.Role administrator -> a
void <init>() -> <init>
void allowsAdministration(com.torchai.security.jwt.domain.SecurityContext) -> a
void <clinit>() -> <clinit>
com.torchai.service.synthetic.client.gpt.ClientException -> com.torchai.service.synthetic.client.gpt.ClientException:
void <init>() -> <init>
void <init>(java.lang.String) -> <init>
void <init>(java.lang.String,java.lang.Throwable) -> <init>
void <init>(java.lang.Throwable) -> <init>
void <init>(java.lang.String,java.lang.Throwable,boolean,boolean) -> <init>
com.torchai.service.synthetic.client.gpt.Gpt3Client -> com.torchai.service.synthetic.client.gpt.a:
java.lang.String secretKey -> secretKey
boolean wiretap -> b
void <init>() -> <init>
void wiretap() -> a
java.util.List completion(com.torchai.service.synthetic.client.gpt.OpenAiEngine,com.torchai.service.synthetic.client.gpt.state.CompletionRequest) -> a
org.springframework.web.reactive.function.client.WebClient getClient() -> getClient
java.net.URI lambda$completion$0(com.torchai.service.synthetic.client.gpt.OpenAiEngine,org.springframework.web.util.UriBuilder) -> a
com.torchai.service.synthetic.client.gpt.GptException -> com.torchai.service.synthetic.client.gpt.GptException:
void <init>() -> <init>
void <init>(java.lang.String) -> <init>
void <init>(java.lang.String,java.lang.Throwable) -> <init>
void <init>(java.lang.Throwable) -> <init>
void <init>(java.lang.String,java.lang.Throwable,boolean,boolean) -> <init>
com.torchai.service.synthetic.client.gpt.LoaderException -> com.torchai.service.synthetic.client.gpt.LoaderException:
void <init>() -> <init>
void <init>(java.lang.String) -> <init>
void <init>(java.lang.String,java.lang.Throwable) -> <init>
void <init>(java.lang.Throwable) -> <init>
void <init>(java.lang.String,java.lang.Throwable,boolean,boolean) -> <init>
com.torchai.service.synthetic.client.gpt.OpenAiEngine -> com.torchai.service.synthetic.client.gpt.OpenAiEngine:
com.torchai.service.synthetic.client.gpt.OpenAiEngine ada -> ada
com.torchai.service.synthetic.client.gpt.OpenAiEngine babbage -> babbage
com.torchai.service.synthetic.client.gpt.OpenAiEngine curie -> curie
com.torchai.service.synthetic.client.gpt.OpenAiEngine curie_instruct -> curie_instruct
com.torchai.service.synthetic.client.gpt.OpenAiEngine davinci_instruct -> davinci_instruct
com.torchai.service.synthetic.client.gpt.OpenAiEngine davinci -> davinci
int relativePricing -> relativePricing
java.lang.String name -> name
com.torchai.service.synthetic.client.gpt.OpenAiEngine[] $VALUES -> $VALUES
com.torchai.service.synthetic.client.gpt.OpenAiEngine[] values() -> values
com.torchai.service.synthetic.client.gpt.OpenAiEngine valueOf(java.lang.String) -> valueOf
void <init>(java.lang.String,int,int,java.lang.String) -> <init>
int getRelativePricing() -> getRelativePricing
java.lang.String getName() -> getName
void <clinit>() -> <clinit>
com.torchai.service.synthetic.client.gpt.PromptLoader -> com.torchai.service.synthetic.client.gpt.PromptLoader:
void <init>() -> <init>
java.lang.String load(java.lang.String) -> a
com.torchai.service.synthetic.client.gpt.TokenLoader -> com.torchai.service.synthetic.client.gpt.b:
java.lang.String SECRET_TOKEN_KEY -> c
java.lang.String OPENAI_PROPERTIES -> d
void <init>() -> <init>
java.lang.String getSecretKeyToken() -> getSecretKeyToken
com.torchai.service.synthetic.client.gpt.prompt.AbstractPromptExemplar -> com.torchai.service.synthetic.client.gpt.a.a:
java.lang.String tag -> e
java.lang.String example -> f
void <init>(java.lang.String,java.lang.String) -> <init>
java.lang.String getTag() -> getTag
java.lang.String getExample() -> getExample
com.torchai.service.synthetic.client.gpt.prompt.BookAuthorExample -> com.torchai.service.synthetic.client.gpt.a.b:
java.lang.String tag -> e
void <init>(java.lang.String) -> <init>
com.torchai.service.synthetic.client.gpt.prompt.BookExample -> com.torchai.service.synthetic.client.gpt.a.c:
java.lang.String tag -> e
void <init>(java.lang.String) -> <init>
com.torchai.service.synthetic.client.gpt.prompt.MovieExample -> com.torchai.service.synthetic.client.gpt.a.d:
java.lang.String tag -> e
void <init>(java.lang.String) -> <init>
com.torchai.service.synthetic.client.gpt.prompt.MusicalArtistExample -> com.torchai.service.synthetic.client.gpt.a.e:
java.lang.String tag -> e
void <init>(java.lang.String) -> <init>
com.torchai.service.synthetic.client.gpt.prompt.PromptExemplar -> com.torchai.service.synthetic.client.gpt.a.f:
java.lang.String getTag() -> getTag
java.lang.String getExample() -> getExample
com.torchai.service.synthetic.client.gpt.prompt.QuoteExample -> com.torchai.service.synthetic.client.gpt.a.g:
java.lang.String tag -> e
void <init>(java.lang.String) -> <init>
com.torchai.service.synthetic.client.gpt.prompt.TelevisionShowExample -> com.torchai.service.synthetic.client.gpt.a.h:
java.lang.String tag -> e
void <init>(java.lang.String) -> <init>
com.torchai.service.synthetic.client.gpt.state.Choice -> com.torchai.service.synthetic.client.gpt.b.a:
java.lang.String text -> g
java.lang.Integer index -> h
java.lang.Object logprobs -> i
java.lang.String finish_reason -> j
void <init>() -> <init>
java.lang.String getText() -> getText
java.lang.Integer getIndex() -> getIndex
java.lang.Object getLogprobs() -> getLogprobs
java.lang.String getFinish_reason() -> getFinish_reason
void setText(java.lang.String) -> setText
void setIndex(java.lang.Integer) -> setIndex
void setLogprobs(java.lang.Object) -> setLogprobs
void setFinish_reason(java.lang.String) -> setFinish_reason
boolean equals(java.lang.Object) -> equals
boolean canEqual(java.lang.Object) -> a
int hashCode() -> hashCode
java.lang.String toString() -> toString
com.torchai.service.synthetic.client.gpt.state.Completion -> com.torchai.service.synthetic.client.gpt.b.b:
java.lang.String id -> k
java.lang.String object -> l
long created -> m
java.lang.String model -> n
java.util.List choices -> o
void <init>() -> <init>
java.lang.String getId() -> getId
java.lang.String getObject() -> getObject
long getCreated() -> getCreated
java.lang.String getModel() -> getModel
java.util.List getChoices() -> getChoices
void setId(java.lang.String) -> setId
void setObject(java.lang.String) -> setObject
void setCreated(long) -> setCreated
void setModel(java.lang.String) -> setModel
void setChoices(java.util.List) -> setChoices
boolean equals(java.lang.Object) -> equals
boolean canEqual(java.lang.Object) -> a
int hashCode() -> hashCode
java.lang.String toString() -> toString
com.torchai.service.synthetic.client.gpt.state.CompletionRequest -> com.torchai.service.synthetic.client.gpt.b.c:
java.lang.String prompt -> p
java.lang.Integer max_tokens -> q
java.lang.Double temperature -> r
java.lang.Double top_p -> s
java.lang.Integer n -> t
java.lang.Boolean stream -> u
java.lang.Integer logprobs -> v
java.lang.Boolean echo -> w
java.util.List stop -> x
java.lang.Double presence_penalty -> y
java.lang.Double frequency_penalty -> z
java.lang.Integer bestOf -> A
void <init>(java.lang.String,java.lang.Integer,java.lang.Double,java.lang.Double,java.lang.Integer,java.lang.Boolean,java.lang.Integer,java.lang.Boolean,java.util.List,java.lang.Double,java.lang.Double,java.lang.Integer) -> <init>
com.torchai.service.synthetic.client.gpt.state.CompletionRequest$CompletionRequestBuilder builder() -> b
java.lang.String getPrompt() -> getPrompt
java.lang.Integer getMax_tokens() -> getMax_tokens
java.lang.Double getTemperature() -> getTemperature
java.lang.Double getTop_p() -> getTop_p
java.lang.Integer getN() -> getN
java.lang.Boolean getStream() -> getStream
java.lang.Integer getLogprobs() -> getLogprobs
java.lang.Boolean getEcho() -> getEcho
java.util.List getStop() -> getStop
java.lang.Double getPresence_penalty() -> getPresence_penalty
java.lang.Double getFrequency_penalty() -> getFrequency_penalty
java.lang.Integer getBestOf() -> getBestOf
void setPrompt(java.lang.String) -> setPrompt
void setMax_tokens(java.lang.Integer) -> setMax_tokens
void setTemperature(java.lang.Double) -> setTemperature
void setTop_p(java.lang.Double) -> setTop_p
void setN(java.lang.Integer) -> setN
void setStream(java.lang.Boolean) -> setStream
void setLogprobs(java.lang.Integer) -> setLogprobs
void setEcho(java.lang.Boolean) -> setEcho
void setStop(java.util.List) -> setStop
void setPresence_penalty(java.lang.Double) -> setPresence_penalty
void setFrequency_penalty(java.lang.Double) -> setFrequency_penalty
void setBestOf(java.lang.Integer) -> setBestOf
boolean equals(java.lang.Object) -> equals
boolean canEqual(java.lang.Object) -> a
int hashCode() -> hashCode
java.lang.String toString() -> toString