【问题标题】:Unable to start payara from eclipse无法从 Eclipse 启动 payara
【发布时间】:2023-03-16 02:15:01
【问题描述】:

Windows 10、JDK 1.8 或 15、eclipse 2021-06、maven 项目 HelloWorld。 我从 eclipse 市场安装了 payara 工具。 启动 payara 服务器给出错误信息:

"在 Felix 平台上启动 Payara 服务器 错误:解析系统捆绑语句时出错。 org.osgi.framework.BundleException: 导出的包名长度不能为零。"

【问题讨论】:

    标签: java enterprise payara


    【解决方案1】:

    我在某处读到 eclipse 2021-06 需要 jdk11,因此我已将所有路径引用更改为 jdk11 并在 eclipse 属性和构建路径中设置 jdk11,但我无法启动 payara5 服务器。 关于使用替代服务器的任何建议? 长错误消息以:

    开头
    Launching Payara Server on Felix platform
    ERROR: Error parsing system bundle statement.
    org.osgi.framework.BundleException: Exported package names cannot be zero length.
        at org.apache.felix.framework.util.manifestparser.ManifestParser.normalizeExportClauses(ManifestParser.java:865)
        at org.apache.felix.framework.util.manifestparser.ManifestParser.<init>(ManifestParser.java:217)
        at org.apache.felix.framework.ExtensionManager$ExtensionManagerRevision.update(ExtensionManager.java:982)
        at org.apache.felix.framework.ExtensionManager$ExtensionManagerRevision.access$000(ExtensionManager.java:885)
        at org.apache.felix.framework.ExtensionManager.updateRevision(ExtensionManager.java:378)
        at org.apache.felix.framework.Felix.init(Felix.java:748)
        at org.apache.felix.framework.Felix.init(Felix.java:641)
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher$1.run(OSGiFrameworkLauncher.java:93)
    WARNING: An illegal reflective access operation has occurred
    WARNING: Illegal reflective access by org.apache.felix.framework.URLHandlers (file:/C:/Users/Work/payara5/glassfish/osgi/felix/bin/felix.jar) to constructor sun.net.www.protocol.file.Handler()
    WARNING: Please consider reporting this to the maintainers of org.apache.felix.framework.URLHandlers
    WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
    WARNING: All illegal access operations will be denied in a future release
    Jul 08, 2021 3:29:21 PM com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner createBundleProvisioner
    INFO: Create bundle provisioner class = class com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.
    ERROR: Bundle org.glassfish.hk2.osgi-resource-locator [1] Error starting file:/C:/Users/Work/payara5/glassfish/modules/osgi-resource-locator.jar (org.osgi.framework.BundleException: Unable to resolve org.glassfish.hk2.osgi-resource-locator [1](R 1.0): missing requirement [org.glassfish.hk2.osgi-resource-locator [1](R 1.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.8.0)(!(version>=2.0.0))) Unresolved requirements: [[org.glassfish.hk2.osgi-resource-locator [1](R 1.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.8.0)(!(version>=2.0.0)))])
    org.osgi.framework.BundleException: Unable to resolve org.glassfish.hk2.osgi-resource-locator [1](R 1.0): missing requirement [org.glassfish.hk2.osgi-resource-locator [1](R 1.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.8.0)(!(version>=2.0.0))) Unresolved requirements: [[org.glassfish.hk2.osgi-resource-locator [1](R 1.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.8.0)(!(version>=2.0.0)))]
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4368)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2281)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1539)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.base/java.lang.Thread.run(Thread.java:832)
    ERROR: Bundle org.objectweb.asm.tree.analysis [19] Error starting file:/C:/Users/Work/payara5/glassfish/modules/asm-analysis.jar (org.osgi.framework.BundleException: Unable to resolve org.objectweb.asm.tree.analysis [19](R 19.0): missing requirement [org.objectweb.asm.tree.analysis [19](R 19.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.5.0)) Unresolved requirements: [[org.objectweb.asm.tree.analysis [19](R 19.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.5.0))])
    org.osgi.framework.BundleException: Unable to resolve org.objectweb.asm.tree.analysis [19](R 19.0): missing requirement [org.objectweb.asm.tree.analysis [19](R 19.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.5.0)) Unresolved requirements: [[org.objectweb.asm.tree.analysis [19](R 19.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.5.0))]
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4368)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2281)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1539)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.base/java.lang.Thread.run(Thread.java:832)
    ERROR: Bundle org.objectweb.asm.commons [20] Error starting file:/C:/Users/Work/payara5/glassfish/modules/asm-commons.jar (org.osgi.framework.BundleException: Unable to resolve org.objectweb.asm.commons [20](R 20.0): missing requirement [org.objectweb.asm.commons [20](R 20.0)] osgi.wiring.package; (&(osgi.wiring.package=org.objectweb.asm.signature)(version>=7.3.0)(!(version>=8.0.0))) [caused by: Unable to resolve org.objectweb.asm [23](R 23.0): missing requirement [org.objectweb.asm [23](R 23.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.5.0))] Unresolved requirements: [[org.objectweb.asm.commons [20](R 20.0)] osgi.wiring.package; (&(osgi.wiring.package=org.objectweb.asm.signature)(version>=7.3.0)(!(version>=8.0.0)))])
    org.osgi.framework.BundleException: Unable to resolve org.objectweb.asm.commons [20](R 20.0): missing requirement [org.objectweb.asm.commons [20](R 20.0)] osgi.wiring.package; (&(osgi.wiring.package=org.objectweb.asm.signature)(version>=7.3.0)(!(version>=8.0.0))) [caused by: Unable to resolve org.objectweb.asm [23](R 23.0): missing requirement [org.objectweb.asm [23](R 23.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.5.0))] Unresolved requirements: [[org.objectweb.asm.commons [20](R 20.0)] osgi.wiring.package; (&(osgi.wiring.package=org.objectweb.asm.signature)(version>=7.3.0)(!(version>=8.0.0)))]
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4368)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2281)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1539)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.base/java.lang.Thread.run(Thread.java:832)
    ERROR: Bundle org.objectweb.asm.tree [21] Error starting file:/C:/Users/Work/payara5/glassfish/modules/asm-tree.jar (org.osgi.framework.BundleException: Unable to resolve org.objectweb.asm.tree [21](R 21.0): missing requirement [org.objectweb.asm.tree [21](R 21.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.5.0)) Unresolved requirements: [[org.objectweb.asm.tree [21](R 21.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.5.0))])
    org.osgi.framework.BundleException: Unable to resolve org.objectweb.asm.tree [21](R 21.0): missing requirement [org.objectweb.asm.tree [21](R 21.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.5.0)) Unresolved requirements: [[org.objectweb.asm.tree [21](R 21.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.5.0))]
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4368)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2281)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1539)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.base/java.lang.Thread.run(Thread.java:832)
    ERROR: Bundle org.objectweb.asm.util [22] Error starting file:/C:/Users/Work/payara5/glassfish/modules/asm-util.jar (org.osgi.framework.BundleException: Unable to resolve org.objectweb.asm.util [22](R 22.0): missing requirement [org.objectweb.asm.util [22](R 22.0)] osgi.wiring.package; (&(osgi.wiring.package=org.objectweb.asm.signature)(version>=7.3.0)(!(version>=8.0.0))) [caused by: Unable to resolve org.objectweb.asm [23](R 23.0): missing requirement [org.objectweb.asm [23](R 23.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.5.0))] Unresolved requirements: [[org.objectweb.asm.util [22](R 22.0)] osgi.wiring.package; (&(osgi.wiring.package=org.objectweb.asm.signature)(version>=7.3.0)(!(version>=8.0.0)))])
    org.osgi.framework.BundleException: Unable to resolve org.objectweb.asm.util [22](R 22.0): missing requirement [org.objectweb.asm.util [22](R 22.0)] osgi.wiring.package; (&(osgi.wiring.package=org.objectweb.asm.signature)(version>=7.3.0)(!(version>=8.0.0))) [caused by: Unable to resolve org.objectweb.asm [23](R 23.0): missing requirement [org.objectweb.asm [23](R 23.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.5.0))] Unresolved requirements: [[org.objectweb.asm.util [22](R 22.0)] osgi.wiring.package; (&(osgi.wiring.package=org.objectweb.asm.signature)(version>=7.3.0)(!(version>=8.0.0)))]
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4368)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2281)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1539)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.base/java.lang.Thread.run(Thread.java:832)
    ERROR: Bundle org.objectweb.asm [23] Error starting file:/C:/Users/Work/payara5/glassfish/modules/asm.jar (org.osgi.framework.BundleException: Unable to resolve org.objectweb.asm [23](R 23.0): missing requirement [org.objectweb.asm [23](R 23.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.5.0)) Unresolved requirements: [[org.objectweb.asm [23](R 23.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.5.0))])
    org.osgi.framework.BundleException: Unable to resolve org.objectweb.asm [23](R 23.0): missing requirement [org.objectweb.asm [23](R 23.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.5.0)) Unresolved requirements: [[org.objectweb.asm [23](R 23.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.5.0))]
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4368)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2281)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1539)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.base/java.lang.Thread.run(Thread.java:832)
    ERROR: Bundle org.glassfish.hk2.class-model [29] Error starting file:/C:/Users/Work/payara5/glassfish/modules/class-model.jar (org.osgi.framework.BundleException: Unable to resolve org.glassfish.hk2.class-model [29](R 29.0): missing requirement [org.glassfish.hk2.class-model [29](R 29.0)] osgi.wiring.package; (&(osgi.wiring.package=org.objectweb.asm.signature)(version>=7.1.0)(!(version>=8.0.0))) [caused by: Unable to resolve org.objectweb.asm [23](R 23.0): missing requirement [org.objectweb.asm [23](R 23.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.5.0))] Unresolved requirements: [[org.glassfish.hk2.class-model [29](R 29.0)] osgi.wiring.package; (&(osgi.wiring.package=org.objectweb.asm.signature)(version>=7.1.0)(!(version>=8.0.0)))])
    org.osgi.framework.BundleException: Unable to resolve org.glassfish.hk2.class-model [29](R 29.0): missing requirement [org.glassfish.hk2.class-model [29](R 29.0)] osgi.wiring.package; (&(osgi.wiring.package=org.objectweb.asm.signature)(version>=7.1.0)(!(version>=8.0.0))) [caused by: Unable to resolve org.objectweb.asm [23](R 23.0): missing requirement [org.objectweb.asm [23](R 23.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.5.0))] Unresolved requirements: [[org.glassfish.hk2.class-model [29](R 29.0)] osgi.wiring.package; (&(osgi.wiring.package=org.objectweb.asm.signature)(version>=7.1.0)(!(version>=8.0.0)))]
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4368)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2281)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1539)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.base/java.lang.Thread.run(Thread.java:832)
    ERROR: Bundle fish.payara.server.internal.hk2.config-types [46] Error starting file:/C:/Users/Work/payara5/glassfish/modules/config-types.jar (org.osgi.framework.BundleException: Unable to resolve fish.payara.server.internal.hk2.config-types [46](R 46.0): missing requirement [fish.payara.server.internal.hk2.config-types [46](R 46.0)] osgi.wiring.package; (&(osgi.wiring.package=org.glassfish.hk2.utilities)(version>=2.6.0)(!(version>=3.0.0))) [caused by: Unable to resolve org.glassfish.hk2.api [132](R 132.0): missing requirement [org.glassfish.hk2.api [132](R 132.0)] osgi.wiring.package; (&(osgi.wiring.package=javax.inject)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve org.glassfish.hk2.external.jakarta.inject [161](R 161.0): missing requirement [org.glassfish.hk2.external.jakarta.inject [161](R 161.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.8))]] Unresolved requirements: [[fish.payara.server.internal.hk2.config-types [46](R 46.0)] osgi.wiring.package; (&(osgi.wiring.package=org.glassfish.hk2.utilities)(version>=2.6.0)(!(version>=3.0.0)))])
    org.osgi.framework.BundleException: Unable to resolve fish.payara.server.internal.hk2.config-types [46](R 46.0): missing requirement [fish.payara.server.internal.hk2.config-types [46](R 46.0)] osgi.wiring.package; (&(osgi.wiring.package=org.glassfish.hk2.utilities)(version>=2.6.0)(!(version>=3.0.0))) [caused by: Unable to resolve org.glassfish.hk2.api [132](R 132.0): missing requirement [org.glassfish.hk2.api [132](R 132.0)] osgi.wiring.package; (&(osgi.wiring.package=javax.inject)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve org.glassfish.hk2.external.jakarta.inject [161](R 161.0): missing requirement [org.glassfish.hk2.external.jakarta.inject [161](R 161.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.8))]] Unresolved requirements: [[fish.payara.server.internal.hk2.config-types [46](R 46.0)] osgi.wiring.package; (&(osgi.wiring.package=org.glassfish.hk2.utilities)(version>=2.6.0)(!(version>=3.0.0)))]
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4368)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2281)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1539)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.base/java.lang.Thread.run(Thread.java:832)
    ERROR: Bundle fish.payara.server.internal.core.glassfish [113] Error starting file:/C:/Users/Work/payara5/glassfish/modules/glassfish.jar (org.osgi.framework.BundleException: Unable to resolve fish.payara.server.internal.core.glassfish [113](R 113.0): missing requirement [fish.payara.server.internal.core.glassfish [113](R 113.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.8.0)(!(version>=2.0.0))) Unresolved requirements: [[fish.payara.server.internal.core.glassfish [113](R 113.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.8.0)(!(version>=2.0.0)))])
    org.osgi.framework.BundleException: Unable to resolve fish.payara.server.internal.core.glassfish [113](R 113.0): missing requirement [fish.payara.server.internal.core.glassfish [113](R 113.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.8.0)(!(version>=2.0.0))) Unresolved requirements: [[fish.payara.server.internal.core.glassfish [113](R 113.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.8.0)(!(version>=2.0.0)))]
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4368)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2281)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1539)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.base/java.lang.Thread.run(Thread.java:832)
    ERROR: Bundle org.glassfish.hk2.api [132] Error starting file:/C:/Users/Work/payara5/glassfish/modules/hk2-api.jar (org.osgi.framework.BundleException: Unable to resolve org.glassfish.hk2.api [132](R 132.0): missing requirement [org.glassfish.hk2.api [132](R 132.0)] osgi.wiring.package; (&(osgi.wiring.package=org.glassfish.hk2.utilities.reflection)(version>=2.6.0)(!(version>=3.0.0))) [caused by: Unable to resolve org.glassfish.hk2.utils [138](R 138.0): missing requirement [org.glassfish.hk2.utils [138](R 138.0)] osgi.wiring.package; (&(osgi.wiring.package=javax.inject)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve org.glassfish.hk2.external.jakarta.inject [161](R 161.0): missing requirement [org.glassfish.hk2.external.jakarta.inject [161](R 161.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.8))]] Unresolved requirements: [[org.glassfish.hk2.api [132](R 132.0)] osgi.wiring.package; (&(osgi.wiring.package=org.glassfish.hk2.utilities.reflection)(version>=2.6.0)(!(version>=3.0.0)))])
    org.osgi.framework.BundleException: Unable to resolve org.glassfish.hk2.api [132](R 132.0): missing requirement [org.glassfish.hk2.api [132](R 132.0)] osgi.wiring.package; (&(osgi.wiring.package=org.glassfish.hk2.utilities.reflection)(version>=2.6.0)(!(version>=3.0.0))) [caused by: Unable to resolve org.glassfish.hk2.utils [138](R 138.0): missing requirement [org.glassfish.hk2.utils [138](R 138.0)] osgi.wiring.package; (&(osgi.wiring.package=javax.inject)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve org.glassfish.hk2.external.jakarta.inject [161](R 161.0): missing requirement [org.glassfish.hk2.external.jakarta.inject [161](R 161.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.8))]] Unresolved requirements: [[org.glassfish.hk2.api [132](R 132.0)] osgi.wiring.package; (&(osgi.wiring.package=org.glassfish.hk2.utilities.reflection)(version>=2.6.0)(!(version>=3.0.0)))]
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4368)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2281)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1539)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.base/java.lang.Thread.run(Thread.java:832)
    ERROR: Bundle fish.payara.server.internal.hk2.config [133] Error starting file:/C:/Users/Work/payara5/glassfish/modules/hk2-config.jar (org.osgi.framework.BundleException: Unable to resolve fish.payara.server.internal.hk2.config [133](R 133.0): missing requirement [fish.payara.server.internal.hk2.config [133](R 133.0)] osgi.wiring.package; (osgi.wiring.package=javax.management) Unresolved requirements: [[fish.payara.server.internal.hk2.config [133](R 133.0)] osgi.wiring.package; (osgi.wiring.package=javax.management)])
    org.osgi.framework.BundleException: Unable to resolve fish.payara.server.internal.hk2.config [133](R 133.0): missing requirement [fish.payara.server.internal.hk2.config [133](R 133.0)] osgi.wiring.package; (osgi.wiring.package=javax.management) Unresolved requirements: [[fish.payara.server.internal.hk2.config [133](R 133.0)] osgi.wiring.package; (osgi.wiring.package=javax.management)]
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4368)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2281)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1539)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.base/java.lang.Thread.run(Thread.java:832)
    ERROR: Bundle org.glassfish.hk2.locator [136] Error starting file:/C:/Users/Work/payara5/glassfish/modules/hk2-locator.jar (org.osgi.framework.BundleException: Unable to resolve org.glassfish.hk2.locator [136](R 136.0): missing requirement [org.glassfish.hk2.locator [136](R 136.0)] osgi.wiring.package; (&(osgi.wiring.package=org.glassfish.hk2.api.messaging)(version>=2.6.0)(!(version>=3.0.0))) [caused by: Unable to resolve org.glassfish.hk2.api [132](R 132.0): missing requirement [org.glassfish.hk2.api [132](R 132.0)] osgi.wiring.package; (&(osgi.wiring.package=javax.inject)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve org.glassfish.hk2.external.jakarta.inject [161](R 161.0): missing requirement [org.glassfish.hk2.external.jakarta.inject [161](R 161.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.8))]] Unresolved requirements: [[org.glassfish.hk2.locator [136](R 136.0)] osgi.wiring.package; (&(osgi.wiring.package=org.glassfish.hk2.api.messaging)(version>=2.6.0)(!(version>=3.0.0)))])
    org.osgi.framework.BundleException: Unable to resolve org.glassfish.hk2.locator [136](R 136.0): missing requirement [org.glassfish.hk2.locator [136](R 136.0)] osgi.wiring.package; (&(osgi.wiring.package=org.glassfish.hk2.api.messaging)(version>=2.6.0)(!(version>=3.0.0))) [caused by: Unable to resolve org.glassfish.hk2.api [132](R 132.0): missing requirement [org.glassfish.hk2.api [132](R 132.0)] osgi.wiring.package; (&(osgi.wiring.package=javax.inject)(version>=1.0.0)(!(version>=2.0.0))) [caused by: Unable to resolve org.glassfish.hk2.external.jakarta.inject [161](R 161.0): missing requirement [org.glassfish.hk2.external.jakarta.inject [161](R 161.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.8))]] Unresolved requirements: [[org.glassfish.hk2.locator [136](R 136.0)] osgi.wiring.package; (&(osgi.wiring.package=org.glassfish.hk2.api.messaging)(version>=2.6.0)(!(version>=3.0.0)))]
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4368)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2281)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1539)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.base/java.lang.Thread.run(Thread.java:832)
    ERROR: Bundle org.glassfish.hk2.runlevel [137] Error starting file:/C:/Users/Work/payara5/glassfish/modules/hk2-runlevel.jar (org.osgi.framework.BundleException: Unable to resolve org.glassfish.hk2.runlevel [137](R 137.0): missing requirement [org.glassfish.hk2.runlevel [137](R 137.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.8)) Unresolved requirements: [[org.glassfish.hk2.runlevel [137](R 137.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.8))])
    org.osgi.framework.BundleException: Unable to resolve org.glassfish.hk2.runlevel [137](R 137.0): missing requirement [org.glassfish.hk2.runlevel [137](R 137.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.8)) Unresolved requirements: [[org.glassfish.hk2.runlevel [137](R 137.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=1.8))]
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4368)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2281)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1539)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.base/java.lang.Thread.run(Thread.java:832)
    ERROR: Bundle org.glassfish.hk2.utils [138] Error starting file:/C:/Users/Work/payara5/glassfish/modules/hk2-utils.jar (org.osgi.framework.BundleException: Unable to resolve org.glassfish.hk2.utils [138](R 138.0): missing requirement [org.glassfish.hk2.utils [138](R 138.0)] osgi.wiring.package; (osgi.wiring.package=javax.xml.namespace) Unresolved requirements: [[org.glassfish.hk2.utils [138](R 138.0)] osgi.wiring.package; (osgi.wiring.package=javax.xml.namespace)])
    org.osgi.framework.BundleException: Unable to resolve org.glassfish.hk2.utils [138](R 138.0): missing requirement [org.glassfish.hk2.utils [138](R 138.0)] osgi.wiring.package; (osgi.wiring.package=javax.xml.namespace) Unresolved requirements: [[org.glassfish.hk2.utils [138](R 138.0)] osgi.wiring.package; 
    

    ...

    【讨论】:

    【解决方案2】:

    对使用替代服务器有什么建议吗?

    您是否尝试过从他们的站点下载完整的 Payara 服务器并直接运行它。然后您可以使用热部署文件夹安装和更新战争文件。

    另一种选择是使用 docker-compose 在 docker 中运行 Payara 服务器。只需在某处创建文件夹并使用以下内容创建 docker-compose.yml。

    docker-compose.yml

    version: '3.1'
       
      services:     
        # Full payara application-server
        payara-server-full:
          container_name: payara-server-full
          image: payara/server-full:5.2021.1
          ports:
            - 8080:8080 # HTTP listener
            - 8443:8443 # HTTPS listener
            - 6900:6900 # Hazelcast cluster communication port
            - 4848:4848 # admin console. localhost:4848 (user:admin pw:admin)
          volumes:
            # persist auto-deployments
            - payara-domain1:/opt/payara/appserver/glassfish/domains/domain1/ 
            # startup deployment
            - ./payara/deployments:/opt/payara/deployments:z 
            # war-files in this folder will be auto-deployed to payara
            - ./payara/autodeploy:/opt/payara/appserver/glassfish/domains/domain1/autodeploy:z 
        
      volumes:
        payara-domain1
    

    用法:

    # Startup
    docker-compose up -d
    
    # Shutdown
    docker-compose down
    
    # Remove the volume to clean up or start fresh
    docker volumes rm payara-domain1
    

    一种使用 maven-war-plugin 自动部署的简单方法。

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.3.1</version>
        <configuration>
            <outputDirectory>***path-to-autodeploy**</outputDirectory>
        </configuration>
    </plugin>
    

    【讨论】:

    • 感谢您的输入,但我已切换到使用 tomcat 9.0 服务器,启动正常。我确实按照你的建议直接下载了payara,但我对docker不熟悉。
    【解决方案3】:

    您可以阅读Payara Server的“README.TXT” -> 目前支持JVM、JDK8、JDK11。

    只需按照以下步骤操作: 文件 > 新建 > 其他... >(文件夹)服务器 > 服务器

    点击下一步

    选择服务器类型:Payara

    (如果您有以前的运行时配置,请删除它们) 所以现在,选择 Payara 位置文件夹和 Java 位置(选择 jdk-11 文件夹)--> Eclipse 可能会给你一个默认路径为 .p2 ......不要使用那个,使用你的 jdk-11 的路径.

    然后您可以选择名称、您的域路径、调试凭据并单击完成。

    现在您可以右键单击 > 启动您的 payara 服务器,它应该可以工作了。

    您也可以在网络浏览器上查看 localhost:4848。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-04
      • 2014-04-24
      • 2018-10-28
      相关资源
      最近更新 更多