在Confluence插件中使用JAXB

问题描述 投票:2回答:1

我有一个我正在研究的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个回答
0
投票

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

这可能已由Confluence提供。

© www.soinside.com 2019 - 2024. All rights reserved.