highsource / ogc-schemas

XML<->Java and XML<->JS for OGC XSDs.
BSD 2-Clause "Simplified" License
82 stars 49 forks source link

WaterML MonitoringPoint.java error #176

Closed Korysam15 closed 8 years ago

Korysam15 commented 8 years ago

After running Maven on the pom.xml file for waterml, I proceeded to open up the generated files/import them into eclipse using the Maven plugin. However, MonitoringPoint.java has an error on line 181 that states: The return type is incompatible with AbstractGMLType.GetDescriptionReference() overrides the net.opengis.gml.v_3_2_1.AbstractGMLType.GetDescriptionReference()

The code below is from line 181. Eclipse suggests changing the return type but if you do then more errors proceed to pop up. Any ideas on what to change?

public List<ReferenceType> getDescriptionReference() { if (descriptionReference == null) { descriptionReference = new ArrayList<ReferenceType>(); } return this.descriptionReference; }

highsource commented 8 years ago

Either use the generated sources (just take the JAR) or use the supplied binding files: https://github.com/highsource/ogc-schemas/blob/master/waterml/2.0/src/main/resources/waterml-v_2_0.xjb#L12-L16

http://mvnrepository.com/artifact/org.jvnet.ogc/waterml-v_2_0

You should not import generated files into Eclispe. Either use the distributed JAR or set up schema compilation. Yo can use the mentioned binding file for this. From what you report you probably have some kind of partial setup of the schema compilation. You get something generated, but did not use the binding file. This is why you have name conflict in the generated property. I solve this name conflict with binding file.

Korysam15 commented 8 years ago

Sorry to bother but the jar you are talking about is waterml-v_2_0-2.6.2-SNAPSHOT.jar? Also what is the command to use the external binding file?!

highsource commented 8 years ago

No, I'm talking about the distributed JAR:

http://repo1.maven.org/maven2/org/jvnet/ogc/waterml-v_2_0/2.6.1/waterml-v_2_0-2.6.1.jar

But you can also take the new snapshot, this does not matter much.

Using the binding file:

https://github.com/highsource/maven-jaxb2-plugin/wiki/Specifying-What-To-Compile#specifying-bindings

But I'd advise against setting up your own schema compilation. That's quite complicated, the whole purpose of this project is to let you avoid this complexity. :) Just use the provided JARs.