Closed leo-lucky-hub closed 5 months ago
It's likely something to do with the setup of your dependencies, RestStatus is here.
I'll close this, but feel free to comment with repro steps, and/or post your code to a GitHub repo that shows the failure if you're stuck. The public Slack clients
channel is also a good place to ask this.
@dblock Thank you for your answerïŒ What I want to ask is, why RestStatus is a class, not java. In this jar, other classes are java, not class
pom.xml `<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.opensearch.client</groupId>
<artifactId>spring-data-opensearch-starter</artifactId>
<version>1.4.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
`
@dblock 2.11.1 RestStatus is java
@reta do you know what changed?
@reta do you know what changed?
Oh, it was moved to different package @dblock :(
@reta do you know what changed?
Oh, it was moved to different package @dblock :(
I am confused. Where? When?
Oh sorry @dblock , it was moved in 2.10.0, I haven't checked the full issue details. Seems like IDE issue.
@luckyyaxianzhi The java/class thing is a red herring, RestStatus
is an enum, so it shows up correctly.
@dblock Thank you for your answerïŒ So what should I do so that I donât get an error? The same IDE, there is no error when using 2.11.1
What do you see in your IDE with 2.11.1 vs. 2.14 for RestStatus
?
2.11.1 2.14
They look identical, what am I missing @luckyyaxianzhi ?
@dblock Why is 2.14 a RestStatus.class file, and 2.11.1 is a RestStatus file without the .class suffix? What I hope is that 2.14 is also a RestStatus file without the .class suffix.
Why is 2.14 a RestStatus.class file, and 2.11.1 is a RestStatus file without the .class suffix?
I don't know. Note though that your screenshot is cut off and I can't see this.
Going back to the problem, you're saying that your project's build works with 2.11 but not 2.14. Put a complete project up on GitHub that reproduces the problem (a branch that uses 2.11 where I can type ./gradlew build
and it works, and a branch that uses 2.14 where I can type ./gradlew build
and it doesn't work), and I can try to take a look.
@dblock Why is 2.14 a RestStatus.class file, and ReportingService is a .java file
@dblock Why is 2.14 a RestStatus.class file, and ReportingService is a .java file
I don't know how the IDE resolves references, but this doesn't seem to be the real problem. Happy to help resolve the actual problem of building the project if you can put up a repro.
I'm experiencing the same issue with RestStatus not being resolved in my project, even though I can see it in the library. I'm using IntelliJ IDEA, and Iâve tried various solutions, including clearing Gradle's cache, re-downloading dependencies multiple times, and cleaning the IDE's cache.
When I use OpenSearch 2.11.1, the problem is resolved, but it persists with versions 2.15 and 2.13. I'm not sure if this is related to how IntelliJ resolves references or if itâs something else in my project setup. Any further guidance or steps to reproduce would be greatly appreciated.
Thanks!
Hi, I am also facing similar issue as mentioned by others. RestStatus is not getting resolved when using opensearch-rest-high-level-client dependecy for version 2.12.0 and above. It works fine for version 2.11.0. I am using IntelliJ.
Could someone please suggest, how to resolve this issue?
Thanks!
Hi, my conclusion was that the problem was associated with IntelIj. I recommend using another IDE or trying again with the latest versions of IntelIj.
Describe the bug
Related component
Clients
To Reproduce
Expected behavior
no error
Additional Details
Plugins Please list all plugins currently enabled.
Screenshots If applicable, add screenshots to help explain your problem.
Host/Environment (please complete the following information):
Additional context Add any other context about the problem here.