javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.enterprise.naming.SerialInitContextFactory - java

I'm deploying an application making use of EJB. I'have wrote an EJB and a java standalone client to connect to. Everything works correctly in Netbeans, but when i try to start in command line I got exceptions.
The JavaFX Application contains the following code :
String chemin = IRemoteInterface.class.getName();
Properties vEnv = new Properties();
vEnv.put("org.omg.CORBA.ORBInitialHost", "localhost");
vEnv.put("org.omg.CORBA.ORBInitialPort", "3700");
try {
Context ctx = new InitialContext(vEnv);
leProxy = (IRemoteInterface) ctx.lookup(chemin);
System.out.println("proxy OK");
} catch (NamingException ex) {
System.out.println("erreur proxy");
Logger.getLogger(CDM.class.getName()).log(Level.SEVERE, null, ex);
}
I have tried the following :
java -jar CDM.jar
And the error I get is :
javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.enterprise.naming.impl.SerialInitContextFactory [Root exception is java.lang.NullPointerException]
at java.naming/javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at java.naming/javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at java.naming/javax.naming.InitialContext.init(Unknown Source)
at java.naming/javax.naming.InitialContext.<init>(Unknown Source)
at cdm.CDM.main(CDM.java:77)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.NullPointerException
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.initializeServiceLocator(AbstractModulesRegistryImpl.java:152)
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.newServiceLocator(AbstractModulesRegistryImpl.java:144)
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator(AbstractModulesRegistryImpl.java:218)
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator(AbstractModulesRegistryImpl.java:224)
at com.sun.enterprise.module.single.StaticModulesRegistry.createServiceLocator(StaticModulesRegistry.java:88)
at org.glassfish.internal.api.Globals.getStaticHabitat(Globals.java:102)
at com.sun.enterprise.naming.impl.SerialInitContextFactory.<init>(SerialInitContextFactory.java:130)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.base/java.lang.Class.newInstance(Unknown Source)
... 16 more
I really don't know how to fix it.
Many thanks for your help in advance !

EDIT :
When I use the following it works
java -cp "C:\Program Files\glassfish5\glassfish\lib\appserv-rt.jar;C:\Program Files\glassfish5\glassfish\lib\javaee.jar;C:\Program Files\glassfish5\glassfish\lib\gf-client.jar;CDM.jar" cdm.CDM

Related

Charles proxy won't start. Assistive Technology not found: com.sun.java.accessibility.AccessBridge

My previous question was deleted here because it was considered as duplicate. I say it's not because the answers were about java itself while mine is about charles proxy and those answers didn't resolve my problem.
I had installed jdk-17.0.1 and jre1.8.0_311 on my machine when I tried to open charles proxy 4.6.2 on double click but nothing happened, the application didn't start. I try to open via command prompt by typing Charles.exe and this error is shown
java.awt.AWTError: Assistive Technology not found: com.sun.java.accessibility.AccessBridge
at java.desktop/java.awt.Toolkit.newAWTError(Unknown Source)
at java.desktop/java.awt.Toolkit.fallbackToLoadClassForAT(Unknown Source)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source)
at java.desktop/java.awt.Toolkit.loadAssistiveTechnologies(Unknown Source)
at java.desktop/java.awt.Toolkit.getDefaultToolkit(Unknown Source)
at de.sciss.syntaxpane.DefaultSyntaxKit.<clinit>(DefaultSyntaxKit.java:105)
at com.xk72.charles.gui.lib.UIUtils.<clinit>(Unknown Source)
at com.xk72.charles.gui.s.h(Unknown Source)
at com.xk72.charles.gui.Main.c(Unknown Source)
at com.xk72.charles.Main.b(Unknown Source)
at com.xk72.charles.gui.Main.main(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at com.xk72.lib.a.a(Unknown Source)
at com.xk72.charles.gui.MainWithClassLoader.main(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.sun.java.accessibility.AccessBridge
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Unknown Source)
... 24 more
I'm using Windows 10 64bit. %JAVA_HOME% is also setup
For me going to C:\Users\my account\.accessibility.properties and commenting out every line by adding a # a front of it worked.(I at least don't need the accessibility)
Found this solution at: Exception in thread "main" java.awt.AWTError: Assistive Technology not found

Can't run javaFX/Spring Boot application from Jar : Location is not set

I have been working on an application with JavaFX and spring boot, it workes fine when I launch it from the Eclipse IDE but if I run the generated jar using :
java -jar AppXX.jar it gives me the error below:
Exception in Application init method
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.lang.RuntimeException: Exception in Application init method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: javafx.fxml.LoadException:
file:/C:/Users/XX/target/MDV2.0-0.0.1-SNAPSHOT.jar!/BOOT-INF/classes!/com/X/anotherProject/view/Welcome.fxml
at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
at com.X.anotherProject.AnotherProjectApplication.init(AnotherProjectApplication.java:42)
... 3 more
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javafx.reflect.Trampoline.invoke(Unknown Source)
at jdk.internal.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(Unknown Source)
at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(Unknown Source)
... 7 more
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at javafx.fxml/javafx.fxml.FXMLLoader$MethodHandler.invoke(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(Unknown Source)
at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
at javafx.base/javafx.event.Event.fireEvent(Unknown Source)
at javafx.graphics/javafx.scene.Node.fireEvent(Unknown Source)
at com.X.anotherProject.Controller.WelcomeController.FireAnEvent(WelcomeController.java:464)
at com.X.anotherProject.Controller.WelcomeController.initialize(WelcomeController.java:338)
... 17 more
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javafx.reflect.Trampoline.invoke(Unknown Source)
at jdk.internal.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(Unknown Source)
at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(Unknown Source)
... 31 more
Caused by: javafx.fxml.LoadException:
file:/C:/Users/XX/target/MDV2.0-0.0.1-SNAPSHOT.jar!/BOOT-INF/classes!/com/X/anotherProject/view/Kits%20de%20migration.fxml
at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
at com.sopraMdv.anotherProject.Controller.WelcomeController.loadInMainPane(WelcomeController.java:453)
at com.X.anotherProject.Controller.WelcomeController.press(WelcomeController.java:398)
... 41 more
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javafx.reflect.Trampoline.invoke(Unknown Source)
at jdk.internal.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(Unknown Source)
at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(Unknown Source)
... 46 more
Caused by: java.lang.IllegalStateException: Location is not set.
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
at com.X.anotherProject.Controller.WelcomeController.loadInMainPane(WelcomeController.java:453)
at com.X.anotherProject.Controller.KitListController.AddElemnt(KitListController.java:115)
at com.X.anotherProject.Controller.KitListController.initialize(KitListController.java:98)
... 56 more
this is how I load the FXML file in my class :
public static void main(String[] args) {
Application.launch(args);
}
#Override
public void init() throws Exception {
springContext = SpringApplication.run(AnotherProjectApplication.class);
FXMLLoader fxmlLoader= new FXMLLoader(getClass().getResource("/com/X/anotherProject/view/Welcome.fxml"));
springContext.getAutowireCapableBeanFactory().autowireBean(this);
fxmlLoader.setControllerFactory(AnotherProjectApplication.springContext::getBean);
rootNode=fxmlLoader.load();
}
note that I have checked a lot of related problems and none of them worked.
The thing is that getClass().getResource() cannot find the FXML file.
When I opened the jar with Winrar I found the file in the given path :
file:/C:/Users/XX/target/MDV2.0-0.0.1-SNAPSHOT.jar!/BOOT-INF/classes!/com/X/anotherProject/view/Welcome.fxml

Issues with RangeSlider from ControlsFX

I am trying to implement the RangeSlider class in a program, however, I am receiving the following error:
Exception in Application start method
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalAccessError: class impl.org.controlsfx.behavior.RangeSliderBehavior (in unnamed module #0x74bf073e) cannot access class com.sun.javafx.scene.control.inputmap.InputMap$Mapping (in module javafx.controls) because module javafx.controls does not export com.sun.javafx.scene.control.inputmap to unnamed module #0x74bf073e
at impl.org.controlsfx.behavior.RangeSliderBehavior.<init>(RangeSliderBehavior.java:67)
at impl.org.controlsfx.skin.RangeSliderSkin.<init>(RangeSliderSkin.java:95)
at org.controlsfx.control.RangeSlider.createDefaultSkin(RangeSlider.java:194)
at javafx.controls/javafx.scene.control.Control.doProcessCSS(Unknown Source)
at javafx.controls/javafx.scene.control.Control.access$000(Unknown Source)
at javafx.controls/javafx.scene.control.Control$1.doProcessCSS(Unknown Source)
at javafx.controls/com.sun.javafx.scene.control.ControlHelper.processCSSImpl(Unknown Source)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(Unknown Source)
at javafx.graphics/javafx.scene.Parent.doProcessCSS(Unknown Source)
at javafx.graphics/javafx.scene.Parent.access$400(Unknown Source)
at javafx.graphics/javafx.scene.Parent$1.doProcessCSS(Unknown Source)
at javafx.graphics/com.sun.javafx.scene.ParentHelper.processCSSImpl(Unknown Source)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(Unknown Source)
at javafx.graphics/javafx.scene.Parent.doProcessCSS(Unknown Source)
at javafx.graphics/javafx.scene.Parent.access$400(Unknown Source)
at javafx.graphics/javafx.scene.Parent$1.doProcessCSS(Unknown Source)
at javafx.graphics/com.sun.javafx.scene.ParentHelper.processCSSImpl(Unknown Source)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(Unknown Source)
at javafx.graphics/javafx.scene.Parent.doProcessCSS(Unknown Source)
at javafx.graphics/javafx.scene.Parent.access$400(Unknown Source)
at javafx.graphics/javafx.scene.Parent$1.doProcessCSS(Unknown Source)
at javafx.graphics/com.sun.javafx.scene.ParentHelper.processCSSImpl(Unknown Source)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(Unknown Source)
at javafx.graphics/javafx.scene.Node.processCSS(Unknown Source)
at javafx.graphics/javafx.scene.Scene.doCSSPass(Unknown Source)
at javafx.graphics/javafx.scene.Scene.preferredSize(Unknown Source)
at javafx.graphics/javafx.scene.Scene$2.preferredSize(Unknown Source)
at javafx.graphics/com.sun.javafx.scene.SceneHelper.preferredSize(Unknown Source)
at javafx.graphics/javafx.stage.Window$12.invalidated(Unknown Source)
at javafx.base/javafx.beans.property.BooleanPropertyBase.markInvalid(Unknown Source)
at javafx.base/javafx.beans.property.BooleanPropertyBase.set(Unknown Source)
at javafx.graphics/javafx.stage.Window.setShowing(Unknown Source)
at javafx.graphics/javafx.stage.Window.show(Unknown Source)
at javafx.graphics/javafx.stage.Stage.show(Unknown Source)
at minimalist.DoubleSliderInterface.start(DoubleSliderInterface.java:104)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
... 1 more
Exception running application minimalist.DoubleSliderInterface
I am using ControlsFX version 9.0.0 while running Java 10 on Eclipse, however, I believe I can rule out incompatibility with the Java version as I also tried running this on Java 9.0.4 and as well was able to successfully run the Rating class.
My code is just a number of instances of the following, succeeded by a VBox to contain them, a group, and the scene and stage as is normal-
final RangeSlider blur = new RangeSlider(0,30,0,30);
Text blurTitle = new Text("Blur");
Text blurMin = new Text();
blurMin.textProperty().bindBidirectional(blur.lowValueProperty(),converter);
Text blurMax = new Text();
blurMax.textProperty().bindBidirectional(blur.highValueProperty(),converter);
HBox blurBox = new HBox();
blurBox.getChildren().addAll(blurMin,blur,blurMax);
blurBox.setPadding(new Insets(5));
blurBox.setSpacing(10);
Any help is appreciated, thanks.
Adding --add-exports=javafx.controls/com.sun.javafx.scene.control.inputmap=ALL-UNNAMED to your VM arguments when running the application will resolve the issue. Answer thanks to #kleopatra
There is already a bug report on their bitbucket page. It looks like it's just not compatible with java9+
https://bitbucket.org/controlsfx/controlsfx/issues/802/rangeslider-uses-inaccessable-package
I didn't read the code of this specific control but you might be able to copy the code you need and remove the part that uses the InputMap related classes.
Other than that you are probably better off downgrading to java8 or using another ui element to mimic similar behavior.

Deploying JavaFX Application with Intellij

I created quite complex project with JavaFX and now I'm having some trouble deploying it, as I never deployed any app in Java before.
I tried using Intellij "Build artificial" but I always get "Error: corrupted jarfile" when I try to open the the Jar it builds.
Any suggestions? I'm using external libraries from Maven and some local ones too if it helps...
Edit:
Ok I changed some of the settings in the Make Artificial, now I don't get that error.
I get this Exception, seems it can't file the fxml file...
Exception in Application start method
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException: Location is required.
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
at sample.Main.start(Main.java:20)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(Unknown Source)
at
javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
... 1 more
Exception running application sample.Main
SOLVED!: just played with the fxml files patches and it fixed it...

ORDS "java -jar ords.war" command error

I'm following this guide: https://docs.oracle.com/cd/E56351_01/doc.30/e87809/getting-started-with-RESTful-services.htm#AELIG90200
but I got stuck in "F.2 Create a RESTful Service from a SQL Query".
In the folder where Oracle REST Data Services was installed, I entered the following command in a command prompt:
java -jar ords.war user test_developer "SQL Developer"
and I got this error:
java.lang.NoClassDefFoundError: javax/xml/bind/ValidationEventHandler
at java.base/java.lang.Class.getDeclaredFields0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredFields(Unknown Source)
at java.base/java.lang.Class.getDeclaredFields(Unknown Source)
at oracle.dbtools.injector.impl.__Reflections.constantFields(__Reflectio ns.java:30)
at oracle.dbtools.injector.impl.InjectorImpl$Builder.add(InjectorImpl.ja va:356)
at oracle.dbtools.injector.impl.InjectorImpl$Builder.add(InjectorImpl.ja va:378)
at oracle.dbtools.injector.impl.InjectorImpl$Builder.add(InjectorImpl.ja va:310)
at oracle.dbtools.common.di.Services$Builder.add(Services.java:409)
at oracle.dbtools.common.di.Services$Builder.load(Services.java:474)
at oracle.dbtools.common.app.ApplicationContext.loadServices(Application Context.java:167)
at oracle.dbtools.cmdline.Commands.main(Commands.java:345)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at oracle.dbtools.jarcl.Entrypoint.main(Entrypoint.java:58)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.ValidationEventHandl er
at java.base/java.lang.ClassLoader.findClass(Unknown Source)
at oracle.dbtools.jarcl.JarClassLoader.findClass(JarClassLoader.java:63)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
... 16 more
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
at java.base/java.lang.Class.getDeclaredFields0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredFields(Unknown Source)
at java.base/java.lang.Class.getDeclaredFields(Unknown Source)
at oracle.dbtools.injector.impl.__Reflections.constantFields(__Reflectio ns.java:30)
at oracle.dbtools.injector.impl.InjectorImpl$Builder.add(InjectorImpl.ja va:356)
at oracle.dbtools.injector.impl.InjectorImpl$Builder.add(InjectorImpl.ja va:378)
at oracle.dbtools.injector.impl.InjectorImpl$Builder.add(InjectorImpl.ja va:310)
at oracle.dbtools.common.di.Services$Builder.add(Services.java:409)
at oracle.dbtools.common.di.Services$Builder.load(Services.java:474)
at oracle.dbtools.common.app.ApplicationContext.loadServices(Application Context.java:167)
at oracle.dbtools.cmdline.Commands.main(Commands.java:345)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at oracle.dbtools.jarcl.Entrypoint.main(Entrypoint.java:58)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
at java.base/java.lang.ClassLoader.findClass(Unknown Source)
at oracle.dbtools.jarcl.JarClassLoader.findClass(JarClassLoader.java:63)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
... 16 more
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
at java.base/java.lang.Class.getDeclaredFields0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredFields(Unknown Source)
at java.base/java.lang.Class.getDeclaredFields(Unknown Source)
at oracle.dbtools.injector.impl.__Reflections.constantFields(__Reflectio ns.java:30)
at oracle.dbtools.injector.impl.InjectorImpl$Builder.add(InjectorImpl.ja va:356)
at oracle.dbtools.injector.impl.InjectorImpl$Builder.add(InjectorImpl.ja va:378)
at oracle.dbtools.injector.impl.InjectorImpl$Builder.add(InjectorImpl.ja va:310)
at oracle.dbtools.common.di.Services$Builder.add(Services.java:409)
at oracle.dbtools.common.di.Services$Builder.load(Services.java:474)
at oracle.dbtools.common.app.ApplicationContext.loadServices(Application Context.java:167)
at oracle.dbtools.cmdline.Commands.main(Commands.java:345)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at oracle.dbtools.jarcl.Entrypoint.main(Entrypoint.java:58)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
at java.base/java.lang.ClassLoader.findClass(Unknown Source)
at oracle.dbtools.jarcl.JarClassLoader.findClass(JarClassLoader.java:63)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
... 16 more
null
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at oracle.dbtools.jarcl.Entrypoint.main(Entrypoint.java:58)
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/ValidationEventHandler
at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredConstructors(Unknown Sour ce)
at java.base/java.lang.Class.getDeclaredConstructors(Unknown Source)
at oracle.dbtools.injector.impl.__Reflections.getConstructorsAnnotatedWi th(__Reflections.java:56)
at oracle.dbtools.injector.impl.Constructors.getInjectConstructors(Const ructors.java:39)
at oracle.dbtools.injector.impl.DependencyGraph.annotatedConstructor(Dep endencyGraph.java:416)
at oracle.dbtools.injector.impl.DependencyGraph.dependencies(DependencyG raph.java:204)
at oracle.dbtools.injector.impl.DependencyGraph.graph(DependencyGraph.ja va:297)
at oracle.dbtools.injector.impl.DependencyGraph.<init>(DependencyGraph.j ava:55)
at oracle.dbtools.injector.impl.DependencyGraph.<init>(DependencyGraph.j ava:37)
at oracle.dbtools.injector.impl.DependencyGraph$Builder.build(Dependency Graph.java:490)
at oracle.dbtools.injector.impl.InjectorImpl$Builder.build(InjectorImpl. java:385)
at oracle.dbtools.injector.impl.InjectorImpl$Builder.build(InjectorImpl. java:310)
at oracle.dbtools.common.di.Services$Builder.build(Services.java:416)
at oracle.dbtools.common.di.Services$Builder.build(Services.java:431)
at oracle.dbtools.conf.ConfigurationSettings.injectConfigurationSettingV alues(ConfigurationSettings.java:48)
at oracle.dbtools.common.app.ApplicationContext.<init>(ApplicationContex t.java:98)
at oracle.dbtools.common.app.ApplicationContext.<init>(ApplicationContex t.java:48)
at oracle.dbtools.cmdline.Commands.main(Commands.java:345)
... 5 more
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.ValidationEventHandl er
at java.base/java.lang.ClassLoader.findClass(Unknown Source)
at oracle.dbtools.jarcl.JarClassLoader.findClass(JarClassLoader.java:63)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
... 24 more
Why is this for? and How to fix it?
An issue with Java 9 and addressed in this SO post
Your issue can be worked around by issuing this
java -jar --add-modules java.xml.bind ords.war user test_developer "SQL Developer"
Also, if you're wanting to build RESTful Services with ORDS, you can also use SQL Developer and simply connect to the REST enabled schema and use the REST feature in the connection tree. I talk about this here.

Categories