users@jaxb.java.net

Re: strange error message when using XJC (via the Maven 2 plugin) to generate POJOs for XMPP

From: James Strachan <james.strachan_at_gmail.com>
Date: Fri, 27 Oct 2006 08:03:34 +0100

BTW if anyone else is interested in how to work with XMPP (Jabber)
with JAXB2.0 its all working very nicely here - we just had to fix up
some errors in XMPP's schemas...

http://activemq.org/site/xmpp.html


On 10/23/06, James Strachan <james.strachan_at_gmail.com> wrote:
> Awesome - many thanks! That fixed it :)
>
> On 10/23/06, Aleksei Valikov <valikov_at_gmx.net> wrote:
> > James Strachan wrote:
> > > As an experiment I started a little maven project to try use JAXB's
> > > XJC to auto-create the POJOs for working with the XMPP protocol...
> > >
> > > https://svn.apache.org/repos/asf/incubator/activemq/sandbox/activemq-xmpp/
> > >
> > > I had to tweak the schemas a little as quite a few of the schemas at
> > > http://xmpp.org/schemas/ seem invalid.
> > >
> > > I've got most of the errors licked now I think, but I get the
> > > following errors which I can't make head nor tail of.
> > >
> > > I just wondered if anyone else could figure out what the problem is?
> > > The XSDs all seem valid from IDEA at least :) Whats particularly
> > > confusing is I can't find 'MessageOrPresenceOrIq' in any of the XSDs.
> >
> > The problem is with your "stream" type from streams.xsd. It contains the
> > following definition:
> >
> > <xs:choice minOccurs="0" maxOccurs="1">
> > <xs:choice minOccurs="0" maxOccurs="unbounded">
> > <xs:element ref="client:message"/>
> > <xs:element ref="client:presence"/>
> > <xs:element ref="client:iq"/>
> > </xs:choice>
> > <xs:choice minOccurs="0" maxOccurs="unbounded">
> > <xs:element ref="server:message"/>
> > <xs:element ref="server:presence"/>
> > <xs:element ref="server:iq"/>
> > <xs:element ref="db:result"/>
> > <xs:element ref="db:verify"/>
> > </xs:choice>
> >
> > These choices are mapped onto two choice properties. Names of these properties
> > are constructred from the names of the element. Only three first elements are
> > considered, no namespace prefixes taken into an account. Therefore you have
> > MessageOrPresenceOrIq for both choices.
> > To resolve it, give one of the choices another name with jaxb:property
> > customization.
> >
> > Another problem with this type is with two xs:any properties. I am not sure if
> > it is allowed at all with JAXB2, but you could try renaming one of these
> > properties (again, with jaxb:property annotations).
> >
> > Bye.
> > /lexi
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> > For additional commands, e-mail: users-help_at_jaxb.dev.java.net
> >
> >
>
>
> --
>
> James
> -------
> http://radio.weblogs.com/0112098/
>


-- 
James
-------
http://radio.weblogs.com/0112098/