Skip to main content

2, 362 cannot find symbol symbol : method required()

4 replies [Last post]
rimartin7
Offline
Joined: 2005-05-09

Using jdk1.6.0_19 and jaxb
I'm trying to bind mathml3 xsd http://www.w3.org/Math/XMLSchema/mathml3/mathml3.xsd. Got the custom binding to work to generate files

<br />
<?xml version="1.0" encoding="UTF-8"?></p>
<p>

Then run into 2,362 "cannot find symbol symbol : method required()" This is related to annotation @XmlElementRef.

I've had this problem for over a year with all current versions and numerous xsd's. For some cases there were just a few so I could fix by hand but 2,362 is beyond me :-) Haven't found what javac compiler version the xjc generator generates for wrt to XmlElementRef.

Is there a way to customize around this?
Some correct version?
A workaround?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rimartin7
Offline
Joined: 2005-05-09

Oh, code looks like:
[code]
public class AnnotationXmlModel {

@XmlElementRefs({
@XmlElementRef(name = "apply", namespace = "http://www.w3.org/1998/Math/MathML", type = Apply.class, required = false),
@XmlElementRef(name = "unary-set.class", namespace = "http://www.w3.org/1998/Math/MathML", type = JAXBElement.class, required = false),
@XmlElementRef(name = "semantics", namespace = "http://www.w3.org/1998/Math/MathML", type = JAXBElement.class, required = false),
@XmlElementRef(name = "product.class", namespace = "http://www.w3.org/1998/Math/MathML", type = JAXBElement.class, required = false),
@XmlElementRef(name = "bind", namespace = "http://www.w3.org/1998/Math/MathML", type = Bind.class, required = false),
@XmlElementRef(name = "nary-setlist-constructor.class", namespace = "http://www.w3.org/1998/Math/MathML", type = JAXBElement.class, required = false),
@XmlElementRef(name = "abs", namespace = "http://www.w3.org/1998/Math/MathML", type = Abs.class, required = false),
@XmlElementRef(name = "constant-set.class", namespace = "http://www.w3.org/1998/Math/MathML", type = JAXBElement.class, required = false),
@XmlElementRef(name = "nary-set.class", namespace = "http://www.w3.org/1998/Math/MathML", type = JAXBElement.class, required = false),
@XmlElementRef(name = "sum.class", namespace = "http://www.w3.org/1998/Math/MathML", type = JAXBElement.class, required = false),
@XmlElementRef(name = "ci", namespace = "http://www.w3.org/1998/Math/MathML", type = Ci.class, required = false),
@XmlElementRef(name = "ceiling", namespace = "http://www.w3.org/1998/Math/MathML", type = Ceiling.class, required = false),
@XmlElementRef(name = "binary-linalg.class", namespace = "http://www.w3.org/1998/Math/MathML", type = JAXBElement.class, required = false),
@XmlElementRef(name = "unary-elementary.class", namespace = "http://www.w3.org/1998/Math/MathML", type = JAXBElement.class, required = false),
@XmlElementRef(name = "root", namespace = "http://www.w3.org/1998/Math/MathML", type = Root.class, required = false),
@XmlElementRef(name = "real", namespace = "http://www.w3.org/1998/Math/MathML", type = Real.class, required = false),
....
[/code]

rimartin7
Offline
Joined: 2005-05-09

remove the ,require = false and the compile error goes away and on small examples the binding work successfully.

rimartin7
Offline
Joined: 2005-05-09

Ah! if
[code]
-Xbootclasspath/p:C:/java.net/jaxb-ri-20091104/lib/jaxb-impl.jar;C:/java.net/jaxb-ri-20091104/lib/jaxb-api.jar
[/code] is prepended using the -Xbootclasspath/p: mechanism and put into the NetBean's "Project Properties" category Build->Compiling "Additional Compiler Options:" field it compiles for the xjc 2.2 target

Now to apply the Mathml binding and see how it performs !

tahicks
Offline
Joined: 2009-04-03

This did not work for me when using NB 6.8. Any suggestions on how to diagnose and correct the issue?

Tried adding the following to the noted Build, Compiling, Additional Compile Options text box:
-Xbootclasspath/p:/home/hicks/Downloads/tmp/jaxb/tmp/jaxb-ri/dist/lib/jaxb-impl.jar;/home/hicks/Downloads/tmp/jaxb/tmp/jaxb-ri/dist/lib/jaxb-api.jar

Also, tried placing the following into this compile options text box noted instead: (since this version with NB 6.8 looked like the same as the JAXB-RI 2.2.1 download available from Sun/Oracle
-Xbootclasspath/p:/opt/netbeans-6.8/./ide12/modules/ext/jaxb/jaxb-impl.jar;/opt/netbeans-6.8/./ide12/modules/ext/jaxb/api/jaxb-api.jar

What is also curious is why this stuff does not 'work out of the box' with NB 6.8...