-
Notifications
You must be signed in to change notification settings - Fork 340
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
Can manually run project but not in VS Code due to an ambiguous failure to compile #1496
Comments
Can you share a sample snippet, including the necessary dependencies, to help reproduce the issue? It doesn't need to be your entire project—just a minimal sample that includes the relevant code and dependencies to reproduce the problem. |
I created a repository here https://github.com/ryanswech/vscode-java-debug-issue-1496. Sorry, its a bit of a mess. I was grabbing bits and pieces trying to figure out what all I needed to get the error to pop up again. It relies on a MariaDB database (though other SQL databases should also work). The information for that database needs to be added to the following places (there are TODO comments in all the spots):
The database must have a table named
Obviously, there are other tables in the database. I don't know if they matter I just pointed the sample at my local testing database for when I develop the actual application. |
We have encountered a similar/same problem. Solution was to downgrad the VSCode extension "Language Support for Java(TM) by Red Hat" (https://marketplace.visualstudio.com/items?itemName=redhat.java) to Version 1.31.0 (https://github.com/redhat-developer/vscode-java/releases/tag/v1.31.0). This post confirms the same solution: redhat-developer/vscode-java#3700. However, the compiler problem is related to tables that contain BLOBs. |
We also ran into this; I submitted an issue to the compiler repo: eclipse-jdt/eclipse.jdt.core#2817. |
As of last Friday morning (2024-06-28) I can no longer run my project through VS Code. No change to the project occurred between the last time I ran it this way and these issues.
A few of my classes (it seems to be specifically automatically generate classes from JOOQ) are randomly marked with the following error at the very top of the file (ie. the error indicator doesn't seem to be linked to any part of the code):
Internal compiler error: java.lang.RuntimeException: Internal Error compiling /myapp/target/generated-sources/db/mydb/com/myapp/mydb/tables/Comm.java at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:151)
If I manually compile and run my code ("mvn install", "java -jar -Dspring.profiles.active=local target/myapp-0.0.1-SNAPSHOT.jar") there are no compilation errors and everything works as expected.
When I try to run my application through VS Code it fails because of missing classes on the class path (java.lang.ClassNotFoundException: com.myapp.mydb.tables.records.SomeClassRecord). When I go look in the target folder, those classes are indeed missing but one of the Java extensions seems to be the culprit.
If I manually compile ("mvn compile") the application, the classes get compiled and added to the classes folder by maven. However, when I run it in VS Code the extensions seem to recompile the project (the target folder seems to get cleared out) and fails to re-add the classes, presumably because of the error described above.
I have attached what I believe to be the relevant part of the log but if you need additional logs I am happy to include them.
Environment
Steps To Reproduce
Sorry, I am not sure how to describe the reproduction of the issue in a project agnostic way since I don't understand it and I can't really give you my entire project.
Current Result
Failure to compile and therefore run a project that worked previously.
Expected Result
If I can successfully compile and run my project with maven then I should also be able to do it through these extensions or get a specific error about why my project could not be compiled/run.
Additional Informations
I have already tried:
The text was updated successfully, but these errors were encountered: