-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Micronaut + Reactor + JAsync doesn't compile #3
Comments
I will check it today. I have a quick look at your project. I think it may cause by the new key word @Async
private JPromise<String> getDataInternal() {
try {
Thread.sleep(2000);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
return JAsync.just(Thread.currentThread().getName());
} This method is blocked by @Async
private JPromise<String> getDataInternal() {
Promises.from(Mono.delay(Duration.ofSeconds(2))).await();
return JAsync.just(Thread.currentThread().getName());
}
|
@mojo2012 <compilerArgs>
<arg>--add-exports</arg><arg>jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
<arg>--add-exports</arg><arg>jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
</compilerArgs> But the reality is more complicated. |
I think targeting or even using java 8 is not the way to go for any new project. |
@mojo2012 |
Should this be compatible with the eclipse compiler?
|
@mojo2012 Yes, eclipse compiler cause it. Many ide do some hack about JDK's |
just the regular java extension from redhat |
@mojo2012 I found ecj use its own compiler. JAsync only support javac currently. |
so developing with Eclipse and vscode is not supported? I really don't want to use the java compiler, because it lacks a lot of features compared to ejc. Especially build output and diagnostics features. |
@mojo2012 An imperfect solution would be using Maven or Gradle to compile the project fist, then debugging using ejc. but in current versions JAsync throws exceptions during initialization, causing debugging to fail. This will be fixed in the next version. |
Have you ever considered to just use the regular ecj through the maven-compiler-plugin and a post processor to process the .class files afterwards. It's actually quite straight forward to do and doesn't possibly break with every java update. Anyway, I think I'm not the only one who would only be interested into this project if it works for all major IDEs without any drawbacks, so supporting ecj/eclipse/vscode/(netbeans?) is a must. |
@mojo2012 |
Vscode-java is based on eclipse JDT, it use ecj to compile. When you debug the program in normal mode, the classpath set by vscode is First, create a vscode task in {
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "gradle build" // or you can use maven build command
}
]
} Second, create debug task in {
"type": "java",
"name": "to debug",
"request": "launch",
"mainClass": "com.example.demo.DemoApplication",
"classPaths": [
"${workspaceFolder}/build/classes/java/main", // set the gradle/maven compile output dir
"${workspaceFolder}/build/libs/java_modules/*" // set dependent jars dir
],
"preLaunchTask": "build" // to run build task before launching.
} Now you can debug by choosing task in vscode |
Hi,
I tried to implement my first demo project with micronaut/reactor. Unfortunately this error pops up during compilation:
This is the sample project: https://github.com/mojo2012/async-test
I hope you can help me fix this :-)
cheers, matthias
The text was updated successfully, but these errors were encountered: