users@jaxb.java.net

Re: How to use subclasses of JAXB created classes

From: Christophe Alexandre <alexandre_at_magillem.com>
Date: Tue, 3 Jul 2007 15:49:29 +0200

Yeap right, JAXB 2.0 is included in JAVA 6.
This caused a problem for me, because in a first time the JAVA 6 jars
were overriding my JAXB 2.1 jars.
I had to use the -Djava.endorsed.dirs="path" instruction




Le 3 juil. 07 à 15:33, William Saxton a écrit :

> Whoa...looks like JAXB 2.0 is the one in Java 6. It also looks like
> using 2.1 is not as simple as putting a jar in the classpath!
>
> Lemme try to upgrade to 2.1 and see what happens. I found
> instructions on Kohsuke K's blog so we'll see how that goes.
>
> On 7/3/07, Christophe Alexandre <alexandre_at_magillem.com> wrote:
>> This is strange, because using JAXB 2.1, it works fine for me.
>>
>>
>> Le 3 juil. 07 à 14:30, William Saxton a écrit :
>>
>> > Yes, just substitute
>> >
>> > name: com.sun.crae.genereratedcomponents.ObjectFactory
>> >
>> > with
>> >
>> > name: com.sun.xml.bind.ObjectFactory
>> >
>> > On 7/3/07, Christophe Alexandre <alexandre_at_magillem.com> wrote:
>> >> You still get the same exception ?
>> >>
>> >> Le 3 juil. 07 à 12:38, William Saxton a écrit :
>> >>
>> >> > Hi Christophe,
>> >> >
>> >> > I tried that too and it didn't work either :(
>> >> >
>> >> > -Bill
>> >> >
>> >> > On 7/3/07, Christophe Alexandre <alexandre_at_magillem.com> wrote:
>> >> >> Hi Bill,
>> >> >> I guess your problem comes from the name of the property you
>> set.
>> >> >> Try :
>> >> >> > u.setProperty
>> >> >> >
>> >> >>
>> ("com.sun.xml.bind.ObjectFactory",CraeComponentFactory.getInstance
>> >> >> ());
>> >> >>
>> >> >> I guess this exception is expected because
>> >> >> "com.sun.crae.generatedcomponents.ObjectFactory" is not a valid
>> >> >> property
>> >> >> of the unmarshaller.
>> >> >>
>> >> >> Hope this helps.
>> >> >> Christophe
>> >> >>
>> >> >> Le 3 juil. 07 à 01:10, William Saxton a écrit :
>> >> >>
>> >> >> > I wonder if this is the problem. From the
>> >> AbstractUnmarshallerImpl
>> >> >> > javadoc:
>> >> >> >
>> >> >> > * Default implementation of the setProperty method always
>> >> >> > * throws PropertyException since there are no required
>> >> >> > * properties. If a provider needs to handle additional
>> >> >> > * properties, it should override this method in a derived
>> class.
>> >> >> >
>> >> >> > Could it be that there is no property to be set? If so, then
>> >> >> how is
>> >> >> > the unofficial jaxb guide pulling this off?
>> >> >> >
>> >> >> > I just made the mistake of rewriting quite a bit of my
>> project
>> >> >> to do
>> >> >> > this, only to get stuck here. Any help would be appreciated
>> >> >> before I
>> >> >> > have to restore from tape!
>> >> >> >
>> >> >> > -Bill
>> >> >> >
>> >> >> > On 7/2/07, William Saxton <saxton_at_gmail.com> wrote:
>> >> >> >> Should say 'on line: u.setProperty'.
>> >> >> >>
>> >> >> >> On 7/2/07, William Saxton <saxton_at_gmail.com> wrote:
>> >> >> >> > Well, I've been playing with this for a few days and can't
>> >> get
>> >> >> >> it to
>> >> >> >> > work. I'm getting a javax.xml.bind.PropertyException on
>> >> line:
>> >> >> >> >
>> >> >> >> > JAXBContext jc = JAXBContext.newInstance
>> >> >> >> ("com.sun.crae.generatedcomponents");
>> >> >> >> > Unmarshaller u = jc.createUnmarshaller();
>> >> >> >> > u.setProperty
>> >> >> >>
>> >> >>
>> >>
>> ("com.sun.crae.generatedcomponents.ObjectFactory",CraeComponentFactor
>> >> >> >> y.getInstance());
>> >> >> >> > return((CraeServer)u.unmarshal(reader));
>> >> >> >> >
>> >> >> >> > Exception output:
>> >> >> >> >
>> >> >> >> > javax.xml.bind.PropertyException:
>> >> >> >> > name: com.sun.crae.genereratedcomponents.ObjectFactory
>> >> >> >> > value: com.sun.crae.components.CraeComponentFactory_at_9ebcd0
>> >> >> >> > at
>> >> >> >> javax.xml.bind.helpers.AbstractUnmarshallerImpl.setProperty
>> >> >> (Unknown
>> >> >> >> > Source)
>> >> >> >> > at
>> >> >> >>
>> >> >>
>> >>
>> com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.se
>> >> >> >> tProperty(Unknown
>> >> >> >> > Source)
>> >> >> >> > at
>> >> >> >>
>> >> >>
>> >>
>> com.sun.crae.components.CraeComponentXMLConverter.readerToCraeServer(
>> >> >> >> CraeComponentXMLConverter.java:59)
>> >> >> >> > at com.sun.crae.dba.CraeServerDAO.get
>> >> >> (CraeServerDAO.java:
>> >> >> >> 77)
>> >> >> >> > at cup.Main.main(Main.java:101)
>> >> >> >> >
>> >> >> >> > Anyone actually get this working?
>> >> >> >> >
>> >> >> >> > On 6/22/07, Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_sun.com>
>> >> wrote:
>> >> >> >> > > Christophe Alexandre wrote:
>> >> >> >> > > > Hi,
>> >> >> >> > > > I'm new on the list and maybe I don't understand your
>> >> >> >> problem but
>> >> >> >> > > > isn't this:
>> >> >> >> > > > https://jaxb.dev.java.net/guide/Adding_behaviors.html
>> >> >> >> > > > an answer to your problem ?
>> >> >> >> > >
>> >> >> >> > > Yeah, I hope the users guide is useful, but if the
>> pair()
>> >> >> >> method that
>> >> >> >> > > Bill is talking about can be auto-generated, writing a
>> >> plugin
>> >> >> >> might be
>> >> >> >> > > in the end more productive.
>> >> >> >> > >
>> >> >> >> > > It depends on the size of the schema, I guess.
>> >> >> >> > >
>> >> >> >> > > --
>> >> >> >> > > Kohsuke Kawaguchi
>> >> >> >> > > Sun Microsystems
>> >> kohsuke.kawaguchi_at_sun.com
>> >> >> >> > >
>> >> >> >> > >
>> >> >> >> >
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >>
>> >>
>> ---------------------------------------------------------------------
>> >> >> > To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> >> >> > For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>> >> >> >
>> >> >>
>> >> >>
>> >>
>> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> >> >> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> >> > For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>> >> >
>> >>
>> >>
>> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> >> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>> >>
>> >>
>> >
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> > For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>