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

John Roesler commented on KAFKA-7741:
-------------------------------------

Thanks for that thorough reply [~rhauch]!

Regarding the upgrade, correct: I was proposing to swap 
`{{javax.ws.rs:javax.ws.rs-api:2.1.0}}` to 
`{{jakarta.ws.rs:jakarta.ws.rs-api:2.1.3}}`, since there is no well-formed 
release of the javax dep (and also no newer release than 2.1.1). This is a 
Jakarta project as of 2.1.2.

Thanks for the explanation about the interaction with Jersey in the Connect 
worker. This is the context I was looking for. I'm guessing that Jersey also 
declares a dependency on the javax module, which raises the possibility of 
multiple problems with the Connect worker build:
 * it would have to explicitly exclude the javax depenency
 * the jakarta dependency cannot have changed any package names, class names, 
or method names
 * I'm still not 100% sure it would cause no problems.

On the other hand, if rs-api is only used in parts of the Connect API that are 
unused from Streams, perhaps the streams or streams-scala module should exclude 
the transitive dependency. I can confirm that excluding it in my test sbt build 
does allow the build to pass.

Actually, I think this is the best approach, so I will go ahead and propose to 
add an exclusion to the streams module.

In the long run, I would agree with splitting the converters out into another 
module. I was surprised to see the dependency on Connect, but I didn't look 
into it, so thanks for that explanation as well.

 

Finally, you're correct: in addition to adding the exclusion, I need to update 
the streams-scala docs. Since 2.0.0, 2.0.1, and 2.1.0 are immutably broken for 
SBT users, the fix needs to stay in the docs.

Since it seems like a pretty tidy solution, I'll go ahead and put together a PR 
to add the exclusion and update the docs.

Thanks,

-John

 

P.s.:

Regarding the minor point about my prior statement... I agree with your 
assessment, and actually that's what I meant with my gramatically ambiguous 
statement. The problem is with "Connect's dependency", i.e. a dependency that 
Connect declares, namely javax.ws.rs-api, not with Connect itself, or Streams's 
dependency on Connect.

The reason I said it at all wasn't to ascribe blame, just to say that I'm not 
sure why Connect added that dependency, or what role it plays, so I wanted 
someone like you to weigh in. Which you did! Thanks again, and sorry for the 
confusion.

And actually, I'd like to further state that AFAICT, there's actually nothing 
wrong with the javax.ws.rs-api pom itself, so I wouldn't ascribe blame to them 
either. It causes problems, to be sure, but the pom is well formed. It just 
seems to be making use of a maven feature which isn't compatible with SBT.

> Bad dependency via SBT
> ----------------------
>
>                 Key: KAFKA-7741
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7741
>             Project: Kafka
>          Issue Type: Bug
>          Components: core, KafkaConnect
>    Affects Versions: 2.1.0
>         Environment: Windows 10 professional, IntelliJ IDEA 2017.1
>            Reporter: sacha barber
>            Priority: Major
>
> I am using the Kafka-Streams-Scala 2.1.0 JAR.
> And if I create a new Scala project using SBT with these dependencies 
> {code}
> name := "ScalaKafkaStreamsDemo"
> version := "1.0"
> scalaVersion := "2.12.1"
> libraryDependencies += "org.apache.kafka" %% "kafka" % "2.0.0"
> libraryDependencies += "org.apache.kafka" % "kafka-clients" % "2.0.0"
> libraryDependencies += "org.apache.kafka" % "kafka-streams" % "2.0.0"
> libraryDependencies += "org.apache.kafka" %% "kafka-streams-scala" % "2.0.0"
> //TEST
> libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.5" % Test
> libraryDependencies += "org.apache.kafka" % "kafka-streams-test-utils" % 
> "2.0.0" % Test
> {code}
> I get this error
>  
> {code}
> SBT 'ScalaKafkaStreamsDemo' project refresh failed
> Error:Error while importing SBT project:<br/>...<br/><pre>[info] Resolving 
> jline#jline;2.14.1 ...
> [warn] [FAILED ] 
> javax.ws.rs#javax.ws.rs-api;2.1.1!javax.ws.rs-api.${packaging.type}: (0ms)
> [warn] ==== local: tried
> [warn] 
> C:\Users\sacha\.ivy2\local\javax.ws.rs\javax.ws.rs-api\2.1.1\${packaging.type}s\javax.ws.rs-api.${packaging.type}
> [warn] ==== public: tried
> [warn] 
> https://repo1.maven.org/maven2/javax/ws/rs/javax.ws.rs-api/2.1.1/javax.ws.rs-api-2.1.1.${packaging.type}
> [info] downloading 
> https://repo1.maven.org/maven2/org/apache/kafka/kafka-streams-test-utils/2.1.0/kafka-streams-test-utils-2.1.0.jar
>  ...
> [info] [SUCCESSFUL ] 
> org.apache.kafka#kafka-streams-test-utils;2.1.0!kafka-streams-test-utils.jar 
> (344ms)
> [warn] ::::::::::::::::::::::::::::::::::::::::::::::
> [warn] :: FAILED DOWNLOADS ::
> [warn] :: ^ see resolution messages for details ^ ::
> [warn] ::::::::::::::::::::::::::::::::::::::::::::::
> [warn] :: javax.ws.rs#javax.ws.rs-api;2.1.1!javax.ws.rs-api.${packaging.type}
> [warn] ::::::::::::::::::::::::::::::::::::::::::::::
> [trace] Stack trace suppressed: run 'last *:ssExtractDependencies' for the 
> full output.
> [trace] Stack trace suppressed: run 'last *:update' for the full output.
> [error] (*:ssExtractDependencies) sbt.ResolveException: download failed: 
> javax.ws.rs#javax.ws.rs-api;2.1.1!javax.ws.rs-api.${packaging.type}
> [error] (*:update) sbt.ResolveException: download failed: 
> javax.ws.rs#javax.ws.rs-api;2.1.1!javax.ws.rs-api.${packaging.type}
> [error] Total time: 8 s, completed 16-Dec-2018 19:27:21
> Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=384M; 
> support was removed in 8.0</pre><br/>See complete log in <a 
> href="file:/C:/Users/sacha/.IdeaIC2017.1/system/log/sbt.last.log">file:/C:/Users/sacha/.IdeaIC2017.1/system/log/sbt.last.log</a>
> {code}
> This seems to be a common issue with bad dependency from Kafka to 
> javax.ws.rs-api.
> if I drop the Kafka version down to 2.0.0 and add this line to my SBT file 
> this error goes away
> {code}
> libraryDependencies += "javax.ws.rs" % "javax.ws.rs-api" % "2.1" 
> artifacts(Artifact("javax.ws.rs-api", "jar", "jar"))`
> {code}
>  
> However I would like to work with 2.1.0 version.
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to