[ 
https://issues.apache.org/jira/browse/HTRACE-233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14726891#comment-14726891
 ] 

Colin Patrick McCabe commented on HTRACE-233:
---------------------------------------------

Hi Cosmin,

Thanks for the bug report and patch.  I'm not sure why this hasn't shown up 
before.  For what it's worth, I am using maven 3.0.4 with Oracle Java 1.7.0_10.

Adding slf4j-api as an explicit dependency of the htrace-zipkin submodule seems 
pretty reasonable.  We already have the slf4j-nop dependency in that submodule, 
after all.

If you are adding the {{slf4j.version}} constant, can you also change the 
slf4j-nop stanza to use it here?  And add slf4j-api underneath slf4j-nop

{code}
    <!-- Zipkin specific deps. -->
    <dependency>
      <groupId>org.apache.thrift</groupId>
      <artifactId>libthrift</artifactId>
      <version>0.9.0</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-nop</artifactId>
      <version>1.5.8</version>
    </dependency>
{code}

+1 when that is resolved.

> htrace-zipkin CNFE  LoggerFactory from shade relocation
> -------------------------------------------------------
>
>                 Key: HTRACE-233
>                 URL: https://issues.apache.org/jira/browse/HTRACE-233
>             Project: HTrace
>          Issue Type: Bug
>    Affects Versions: master, 4.0
>            Reporter: Cosmin Lehene
>            Priority: Blocker
>             Fix For: 4.0
>
>         Attachments: HTRACE-233.patch
>
>
> {code}
>   at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
> Caused by: java.lang.NoClassDefFoundError: 
> org/apache/htrace/slf4j/LoggerFactory
>   at 
> org.apache.htrace.thrift.transport.TIOStreamTransport.<clinit>(TIOStreamTransport.java:38)
>   at 
> org.apache.htrace.impl.ZipkinSpanReceiver$WriteSpanRunnable.<init>(ZipkinSpanReceiver.java:214)
>   at 
> org.apache.htrace.impl.ZipkinSpanReceiver.configure(ZipkinSpanReceiver.java:178)
>   at 
> org.apache.htrace.impl.ZipkinSpanReceiver.<init>(ZipkinSpanReceiver.java:155)
>   ... 36 more
> Caused by: java.lang.ClassNotFoundException: 
> org.apache.htrace.slf4j.LoggerFactory
>   at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
>   at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
> {code}
> Looking in the jar I can only see the following classes
> {code}
> org/apache/htrace/slf4j/impl/NOPLoggerFactory.class
> org/apache/htrace/slf4j/impl/StaticLoggerBinder.class
> org/apache/htrace/slf4j/impl/StaticMarkerBinder.class
> org/apache/htrace/slf4j/impl/StaticMDCBinder.class
> {code}
> {{LoggerFactory}} is in {{slf4j-api}} which is not included explicitly and 
> not picked up during relocation.
> I'll send a patch



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to