【问题标题】:Using JAXB inside a Confluence Plugin在 Confluence 插件中使用 JAXB
【发布时间】:2011-04-04 13:38:45
【问题描述】:

我正在开发一个 Confluence 插件,其中包含一系列使用 JAXB 的类。当插件运行时,我得到以下运行时异常:

[INFO] [talledLocalContainer] javax.xml.bind.JAXBException: Provider com.sun.xml.bind.v2.ContextFactory not found
[INFO] [talledLocalContainer]  - with linked exception:
[INFO] [talledLocalContainer] [java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory]
[INFO] [talledLocalContainer]   at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:152)
[INFO] [talledLocalContainer]   at javax.xml.bind.ContextFinder.find(ContextFinder.java:299)
[INFO] [talledLocalContainer]   at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
[INFO] [talledLocalContainer]   at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337)
[INFO] [talledLocalContainer]   at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:244)

我的 pom.xml 文件有以下依赖:

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.6</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.atlassian.confluence</groupId>
        <artifactId>confluence</artifactId>
        <version>${confluence.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.atlassian.confluence.plugin</groupId>
        <artifactId>func-test</artifactId>
        <version>2.3-beta1</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>net.sourceforge.jwebunit</groupId>
        <artifactId>jwebunit-htmlunit-plugin</artifactId>
        <version>2.2</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>net.sourceforge.nekohtml</groupId>
        <artifactId>nekohtml</artifactId>
        <version>1.9.12</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>2.1</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
</dependencies>

关于如何让它发挥作用的任何建议?

【问题讨论】:

    标签: plugins jaxb confluence springsource-dm-server


    【解决方案1】:

    尝试在 pom.xml 中删除对 JAXB 的依赖。

    这可能已经由 Confluence 提供。

    【讨论】:

      猜你喜欢
      • 2018-07-30
      • 1970-01-01
      • 2017-10-25
      • 2022-12-18
      • 2018-02-19
      • 2011-03-06
      • 1970-01-01
      • 1970-01-01
      • 2014-09-29
      相关资源
      最近更新 更多