Cannot generate classes with JAXB

I try to generate classes using JAXB, but I get an exception: IllegalArgumentException: Invalid wildcard character 'g' I am using a complex XSD file and a binding file, as shown below. Can someone make it clear where to investigate?

<jxb:bindings version="1.0" xmlns:jxb="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" jxb:extensionBindingPrefixes="xjc"> <jxb:bindings schemaLocation="IFX170_XSD.xsd" node="/xs:schema"> <jxb:schemaBindings> <jxb:package name="cy.com.netinfo.netteller.ifx"/> </jxb:schemaBindings> </jxb:bindings> <jxb:bindings schemaLocation="RemitDetail_Type.xsd" node="/xs:schema"> <jxb:schemaBindings> <jxb:package name="cy.com.netinfo.netteller.ifx.remitdetailinfo"/> </jxb:schemaBindings> </jxb:bindings> <jxb:bindings schemaLocation="$pain.001.001.01.xsd" node="/xs:schema"> <jxb:schemaBindings> <jxb:package name="cy.com.netinfo.netteller.ifx.swift.pain_001_001_1"/> </jxb:schemaBindings> </jxb:bindings> <jxb:bindings schemaLocation="$pain.002.001.01.xsd" node="/xs:schema"> <jxb:schemaBindings> <jxb:package name="cy.com.netinfo.netteller.ifx.swift.pain_002_001_1"/> </jxb:schemaBindings> </jxb:bindings> <jxb:bindings schemaLocation="$pain.004.001.01.xsd" node="/xs:schema"> <jxb:schemaBindings> <jxb:package name="cy.com.netinfo.netteller.ifx.swift.pain_004_001_1"/> </jxb:schemaBindings> </jxb:bindings> 

0
source share
2 answers

I finally found the answer. The problem is due to an error in the Options class in the com.sun.tools.xjc package. In the getPrologComment method, the class constructs a localized message with the fot date and time parameter from a localized resource package, but then formats the date using a fixed Locale.ENGLISH. This behavior is inside JAXB 2.2.6. I solved the problem by simply updating the MessageBundle_it.properties file (in my case for italian) in the package com \ sun \ tools \ xjc \ jar of the jaxb-xjc.jar file. The changes I made were: Driver.DateFormat = aaaa.MM.gg (original) for Driver.DateFormat = yyyy / MM / dd (new) and Driver.TimeFormat = hh: mm: ss az (original) to Driver. TimeFormat = HH: mm: ss (new) With these changes, I was able to generate classes as needed. NTN Flavio

+2
source

I could suggest that one of your xsd files has a regexp based restriction attached to the type / element. Have you confirmed these files?

0
source

Source: https://habr.com/ru/post/1479337/


All Articles