error: InitialLoadEntityManagerProxy is not abstract - java

I am learning JavaFX by looking at the official samples. I installed everything (jdk1.7.0_21, netBean3.7, MySQL, javafx-samples-2.2.21) few weeks ago. After I fixed the MySQL user table issue (one column less in build.xml file of DataAppLoader project), I was able run the DataApp project except the web version (DataAppServer project).
This morning I just updated the NetBeans via its Help menu try to get DataAppServer working. Then I got above compile error. I thought it was the version issue because I still use the 1.7.0_21 JDK.
Then I uninstalled everything related and installed the latest, jdk 1.7.0.25, glassfish 4, javafx-sample-2.2.25 and NetBeans 3.7.1.
I am surprised the database miss match is still there (they may be able to check the database version to determine which insert statement should be used.) and I still cannot compile the samples with this error.
error: InitialLoadEntityManagerProxy is not abstract and does not override abstract method <T>getEntityGraphs(Class<T>) in EntityManager
public class InitialLoadEntityManagerProxy implements EntityManager {
where T is a type-variable:
T extends Object declared in method <T>getEntityGraphs(Class<T>)
I really hope it is only my issue but not theirs issue. Otherwise the quality of the release will hurt so many users.
I am using windows 7 64-bit. The correct java.exe and javac.exe are used. I am an Eclipse user. NetBeans IDE is new to me.
Any help will be appreciated.
EDIT:
I didn't change/add anything except that build.xml to be able to initialize the database.

Put your mouse over the class name and hit Alt+Enter (to show hints). Then select implement all abstract methods. That worked for me.

Related

Cannot run Apache Netbeans 11 using JDK 11

No matter what I do, I can't get Netbeans 11 to work with JDK 11. Can you help me out?
Please note that this issue does NOT occur with JDK 8.
Downloaded and installed JDK 11 to C:\Program Files\Java\jdk-11.0.4
Downloaded and unzipped Netbeans 11 to C:\Program Files\netbeans
The etc/netbeans.conf file has been edited to set JDK home:
netbeans_jdkhome="C:\Program Files\Java\jdk-11.0.4"
When trying to run bin/netbeans64.exe:
First time: The loading window appears, loads for a bit, and then the
whole program disappears.
Second time: Loading window does not appear. An empty Java application
appears.
If I go to Task Manager and manually end the Netbeans process, I can
get back to First time.
For the attachments listed below, please refer to the issue I created here:
https://issues.apache.org/jira/browse/NETBEANS-2865
Executing netbeans64.exe from PowerShell outputs error messages to the console. They can be found in consoleOutput.txt attachment.
The results from executing bin/netbeans64.exe --trace C:\netbeans.log can be found in netbeans.log attachment.
For reference, this is the tutorial I followed:
https://www.youtube.com/watch?v=cxh-hVty09g
Update & Solution
I FINALLY got it to work thanks to the answer provided by skomisa.
The issue was caused by Netbeans 11.0 importing settings from a previous version. There was a popup the first time I ran Netbeans 11.0 asking if I wanted to import my settings from a previous version. Refer to skomisa's answer for more details on why.
To solve it, I deleted ALL of the preference files for NetBeans 11 by deleting the entire folder in AppData.
C:\Users\Hunter\AppData\Roaming\NetBeans\11.0\
Skomisa's answer mentioned trying to create a new unzipped version of NetBeans 11 and not importing the settings. I had actually tried this previously, but never got the popup window asking if you want to import. I assume this is because the user preference files for this version of NetBeans have already been created and are still sitting in AppData.
This leaves you with two viable options:
Delete all of the user preference files for NetBeans 11.0.
Search through the entire folder for instances of \u0000 and remove them.
It seemed easier and more satisfactory to remove the entire folder and start from scratch. That way, all of my user preference files are using the newest practices accepted by the JDK and Netbeans and that, hopefully, there is no lingering legacy code that will randomly break the next time I update.
Thanks for everyone's help!
Your problem appears to be related to the IllegalArgumentException ("Key contains code point U+0000") in the console log output of your bug report. It looks like NetBeans is trying to import your preferences from an earlier release of Netbeans, and is is finding some invalid null character(s) in your preference file(s).
This has been bug reported before, but remains unresolved. See Bug 271652 - IllegalArgumentException: Key contains code point U+0000.
Your preference files are all XML files (with extension xml), and reside in various directories under C:\Users\user ID\AppData\Roaming\NetBeans\11.0\config.
In my case my only preference file for NetBeans 11 is named C:\Users\johndoe\AppData\Roaming\NetBeans\11.0\config\Editors\text\x-java\Preferences\org-netbeans-modules-editor-settings-CustomPreferences.xml but you may have more than one.
From the stack trace in your console log, the failing call is AbstractPreferences.getBoolean(), so the null is probably on a line containing Boolean in your preference file. However, as this somewhat related SO answer suggests, just blindly remove all nulls from all preference files. Nulls should never exist in any XML file anyway.
An alternative approach to solving your problem is to create a new unzipped version of NetBeans 11, but do not import your settings.
I suppose you could even locate the preference files in your existing (broken) NB 11 installation and delete them, though that seems like an unsatisfactory approach even if it works.
A few related points:
Seeing the NetBeans window appear briefly before it vanishes is often a symptom of having set netbeans_jdkhome to an invalid JDK path, but in your case the value looks fine.
JAVA_HOME is ignored by NetBeans, so that cannot be the cause of your problem. See the response to Bug 198950 - NetBeans should use the JAVA_HOME and JDK_HOME environment variables, if available, to determine which JDK to use for details on how NetBeans decides which JDK to use. Specifying the --jdkhome parameter when you start NetBeans will override everything else.
The IllegalArgumentException only arises with JDK versions >= 9 because of a JDK bug fix, but that's a good thing. See JDK-8075156 : (prefs) get*() and remove() should disallow the use of the null control character '\u0000' as key for details. You weren't getting the problem with NetBeans 8.x because you probably weren't ever importing any preference files, but even if you were the IllegalArgumentException would not have occurred due to the Java bug fixed by JDK-8075156.

Create class intention missing for scratch files

I switched from Eclipse to IntelliJ since yesterday. I found an equivalent between the IDEs for everything but a basic thing : an intention to create a class that doesn't exist in the classpath in the scope of a scratch file.
IntelliJ only proposes the "create type parameter" intention :
While it works very well for no scratch files.
The IntelliJ IDEA used version is 2018.2.5 (Community Edition)
Build #IC-182.4892.20, built on October 16, 2018
JRE: 1.8.0_152-release-1248-b19 amd64.
You have something wrong in your configuration or the place you are trying to create it in.
I get this when I just press Alt + Enter (on Windows, default key mapping)
Simple: move your mouse under Foo, and press OPTION+ENTER to invoke intention-actions (that is for Mac, ALT-ENTER for windows). That feature is also called "quick fixes".
That suggests the possible ways to fix that problem. In other words: don't click on the red icon, but use
Edit: this rather looks like a bug: I just added a "Fooba bla" field to one of my existing java classes (so not in a public static void main) and I see the exact same: the OPTION+ENTER only shows me Create type parameter ....
Edit 2: just upgraded to IntelliJ 2018.2.6, and now ... it works again. At least for me, this looks like a bug, that was introduced and quickly fixed.

JavaFX font icons in FXML not working

I have gotten this result from running a javafx application using fontawesomefx
Caused by: java.lang.IllegalAccessError: tried to access method com.sun.javafx.css.parser.CSSParser.<init>()V from class de.jensd.fx.glyphs.GlyphIcon
at de.jensd.fx.glyphs.GlyphIcon.<clinit>(GlyphIcon.java:49)
I do not know how to fix a problem like this please help.
I would like to integrate resizable icons as font elements in java programs and this is one way I tried to do it but it does not work.
A couple of FontAwesomeFX library existing bug reports exist for this:
IllegalAccessError on FontAwesomeIcon construction. The bug report has been closed, but a comment by a user on the bug report states
the issue is still there in 8.9, try FontAwesomeFX 8.4
IllegalAccessError on FontAwesomeIcon construction. Same error, different report and further comments . . .
yes I was using JDK 1.8.0_31 that's why it doesn't work for me after updating to 1.8.0_92 version everything is working great.
AND
This is still an issue. com.sun.javafx.css.parser.CSSParser is not accessible in Java 9 resulting in java.lang.NoClassDefFoundError.
So, whether you get an error or not will depend on the Java version you are using (and, from your comments, the library is incompatible with all Java versions you have tried).
You will need to work with the developer of the library to get the error resolved.

I'm having a trouble with starting Eclipse : Error : ... cannot be solved to a type

I really don't know what the problem is.
I followed several web postings about installing and settings of JDK/ JRE and also completed clearly on environment variables :Path & CLASS PATH
I'm sure about that since i checked the cmd and it worked well.
the same problem occured over and over again.
I corrected on Library tab
I add the Library list like this,
But, I still have the same problem. Did I make a severe mistake? what should I do about this problem?
still have JAVA problems
Please check the Java source directory configuration under Java Build Path, Source tab and Java Compiler version settings.
Did you recently update your Java version? If so, then you have to readjust your path so that it directs to the new updated version.

Java Reflection not working on my system - working for team members

I am working on a team project in Java. One requirement is that we dynamically populate a drop-down menu of all classes that implement a certain interface. New classes can be added after compile time. To accomplish this we are using reflection.
Problem: All of the drop-down menus are blank on my system. I cannot for the life of me figure out why they are not populating. All other 5 team members have it working on their system.
Things I tired that didn't work:
1) Installing most recent eclipse (galileo) because rest team was using it
2) Re-install most recent java release (jdk1.6.0-17 and jre6)
3) Check PATH and JAVA_HOME variables
Any thoughts as to what else I can try or if something I did should have solved it and didn't? It is driving me crazy.
Edit:
I should have been clearer that we are developing in a team. We are using SVN for version control and we are all running the exact same source code. I even tried checking out a fresh copy of the entire tree from SVN, but I had the same issue with reflection on my system while it worked for teammates.
The team created an executable jar and that ran on everyone's system fine except for mine. Everything worked for me except the reflection bit.
You need to debug your application. This means you have to systematically explore possible causes of the problem. Here are some things that come to mind:
Could your GUI be failing rather than reflection? What if you output with System.out.println() rather than your menu?
Is your reflection code throwing an exception, and are you ignoring it?
Is your reflection code actually being called? Toss a println() in there to be sure!
Is the test for the interface suffering from a typo or similar error that's causing it to fail? Try finding classes that implement Serializable instead!
Is your reflection test running in the main thread and trying to update your GUI? You need to use SwingUtilities.invokeAndWait to get an update to the Swing worker thread.
You're working with Eclipse; Eclipse has a fantastic debugger. Set a breakpoint near where your main action is and then single step through the code.
PATH and JAVA_HOME won't help. PATH only affects dynamically-linked libraries ("native code"). JAVA_HOME is a scripting variable that happens to be used by some Java-based utilities like Ant and Tomcat; it means nothing to the Java runtime itself.
You need to be investigating the classpath, which should be specified by the -classpath option to the java command, in the Build Path in your Eclipse project properties, or in the Class-Path attribute of the main section of a JAR file if you're launching java with the -jar option.
From within your code, you should be able to list the contents of your classpath by examining the system property, "java.class.path"
System.out.println(System.getProperty("java.class.path"));
Problem solution:
Classpath leading to source code must have no spaces in it.
I am running windows XP and, for whatever reason, if the classpath that leads to the jar file or source code that is using reflection has any spaces in it, then the reflection fails.
I took the jar file that works for the rest of my team and ran it from C:\ on my system and the reflection worked perfectly fine.
I do not know why this is so please comment if you know what is happening.
Might be a long shot, but look for differences in security settings for you and your team mates. Article describing more details http://www.ibm.com/developerworks/library/j-dyn0603/ heading "Security and reflection"

Categories