Cannot find symbols
See original GitHub issueI try to add some extend methods to org.springframework.http.server.reactive.ServerHttpRequest
and got compile error cannot find symbols
.
step 1
everything is ok.
@Extension
public class ServerHttpRequestExt {
public static void helloWorld(@This ServerHttpRequest thiz) {
System.out.println("hello world!");
}
}
step 2
use ManCharSequenceExt.isNullOrEmpty
in package manifold.text.extensions.java.lang.CharSequence
of manifold-text
so add dependency in pom.xml
:
<dependencies>
<dependency>
<groupId>systems.manifold</groupId>
<artifactId>manifold-text</artifactId>
<version>2021.1.34</version>
</dependency>
</dependencies>
then got error:
@Extension
public class ServerHttpRequestExt {
public static void helloWorld(@This ServerHttpRequest thiz, String hello) {
// cannot find symbols
if (hello.isNullOrEmpty()) {
System.out.println("bye!");
}
System.out.println("hello " + hello + "!");
}
}
step 3
add maven-compiler-plugin
with some configurations:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>8</source>
<target>8</target>
<encoding>UTF-8</encoding>
<compilerArgs>
<!-- Configure manifold plugin -->
<arg>-Xplugin:Manifold no-bootstrap</arg>
</compilerArgs>
<!-- Add the processor path for the plugin -->
<annotationProcessorPaths>
<path>
<groupId>systems.manifold</groupId>
<artifactId>manifold-ext</artifactId>
<version>${manifold.version}</version>
</path>
<path>
<groupId>systems.manifold</groupId>
<artifactId>manifold-text</artifactId>
<version>${manifold.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
got compile error but not same position:
import manifold.ext.rt.api.Extension;
import manifold.ext.rt.api.This;
// cannot find symbols
import org.springframework.http.server.reactive.ServerHttpRequest;
@Extension
public class ServerHttpRequestExt {
// cannot find symbols
public static void helloWorld(@This ServerHttpRequest thiz, String hello) {
if (hello.isNullOrEmpty()) {
System.out.println("bye!");
}
System.out.println("hello " + hello + "!");
}
}
sample project
here’s a sample
versions
manifold: 2021.1.34 idea: 2021.1.3 maven: 3.6.3
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to Resolve The Cannot Find Symbol Error in Java - Rollbar
As its name implies, the cannot find symbol error refers to a symbol which cannot be found. While there are multiple ways and...
Read more >java - What does a "Cannot find symbol" or "Cannot resolve ...
A "Cannot find symbol" error means that the compiler cannot do this. Your code appears to be referring to something that the compiler...
Read more >What can cause the "cannot find symbol" error in Java?
The “cannot find symbol” error occurs mainly when we try to reference a variable that is not declared in the program which we...
Read more >"Cannot Find Symbol" compile error - Net-Informations.Com
The "Cannot find symbol" errors generally occur when you try to reference an undeclared variable in your code. A "Cannot find symbol" error...
Read more >What Causes “Cannot find symbol” Compilation Error in Java?
As the name suggests, the Java cannot find symbol error occurs when a required symbol cannot be found in the symbol table. Although...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Based on your suggestion, it worked perfectly and I may have missed something else to check. Thanks a million and Happy New Year 🎉
Yes, that is odd. Manifold definitely works with any Java version 8 or greater. I made a straightforward project based on your examples that demonstrates this. I suggest you start over with a cleaner project based on this one. Happy New Year!