NetBeans 15 / 16 Java Compiler Failure - java

The problem is already reported at NullPointerException in compiler, Java files with red error badges can't be run
but I need to ask it here as a question because the more than 6 weeks old bug record does not have any response, no workaround. I really need to know how to get this problem solved, a type of problem that I have not seen before to that extent. I have been using NetBeans with Java for decades. Any suggestions, including non-technical are highly appreciated. More specifically, I would like to know how I can help the NetBeans team to pinpoint the error in nb-javac. Such issues are normally resolved with finer logging levels that would identify at least some offending files being processed. A NullPointerException without context is very difficult to analyze.

In a Maven project, the bug is most likely caused by a missing package statement in package-info.java file in the main sources. This condition is not reported by javac, and it is not reported by nb-javac.
Instead, the error occurs away from the culprit, in test source files.
So the solution is to add a package statement to package-info.java

Related

mvn jetty:run looking for a file that doesn't exist

I've been learning the basics of Spring MVC by writing a very simple CRUD app and running it with Jetty. (I've been following a mix of this mkyong tutorial and this journaldev tutorial)
When I run mvn compile it compiles without error. But when I start jetty with mvn jetty:run, I get
A required class was missing while executing org.eclipse.jetty:jetty-maven-plugin:9.2.11.v20150529:run: Lcom/mkyong/model/stock/StockDao;
Technically it's correct because I don't store the stock DAO at that path. It's at com/mkyong/dao/StockDAO.java.
But obviously something, somehwere, seems to be referencing it at that path it's complaining about? It's a small app and I've combed it several times and pulled out some hair in frustration trying to find it. I'm still incredibly new at debugging java so the verbosity of the errors is really confusing as well.
Here is the full source code of the app. Any thoughts on where the issue might be?
Thanks so much!!
EDIT:
Adding screenshots to address a comment below.
Github appears to lowercase parts of the word Dao in the filename, but they are most definitely all upper case on my local machine
The names of some public classes differ from their related source files. Change StockDao.java to StockDAO.java and StockDaoImpl.java to StockDAOImpl.java.

Liquibase Cannot find ChangeLogHistoryService for oracle

Recently, in my machine, every time I try to load a java project with Liquibase I get the error
Caused by: liquibase.exception.UnexpectedLiquibaseException: Cannot find ChangeLogHistoryService for oracle
at liquibase.changelog.ChangeLogHistoryServiceFactory.getChangeLogService(ChangeLogHistoryServiceFactory.java:73)
at liquibase.Liquibase.checkLiquibaseTables(Liquibase.java:724)
I can't find any information on this, beyond the source file.
All I know is that the same project, with the same source code seems to work on other computers. As far as I can tell, all configs are the same.
Any idea on what might cause this issue in the first place?
It means that one of the tables that Liquibase expects to find in the database (liquibasechangelog or liquibasechangeloglock) has been removed. If it is working on other machines it probably means that the database you are connecting to is also different. It sounds like you might be trying to connect to the database on localhost, which would explain the difference.
The error looks more like a classloader issue. Liquibase has a plug-in system that relies on finding class implementations in the classpath, including the built-in classes. Liquibase is looking for an implementation of ChangeLogHistoryService that support oracle and it isn't finding the liquibase.changelog.StandardChangeLogHistoryService class that it should be.
Are there any earlier errors you are seeing? If you run liquibase with logLevel=DEBUG it may also output better clues as to the cause of the unfound class.
I updated the liquibase version (from 3.1.1) to 3.2.0 and the problem went away.
I did have to fix SOME of the checksome codes in DATABASECHANGELOG table (3 records in 16). The fact that it wasn´t all of them may point to a possible origin for the problem? maybe?
For now everything works fine with the new version. If the problem comes up again in the future I will look into this again.
Thank you all for your support.

Possible usage of an automated compiler error fixing plugin

I am working on a project aims to make software reuse easier. The final project provides a framework to select a desired feature from a (Java, C++) program and adds that to the another program.
I am responsible for two parts of the project.
Fixing possible compiler errors after the desired feature is added to the another program.
Changing the desired feature to be usable in its new location. In this case the program should pass successfully all test cases (not details at the moment as my question is related to Section 1).
Currently, I implemented the first step and the program can automatically fix possible compiler errors after the desired feature is added to its new location. It almost supports all Java compiler errors (even that some of them never happen in the above project), and in few of cases a user needs to help the plugin to fix the compiler error.
Note that the plugin has access to both programs and using these information it will fix compiler errors.
For clarity, as a very simple example in a case that there is a dependency between the desired feature with a library in its original location, the plugin tries to fix the compiler error for example by adding that library to the program.
I know current IDEs provide suggestions in a case that there is a compiler error in the program, but the advantage of the current plugin is that it automatically can fix compiler errors, and does not provide a list of solutions to the user for each compiler error.
The question That I am facing is that: Any one could please mention other situations that I can use the implemented automated compiler error fixing plugin? (of course except the above project). Any suggestion is welcome as it helps me to see other directions of the project.

Eclipse errors on startup

Sorry if this question is kind of vague. Let me know if I can provide any additional relevant details.
Basically, every so often (at least once every few weeks), when I open my Eclipse workspace I am greeted with a large number of errors. It often says that almost every single one of my projects have errors even though they were working just the day before. I understand that something is getting messed up in the build-path because it gives me errors such as The type java.lang.Object cannot be resolved. However, I don't understand why restarting Eclipse would cause this build-path to get messed up. It also seems fairly common for me to get errors on imports for various Android classes even though I have included the Android SDK in the project.
I guess what I am asking is twofold:
1) Why is this happening and is there anything that I can do to stop this from happening?
2) When this does happen, is there an easy way that I can resolve it? I know that I can go into the Preferences for an individual project and add libraries to the build-path but I can't figure out how to easily do this for all of my projects at once, and I feel like I'm just trying things until they work, so it would be good to have a more defined procedure for dealing with these sorts of problems.
EDIT:
Does anyone have any ideas?
You might need a valid JRE or JDK defined in the Java Build Path of your project.

What is the reason for these error messages?

I'm getting error messages for no reason in RAD 8:
And the error message is complaining about a totally different method in a totaly different project in a totally different package. Is my error reporting erroneous? How can I resolve this? Since JSP validation appears to be broken in RAD 8 I have turned off validation for fragments but I want to be able to find legitimate errors. How do I proceed?
I know this is late, but...
When the error indicators don't even align with the source, it seems like RAD/Eclipse is internally looking at an outdated version of the file. I usually can clear this up by closing and re-opening the file, re-validating the file, or running a Clean build.
It appears to be something new in WAS 8. The validation is broken and must be turned off in order for this to work. Found out while upgrading from 6.1->8.0.
Fragments? Scriptlets? You shouldn't have those in JSPs. That's 1998 vintage stuff. I'd recommend JSTL.

Categories