2016-06-21 8 views
-1

waterml2.xsd用の外部バインディングファイルを作成し、これまで[エラー]プロパティ "行"が既に定義されており、[エラー]プロパティ "タイトル"が既に定義されています。JAXB外部バインディングファイルエラー

これらを修正した後、私は現在、衝突を扱う複数の問題が発生しています。例えば:

は[ERROR]同じ名前のクラス/インタフェース "net.opengis.gml._3.SecondDefiningParameter" が既に使用されています。この競合を解決するには、 クラスのカスタマイズを使用してください。

[エラー] 2つの宣言により、ObjectFactoryクラスの衝突が発生します。


これは、バインディングファイルは次のようになります。誰もが何か提案を持っているか、私はいくつかの助けをいただければ幸いです前WaterML 2.0スキーマを扱っている場合

<bindings xmlns="http://java.sun.com/xml/ns/jaxb" xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"> 
<!-- In geometryPrimitives.xsd, fix so element and attribute both with name "rows" don't conflict --> 
<bindings schemaLocation="http://schemas.opengis.net/gml/3.2.1/geometryPrimitives.xsd" version="3.2.1.2"> 
<bindings node="//xs:group/xs:sequence/xs:element[@name='rows']"> 
<property name="rowsElement"/> 
</bindings> 
</bindings> 
<!-- In xlink.xsd, fix so element and attributes don't have the same "titles" conflict --> 
<bindings schemaLocation="http://www.w3.org/1999/xlink.xsd" node="/xs:schema"> 
<schemaBindings> 
<package name="net.opengis.wfs._2_1"/> 
</schemaBindings> 
</bindings> 
<bindings schemaLocation="http://www.w3.org/1999/xlink.xsd" node="/xs:schema"> 
<bindings node="//xs:attributeGroup[@name='locatorAttrs']"> 
<bindings node=".//xs:attribute[@ref='xlink:title']"> 
<property name="LocatorAttrsTitle"/> 
</bindings> 
</bindings> 
<bindings node="//xs:group[@name='locatorModel']"> 
<bindings node=".//xs:element[@ref='xlink:title']"> 
<property name="LocatorModelTitle"/> 
</bindings> 
</bindings> 
<bindings node="//xs:attributeGroup[@name='arcAttrs']"> 
<bindings node=".//xs:attribute[@ref='xlink:title']"> 
<property name="ArcAttrsTitle"/> 
</bindings> 
</bindings> 
<bindings node="//xs:group[@name='arcModel']"> 
<bindings node=".//xs:element[@ref='xlink:title']"> 
<property name="ArcModelTitle"/> 
</bindings> 
</bindings> 
</bindings> 
</bindings> 

!ありがとう。

答えて

0

OGCスキーマでは、JAXBを正しく実行するには少し追加のバインディング情報が必要です。あなたはhttps://github.com/highsource/ogc-schemasでの勤勉に頼っているほうがずっと良いです。

ハイソースのバインディングを使用するには、リポジトリをクローンしてmavenを使用してバインディングをビルドするのが最善の方法です(このプロジェクトでは、優れたビルドサポートがあります)。私。

git clone https://github.com/highsource/ogc-schemas.git 
mvn install –D skipTests 

高速化のためにテストをスキップし、1つのテストで問題が発生しましたが失敗しました。

また、基本のpom.xmlをEclipse(または使用するIDE)にインポートして、mavenビルドを実行することもできます。

ビルドしたら、関連するフォルダの下にバインディングを作成する必要があります。例えば。 WaterML2.0:

ls waterml/2.0/target/generated-sources/xjc/net/opengis/waterml/v_2_0/ 

CategoricalTVPType.java 
CategoricalTimeseriesType.java 
CollectionPropertyType.java 
CollectionType.java 
CommentBlockPropertyType.java 
and so on.. 

ターゲット/クラスフォルダにはXJBファイルがあります。

関連する問題