0

I found this while importing stage to my main

import javafx.stage.Stage;

it shows illegal character: '\ufeff' .

here is the error message i got

Exception in Application constructor
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Unable to construct Application instance: class FastFoodService
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:907)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$154(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoSuchMethodException: FastFoodService.<init>()
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.getConstructor(Class.java:1825)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$160(LauncherImpl.java:818)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$174(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
... 1 more
C:\Users\atgle\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1
BUILD FAILED (total time: 0 seconds)
Glenio
  • 122
  • 8
  • Could you paste the full error ? It is probably related to a BOM in either a source or a XML file, c.f : https://stackoverflow.com/questions/45697794/error-illegal-character-ufeff-in-java – Arnaud May 06 '19 at 12:21
  • Do you want to use this character or don't you have an idea where it comes from? – deHaar May 06 '19 at 12:21
  • the error that prompted in the console? – Glenio May 06 '19 at 12:22
  • Yes it may point you to the right file containing the problem . – Arnaud May 06 '19 at 12:23
  • @deHaar I don't know why it shows red line at that statement – Glenio May 06 '19 at 12:23
  • Please show us the error message, just copy and paste it... – deHaar May 06 '19 at 12:24
  • That points to a problem with a method of the class `FastFoodService`. Is this character involved in that class or method? – deHaar May 06 '19 at 12:31
  • @deHaar i'm not sure what the character for. I'm going to make a window and I need to import that API(javafx.stage.Stage). I think it should be involved in the UI. – Glenio May 06 '19 at 12:36
  • Does your controller have a method `init`? – deHaar May 06 '19 at 12:36
  • @deHaar not sure, i think doesn't have it. I watched a youtube video, he also doesn't do anything about it. https://youtu.be/QGGE0WsUslc – Glenio May 06 '19 at 12:39

0 Answers0