1

私はこのバインディングファイルを持っています

<?xml version="1.0"?>
<xml-bindings
xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm"
package-name="com">
<java-types>
    <java-type name="com.test.Root">
        <xml-root-element name="root"/>
        <java-attributes>
            <xml-element java-attribute="element" xml-path="element" type="com.Element"/>
        </java-attributes>
    </java-type>
    <java-type name="com.Element"></java-type>
</java-types>

パッケージ構造とクラスの場所は、このバインディング ファイルから読み取ることができます。非整列化すると、次の例外が発生します。問題を解決する理由と方法を教えてもらえますか? パッケージ構造を変更したくありません。

JAXBException: The java-type with package [com.test] is not allowed in the bindings file keyed on package [com].
4

1 に答える 1

1

パッケージごとに 1 つのバインド ファイルが必要です。ところで、要素にパッケージ名を指定する場合、xml-bindings要素の名前を完全に修飾する必要はありませんjava-type

于 2013-07-10T22:08:08.567 に答える