Reputation: 3009
Having this .xjb file, Eclipse cmplains that it can't find the element jaxb:bindings. Where does this come from?
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jaxb:bindings xmlns="http://java.sun.com/xml/ns/jaxb"
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd" version="2.1">
<jaxb:globalBindings>
<jaxb:serializable uid="1" />
<xjc:javaType name="java.lang.Integer" xmlType="xs:int"
adapter="com.foo.bar.jaxb.adapter.IntegerAdapter" />
<xjc:javaType name="java.lang.Integer" xmlType="xs:integer"
adapter="com.foo.bar.jaxb.adapter.IntegerAdapter" />
<xjc:javaType name="java.util.Date" xmlType="xs:time"
adapter="com.foo.bar.jaxb.adapter.TimeAdapter" />
<xjc:javaType name="java.util.Date" xmlType="xs:date"
adapter="com.foo.bar.jaxb.adapter.DateAdapter" />
<xjc:javaType name="java.util.Date" xmlType="xs:dateTime"
adapter="com.foo.bar.jaxb.adapter.DateTimeAdapter" />
</jaxb:globalBindings>
</jaxb:bindings>
Eclipse complains in line 9:
cvc-elt.1: Cannot find the declaration of element 'jaxb:bindings'.
Why...and how can I can i fix teh problem?
Upvotes: 5
Views: 4245
Reputation: 8282
I use this configuration in my projects.. (maven & maven-jaxb2-plugin)
<bindings version="2.0" xmlns="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:annox="http://annox.dev.java.net">
<globalBindings>
<xjc:serializable uid="12343" />
<xjc:simple/>
</globalBindings>
</bindings>
remove schema location declaration.
Upvotes: 2