title: java.util.ServiceConfigurationError: org.apache.juli.logging.Log: org.eclipse.jetty.apache.jsp.JuliLog not a subtype
body: <p>I am trying to port over a project written over a decade ago to Java 11.</p>
  <p>After a couple days and some progress, I'm stuck at this error:</p>
  <pre class="lang-java prettyprint-override"><code>Caused by: 
  java.util.ServiceConfigurationError: org.apache.juli.logging.Log: org.eclipse.jetty.apache.jsp.JuliLog not a subtype
      at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:588)
      at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1236)
  ...
  </code></pre>
  <p>If I <code>jar -xf</code> my uberjar and (rip)grep through it, I see both the <code>JuliLog</code> and <code>juli.logging</code> versions:</p>
  <pre><code>rg  &quot;JuliLog|juli\.logging&quot;
  jar/META-INF/services/org.apache.juli.logging.Log
  1:org.eclipse.jetty.apache.jsp.JuliLog
  
  jar/META-INF/maven/org.mortbay.jasper/apache-jsp/pom.xml
  216:              filter:=&quot;(osgi.serviceloader=org.apache.juli.logging.Log)&quot;;resolution:=optional;cardinality:=multiple,
  235:                  org.apache.juli.logging;version=&quot;${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}&quot;,
  
  jar/META-INF/maven/org.eclipse.jetty/apache-jsp/pom.xml
  28:            &lt;Provide-Capability&gt;osgi.serviceloader;osgi.serviceloader=javax.servlet.ServletContainerInitializer,osgi.serviceloader;osgi.serviceloader=org.apache.juli.logging.Log&lt;/Provide-Capability&gt;
  45:                &lt;exclude&gt;META-INF/services/org.apache.juli.logging.Log&lt;/exclude&gt;
  </code></pre>
  <p>From that, I saw different <code>groupId</code>s for the same <code>apache-jsp</code> artifact, but it turns out one is a dependency of the other:</p>
  <pre><code>mvn dependency:tree  | grep -i apache-jsp -C5
  ...
  [INFO] +- org.eclipse.jetty:jetty-servlet:jar:9.4.31.v20200723:compile
  [INFO] |  \- org.eclipse.jetty:jetty-security:jar:9.4.31.v20200723:compile
  [INFO] +- org.eclipse.jetty:jetty-webapp:jar:9.4.31.v20200723:compile
  [INFO] +- org.eclipse.jetty:jetty-xml:jar:9.4.31.v20200723:compile
  [INFO] |  \- org.eclipse.jetty:jetty-util:jar:9.4.31.v20200723:compile
  [INFO] +- org.eclipse.jetty:apache-jsp:jar:9.4.31.v20200723:compile
  [INFO] |  +- org.eclipse.jetty.toolchain:jetty-schemas:jar:3.1.2:compile
  [INFO] |  +- org.mortbay.jasper:apache-jsp:jar:8.5.54:compile
  [INFO] |  |  +- org.mortbay.jasper:apache-el:jar:8.5.54:compile
  ...
  </code></pre>
  <p>In my pom, I only specify the eclipse <code>apache-jsp</code>, which I'm including to prevent an error relating to lack of JSP support (<code>2020-09-15 10:08:50.037:INFO:oejw.StandardDescriptorProcessor:main: NO JSP Support for /my-application, did not find org.eclipse.jetty.jsp.JettyJspServlet</code>)</p>
  <p>The other questions on StackOverflow were relating to dependencies on tomcat (<a href="https://github.com/eclipse/jetty.project/issues/992" rel="nofollow noreferrer">either</a> <a href="https://stackoverflow.com/questions/55845873/java-util-serviceconfigurationerror-org-apache-juli-logging-log-provider-org-e">explicitly</a> or <a href="https://stackoverflow.com/questions/32643530/classpath-issue-between-jetty-maven-plugin-and-tomcat-jdbc-8-0-9-leading-to-ser">via</a> <a href="https://stackoverflow.com/questions/30143618/vaadin-jetty-spring-data-maven-exception">Spring</a>) or <a href="https://stackoverflow.com/questions/43639508/nosuchmethoderror-org-eclipse-jetty-websocket-server-websocketserverfactory-in">gwt</a>. I have none of those, but I do have some dependencies on other jetty jars, if that matters:</p>
  <pre class="lang-sh prettyprint-override"><code>mvn dependency:tree  | grep -i tomcat -C5
  # no results
  mvn dependency:tree  | grep -i gwt -C5
  # no results
  mvn dependency:tree  | grep -i jetty -C5
  ...
  [INFO] +- org.eclipse.jetty:jetty-server:jar:9.4.31.v20200723:compile
  [INFO] |  +- org.eclipse.jetty:jetty-http:jar:9.4.31.v20200723:compile
  [INFO] |  \- org.eclipse.jetty:jetty-io:jar:9.4.31.v20200723:compile
  [INFO] +- org.eclipse.jetty:jetty-servlet:jar:9.4.31.v20200723:compile
  [INFO] |  \- org.eclipse.jetty:jetty-security:jar:9.4.31.v20200723:compile
  [INFO] +- org.eclipse.jetty:jetty-webapp:jar:9.4.31.v20200723:compile
  [INFO] +- org.eclipse.jetty:jetty-xml:jar:9.4.31.v20200723:compile
  [INFO] |  \- org.eclipse.jetty:jetty-util:jar:9.4.31.v20200723:compile
  [INFO] +- org.eclipse.jetty:apache-jsp:jar:9.4.31.v20200723:compile
  [INFO] |  +- org.eclipse.jetty.toolchain:jetty-schemas:jar:3.1.2:compile
  [INFO] |  +- org.mortbay.jasper:apache-jsp:jar:8.5.54:compile
  [INFO] |  |  +- org.mortbay.jasper:apache-el:jar:8.5.54:compile
  [INFO] |  |  \- org.eclipse.jdt:ecj:jar:3.19.0:compile
  [INFO] |  \- org.eclipse.jetty:jetty-annotations:jar:9.4.31.v20200723:compile
  [INFO] |     +- org.eclipse.jetty:jetty-plus:jar:9.4.31.v20200723:compile
  [INFO] |     |  \- org.eclipse.jetty:jetty-jndi:jar:9.4.31.v20200723:compile
  ...
  </code></pre>
  <p>Other solutions were explicitly excluding <code>apache-jsp</code> from the project, but this is what is providing my JSP support, so that doesn't work for me.</p>
  <p>I thought I could use an <code>&lt;exclusion&gt;</code>, but <code>mvn dependency:tree  | grep -i juli -C5</code> returns no results, so I'm not sure how I could add one here.</p>
  <hr />
  <p><strong>Update</strong>: Thanks to Joakim, I was able to significantly clean up my jar by <code>&lt;exclusion&gt;</code>ing a bunch of duplicate classes, to the point my only duplicates are <code>about.html</code> files and some overlap between jmockit and junit:</p>
  <pre class="lang-sh prettyprint-override"><code>mvn org.basepom.maven:duplicate-finder-maven-plugin:check
  
  ...
  [INFO] Checking compile classpath
  [INFO] Checking runtime classpath
  [INFO] Checking test classpath
  [WARNING] Found duplicate and different resources in [org.eclipse.jdt:ecj:3.19.0, org.eclipse.jetty.toolchain:jetty-schemas:3.1.2, org.eclipse.jetty:apache-jsp:9.4.31.v20200723, org.eclipse.jetty:jetty-annotations:9.4.31.v20200723, org.eclipse.jetty:jetty-http:9.4.31.v20200723, org.eclipse.jetty:jetty-io:9.4.31.v20200723, org.eclipse.jetty:jetty-jndi:9.4.31.v20200723, org.eclipse.jetty:jetty-plus:9.4.31.v20200723, org.eclipse.jetty:jetty-security:9.4.31.v20200723, org.eclipse.jetty:jetty-server:9.4.31.v20200723, org.eclipse.jetty:jetty-servlet:9.4.31.v20200723, org.eclipse.jetty:jetty-util:9.4.31.v20200723, org.eclipse.jetty:jetty-webapp:9.4.31.v20200723, org.eclipse.jetty:jetty-xml:9.4.31.v20200723, org.eclipse.jgit:org.eclipse.jgit:1.0.0.201106090707-r]:
  [WARNING]   about.html
  [WARNING] Found duplicate and different resources in [org.eclipse.jdt:ecj:3.19.0, org.eclipse.jetty.toolchain:jetty-schemas:3.1.2, org.eclipse.jetty:apache-jsp:9.4.31.v20200723, org.eclipse.jetty:jetty-annotations:9.4.31.v20200723, org.eclipse.jetty:jetty-http:9.4.31.v20200723, org.eclipse.jetty:jetty-io:9.4.31.v20200723, org.eclipse.jetty:jetty-jndi:9.4.31.v20200723, org.eclipse.jetty:jetty-plus:9.4.31.v20200723, org.eclipse.jetty:jetty-security:9.4.31.v20200723, org.eclipse.jetty:jetty-server:9.4.31.v20200723, org.eclipse.jetty:jetty-servlet:9.4.31.v20200723, org.eclipse.jetty:jetty-util:9.4.31.v20200723, org.eclipse.jetty:jetty-webapp:9.4.31.v20200723, org.eclipse.jetty:jetty-xml:9.4.31.v20200723, org.eclipse.jgit:org.eclipse.jgit:1.0.0.201106090707-r]:
  [WARNING]   about.html
  [WARNING] Found duplicate and different classes in [com.googlecode.jmockit:jmockit:1.7, junit:junit:4.11]:
  [WARNING]   junit.framework.TestResult
  [WARNING]   org.junit.runner.Runner
  [WARNING] Found duplicate and different resources in [org.eclipse.jdt:ecj:3.19.0, org.eclipse.jetty.toolchain:jetty-schemas:3.1.2, org.eclipse.jetty:apache-jsp:9.4.31.v20200723, org.eclipse.jetty:jetty-annotations:9.4.31.v20200723, org.eclipse.jetty:jetty-http:9.4.31.v20200723, org.eclipse.jetty:jetty-io:9.4.31.v20200723, org.eclipse.jetty:jetty-jndi:9.4.31.v20200723, org.eclipse.jetty:jetty-plus:9.4.31.v20200723, org.eclipse.jetty:jetty-security:9.4.31.v20200723, org.eclipse.jetty:jetty-server:9.4.31.v20200723, org.eclipse.jetty:jetty-servlet:9.4.31.v20200723, org.eclipse.jetty:jetty-util:9.4.31.v20200723, org.eclipse.jetty:jetty-webapp:9.4.31.v20200723, org.eclipse.jetty:jetty-xml:9.4.31.v20200723, org.eclipse.jgit:org.eclipse.jgit:1.0.0.201106090707-r]:
  [WARNING]   about.html
  ...
  </code></pre>
  <p>Unfortunately, this did not solve my issue.</p>