1

I was using Chronicle Queue in a project that does not have Lombok. Everything was okey. Then I tried to use same Maven dependency in a project that have Lombok dependency. But it crashed this time. I see the below error in my all Lombok Getter and Setter annotations.

The package java.lang is accessible from more than one module: <unnamed>, java.base

I can run the project. But Eclipse shows red warning in classes that use Lombok annotations. Here is my Chronicle Queue dependency.

  <!-- https://mvnrepository.com/artifact/net.openhft/chronicle-queue -->
    <dependency>
      <groupId>net.openhft</groupId>
      <artifactId>chronicle-queue</artifactId>
      <version>5.17.22</version>
    </dependency>

Image Here

Any idea about solution? Thanks.

Tugrul Bayrak
  • 111
  • 1
  • 15
  • Which Lombok version do you use? – Jan Rieke Sep 18 '19 at 16:08
  • @JanRieke I use this "provided" , Is it the problem? – Tugrul Bayrak Sep 18 '19 at 17:27
  • No, Lombok must be included as `provided`. The version is important, as older versions had some issues in combination with modules. You should use the latest version 1.18.10. – Jan Rieke Sep 18 '19 at 19:19
  • I tried the latest version, same issue continues. I think this is about Eclipse. Because I run the project correctly. The only problem is red warnings. That means there is no problem for compiler. I don't know how to solve. – Tugrul Bayrak Sep 19 '19 at 06:35

1 Answers1

1

The problem is, I think, that a transitive dependency of chronicle-queue has some classes in the java.lang package, which is not allowed anymore.

Basically, you have to exclude the net.openhft:affinity package. Something like:

Maven Snippet

    <dependency>
      <groupId>net.openhft</groupId>
      <artifactId>chronicle-queue</artifactId>
      <version>5.17.22</version>
      <exclusions>
            <exclusion>
                <groupId>net.openhft</groupId>
                <artifactId>affinity</artifactId>
            </exclusion>
        </exclusions>

    </dependency>

P.S. Techically, we were having the same problem with chronicle-map instead of chronicle-queue, but I believe it's for that same reason so I'm posting anyway.

The Alchemist
  • 3,397
  • 21
  • 22