xml - Failed to generate java classes from xsd using binding -
i have lot of xsd in path generate java classes. in bindings file have:
<jaxb:bindings schemalocation="../aiseo/xsd/aiseotypy.xsd" node="/xs:schema"> </jaxb:bindings>
but throw error:
[error] failed execute goal org.apache.cxf:cxf-codegen-plugin:3.1.1:wsdl2java (generate-sources-iszr) on project iszr-dataset: execution generate-sources-iszr of goal org.apache.cxf:cxf-codegen-plugin:3.1.1:wsdl2java failed: file:/some/path/resources/wsdl/binding/bindings.xml [16,79]: "file:/some/path/resources/wsdl/aiseo/xsd/aiseotypy.xsd" not part of compilation. mistake "file:/some/path/resources/wsdl/ais3/xsd/ais3typy.xsd"?
so tried change advise me
<jaxb:bindings schemalocation="../ais3/xsd/ais3typy.xsd" node="/xs:schema"> </jaxb:bindings>
but throw error , advise use previous xsd.
[error] failed execute goal org.apache.cxf:cxf-codegen-plugin:3.1.1:wsdl2java (generate-sources-iszr) on project iszr-dataset: execution generate-sources-iszr of goal org.apache.cxf:cxf-codegen- plugin:3.1.1:wsdl2java failed: file:/some/path/resources/wsdl/binding/bindings.xml [15,77]: "file:/some/path/resources/wsdl/ais3/xsd/ais3typy.xsd" not part of compilation. mistake "file:/some/path/resources/wsdl/aiseo/xsd/aiseotypy.xsd"?
so confused why still throw error in both cases
both xsd should in path because can see advise me.
update:
after debugging found problem. in first case generated classes , throw error when start procesing wsdl ais3...
ok:
[debug] calling wsdl2java args: [-encoding, utf-8, -d, /home/hudect/git/ais3/backend/common-reactor/iszr-dataset/target/generated-sources/cxf, -b, file:/some/path/resources/wsdl/binding/bindings.xml, -xjc-xinheritance, -verbose, file:/some/path/resources/wsdl/aiseo/wsdl/aiseoctiaifo.wsdl] loading frontend jaxws ... loading databinding jaxb ... wsdl2java -encoding utf-8 -d /some/path/generated-sources/cxf -b file:/home/some/path/resources/wsdl/binding/bindings.xml -xjc-xinheritance -verbose file:/some/path/resources/wsdl/aiseo/wsdl/aiseoctiaifo.wsdl wsdl2java - apache cxf 3.1.1
error:
[debug] calling wsdl2java args: [-encoding, utf-8, -d, /some/path/generated-sources/cxf, -b, file:/some/path/resources/wsdl/binding/bindings.xml, -xjc-xinheritance, -verbose, file:/some/path/resources/wsdl/ais3/wsdl/ais3rrcctihromadneaifo.wsdl] loading frontend jaxws ... loading databinding jaxb ... wsdl2java -encoding utf-8 -d /some/path/generated-sources/cxf -b file:/some/path/resources/wsdl/binding/bindings.xml -xjc-xinheritance -verbose file:/some/path/resources/wsdl/ais3/wsdl/ais3rrcctihromadneaifo.wsdl wsdl2java - apache cxf 3.1.1
but dont understand why must in path ? in xsd ais3 used ais3typy , in aiseo used aiseotypy. there option how use 1 binding file declaration written. know can divided more file , create more execution in maven have more 10 of file *typy.xsd want 1 binding.
the path schemalocation not correct.
it should relative binding file.
if have
workspace/ - binding/xyz.xjb - xsd/file.xsd
youd should have :
schemalocation="../xsd/file.xsd"
Comments
Post a Comment