0

I previously built a Javafx application and successfully wrapped it with proguard, while using java.util.Logger. However, I need to switch from java.util.Logger to the Logger provided by slf4j and use qos-logback. When I use proguard on it, I run into an array of warnings, all generated from either of the slf4j or the qos-logback library. Some of the (MANYYY) warnings are:

  • Warning: ch.qos.logback.core.status.ViewStatusMessagesServletBase: can't find referenced class javax.servlet.http.HttpServletResponse
  • Warning: ch.qos.logback.core.status.ViewStatusMessagesServletBase: can't find referenced class javax.servlet.http.HttpServletRequest
  • Warning: ch.qos.logback.core.status.ViewStatusMessagesServletBase: can't find referenced class javax.servlet.http.HttpServletResponse
  • Warning: ch.qos.logback.core.status.ViewStatusMessagesServletBase: can't find referenced class javax.servlet.http.HttpServletRequest
  • Warning: ch.qos.logback.core.status.ViewStatusMessagesServletBase: can't find referenced class javax.servlet.http.HttpServletResponse
  • Warning: ch.qos.logback.core.status.ViewStatusMessagesServletBase: can't find referenced class javax.servlet.http.HttpServletRequest
  • Warning: ch.qos.logback.core.status.ViewStatusMessagesServletBase: can't find referenced class javax.servlet.http.HttpServletResponse
  • Warning: org.slf4j.MDC: can't find referenced method 'org.slf4j.impl.StaticMDCBinder getSingleton()' in program class org.slf4j.impl.StaticMDCBinder
  • Warning: org.slf4j.MarkerFactory: can't find referenced method 'org.slf4j.impl.StaticMarkerBinder getSingleton()' in program class org.slf4j.impl.StaticMarkerBinder
  • Note: ch.qos.logback.classic.gaffer.GafferUtil accesses a constructor '(ch.qos.logback.classic.LoggerContext)' dynamically

If you notice, some of the warnings are even repeating. I will be really grateful if anyone can help me out regarding this, even if it's just pointing me in the right direction since I've been stuck on it for a while. Many thanks in advance.

sbsatter
  • 591
  • 3
  • 22

1 Answers1

0

After a lot of effort, I sort of got things done.

I had to add the following to the config:

-keep,allowshrinking class ch.qos.logback.core.status.ViewStatusMessagesServletBase {
    <fields>;
    <methods>;
}

I also needed to inspect the warnings to find the source and had to add servlet-api.jar separately as a library.

sbsatter
  • 591
  • 3
  • 22