xjc

XJC compile result is random leading to different marshalled XMLs

自作多情 提交于 2019-12-11 10:55:00
问题 When xjc version "2.2.3-hudson-jaxb-ri-2.2-70-" is used subsequently two times, it generates two different compile results. Issue is that XML marshalled by java files from xjc compile result 1 is different (and wrong) from XML file mashalled by java files from xjc compile result 2. Difference in result XMLs is occurence/not occurence on namespace prefix ns2: <Activity Id="Id task1" Name="Task 1"> <Implementation> <ns2:Task/> </Implementation> </Activity> Difference in java code, responsible

How does one change the source directory in the sbt-xjc plugin for SBT?

好久不见. 提交于 2019-12-11 07:13:23
问题 Per the docs, the default location is: src/main/resources. My XSD's are in src/main/schema, so I need to change the sources setting. So I have used the following: sources in (xjc, Compile) <+= sourceDirectory / "main" / "schema" This results in: overloaded method value in with alternatives: [error] (p: sbt.Reference,t: sbt.Scoped)sbt.ScopedTask[Seq[java.io.File]] <and> [error] (p: sbt.Reference,c: sbt.ConfigKey)sbt.ScopedTask[Seq[java.io.File]] <and> [error] (c: sbt.ConfigKey,t: sbt.Scoped

xjc binding compiler configuration to add xmlns element to the package-info class?

眉间皱痕 提交于 2019-12-11 02:35:34
问题 I am using Gradle to generate jaxb classes in my project. Every thing is working fine but while marshalling the jaxb object we are seeing different namespaces prefixes like ns1, ns2 .. randomly in the output xml. But we dont want this and want to specify specific namespace prefixes for each namespace. I checked here and found the link 15772478 saying we have to have package-info class with xmlns element, How can i say to xjc binding compiler to add xmlns element with prifixes and namespaceURI

xsd to java with underscore in xsd file

感情迁移 提交于 2019-12-11 02:27:44
问题 Consider the below xsd file: <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="Customer_Info" type="Customer"/> <xsd:complexType name="Customer_Info"> <xsd:all> <xsd:element name="Profile" type="Profile" minOccurs="1" maxOccurs="1"/> <xsd:element name="Address" type="integer" minOccurs="1" maxOccurs="1"/> </xsd:all> </xsd:complexType> <xsd:complexType name="Profile"> <xsd:all> <xsd:element name="Name" minOccurs="1"> <xsd:simpleType> <xsd:restriction base="xsd:string

JAXB Namespace translation in a AXIS2 WebService application on Tomcat 7

◇◆丶佛笑我妖孽 提交于 2019-12-10 23:47:17
问题 I've used xjc of jaxb 2.2.6 to generate a set of classes from a xsd file. By editing "package-info.java" I've associated to the different namespaces the prefix value. So I've created a Test Class with a main that Unmarshal an xml file, edit some information, and marshal the object in xml format. Everything works like a charm and javax.xml.bind.Marshaller object match correctly namespace and prefix as defined in package-info. When I deploy this application as WS using axis2 on tomcat7 in the

How can I tell wsimport that separate WSDL files are referring to the same object classes?

和自甴很熟 提交于 2019-12-10 16:29:59
问题 I have three different JAX-WS services which use the same classes on the server (e.g. ServiceA , ServiceB , and ServiceC , all of which use MyCommonClass as a parameter). Another module we are developing is using wsimport to create a client for these services, however the problem is that wsimport creates separate instances of MyCommonClass for each service: com.company.servicea.endpoint.MyCommonClass com.company.serviceb.endpoint.MyCommonClass etc. I know that I could use the wsimport -p

Optimal JAXB XJC code generation and optimal XML schema with inheritance

走远了吗. 提交于 2019-12-10 15:07:46
问题 There have been a lot of similar questions which focus on one aspect to optimize but each solution had an ugly downside. Suppose I want to develop an XML schema (XSD) which allows the following documents and want to generate classes using XJC: <Catalogue> <Book>...</Book> <Journal>...</Journal> <Book>...</Book> ... </Catalogue> The schema should model the type hierarchy ( Book and Journal are subclasses of Publication ). Naturally, this should also be the case for the generated Java classes.

Generating Arrays for XSD Sequences via JaxB JXC

自古美人都是妖i 提交于 2019-12-10 14:32:55
问题 I've got a XSD describing some sequences of complex types e.g. <xs:complexType name="Catalog"> <xs:sequence> <xs:element name="Category" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element type="xs:string" name="ParentCategoryIDRef"/> <xs:element type="xs:string" name="Method"/> </xs:sequence> <xs:complexType> </xs:element> </xs:sequence> <xs:complexType> Now when I use JaxBs XJC to convert this into Java classes it will generate me a java.util.List in my Catalog

JAXB episode compilation with include does not work

徘徊边缘 提交于 2019-12-10 13:43:23
问题 I have 2 schemas A, B. I'm reusing some A elements in B. I do not use namespaces. I'm using <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <version>0.9.0</version> I have have defined an inclusion of schema A in schema B as: <xs:include schemaLocation="classpath:my.schema.A.xsd"/> and the catalog as REWRITE_SYSTEM "classpath:my.schema.A.xsd" "maven:my.schema:schema-a!/A.xsd" The jaxb configuration goes: <configuration> <generatePackage>my.schema.b<

How do you modify an xjc block in ANT build.xml for Java 9?

僤鯓⒐⒋嵵緔 提交于 2019-12-10 12:29:51
问题 I have a build.xml file that uses xjc to generate some Java classes. Everything builds fine in Java 1.8, but updating to Java 9 causes the following error: xjc-gen-boxes: [xjc] C:\Users\dev\Documents\Dev\bc\bcce2\build\gensrc\co\boxes\v2 is not found and thus excluded from the dependency check [xjc] Compiling file:/C:/Users/dev/Documents/Dev/bc/bcce2/co/src/co/kat/install/boxes/Box.xsd BUILD FAILED C:\Users\dev\Documents\Dev\bc\bcce2\co\build.xml:720: java.lang.NoClassDefFoundError: javax/xml