gpt4 book ai didi

java - ORDS "java -jar ords.war"命令错误

转载 作者:行者123 更新时间:2023-11-30 02:15:34 26 4
gpt4 key购买 nike

我正在遵循本指南:https://docs.oracle.com/cd/E56351_01/doc.30/e87809/getting-started-with-RESTful-services.htm#AELIG90200

但我陷入了“F.2 从 SQL 查询创建 RESTful 服务”。

在安装 Oracle REST 数据服务的文件夹中,我在命令提示符中输入了以下命令:

java -jar ords.war user test_developer "SQL Developer"

我得到了这个错误:

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

这是为什么?以及如何修复它?

最佳答案

Java 9 的问题,已在 this SO post 中解决

您的问题可以通过发出此命令来解决

java -jar --add-modules java.xml.bind ords.war 用户 test_developer“SQL Developer”

此外,如果您想使用 ORDS 构建 RESTful 服务,您还可以使用 SQL Developer,只需连接到支持 REST 的架构并使用连接树中的 REST 功能即可。我讲这个here

enter image description here

关于java - ORDS "java -jar ords.war"命令错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48586571/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com