users@jaxb.java.net

Re: Mixing schema-derived and own annotation defined types in a JaxbContext

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Thu, 26 Nov 2009 09:33:59 +0100

Probably with the message "...doesnt contain ObjectFactory.class or
jaxb.index" (which you might have told us). See the JAXB Tutorial section on
JAXBContext<https://jaxb.dev.java.net/tutorial/section_3_5-The-JAXB-Context.html#The%20JAXB%20Context>
.

-W


On Thu, Nov 26, 2009 at 1:40 AM, David J. M. Karlsen <david_at_davidkarlsen.com>
wrote:
> Hi!
>
> I have classes which were generated by XJC from and XSD, as well as a few
> homebrew classes/types, which were defined with annotations, like this:
>
> package jaxbPoc.client;
>
> import javax.xml.bind.annotation.XmlAccessType;
> import javax.xml.bind.annotation.XmlAccessorType;
> import javax.xml.bind.annotation.XmlElement;
> import javax.xml.bind.annotation.XmlRootElement;
> import javax.xml.bind.annotation.XmlType;
>
>
> @XmlRootElement( name="someElementName", namespace="" )
> @XmlAccessorType( XmlAccessType.FIELD )
> @XmlType
> public class SomeHomeBrewStructure
> {
> @XmlElement( name="TheElementName" )
> private String someVar = "theElementValue";
>
> }
>
> The generated ones are in jaxbCode.generated
>
> This works:
> jc = JAXBContext.newInstance("jaxbPoc.generatedCode");
>
> and this works:
> jc = JAXBContext.newInstance(jaxbPoc.client.SomeHomeBrewStructure.class);
>
> but this will not work:
> JAXBContext.newInstance("jaxbPoc.generatedCode:jaxbPoc.client");
>
> which is very un-handy.
>
> Is there no way to define them both in the one context together?
>
> --
> --
> David J. M. Karlsen - +47 90 68 22 43
> http://www.davidkarlsen.com
> http://mp3.davidkarlsen.com
> Sent from my bog-standard SMTP client
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>