Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Does Java 9 modules can help with solving dependency conflict? I have included two dependencies, protobuf-java and protobuf-lite, they both contains the same classes under the same packages (FQN), the problem is implementations differs a bit from each other. Both dependencies comes from two different jars and i need both in single module. The problem is, that class loader takes just the first one on the classpath which leads to unexpected behavior like NoSuchMethodError or NoClassDefFoundError.

Do you have any idea how can I solve this problem? I guess i have to force loading these dependencies by different class loaders, right? Could you provide some examples which shows how to deal with it?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
913 views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...