users@jaxb.java.net

Re: jaxb.properties and bgm.ser files in a jar

From: Brett Porter <bporter_at_f2network.com.au>
Date: Thu, 02 Jan 2003 08:28:59 +1100

you said you used:

JAXBContext jc = JAXBContext.newInstance("some.my.package",
some.my.package.WindowTemplate.class.getClassLoader());

but this shouldn't even compile. Shouldn't it be:

JAXBContext jc =
JAXBContext.newInstance("mao.snmp.screens.smlbindings.screens",
mao.snmp.screens.smlbindings.screens.WindowTemplate.class.getClassLoader());

Is WindowTemplate.class in the JAR?

Cheers,
Brett

Marek Malowidzki wrote:
> ----- Original Message -----
> Thanks for the hint, but ... I could not make it work. I have a few JAXB
> packages and thus a few jaxb.properties files. I have packed everything in a
> jar, modified the code as above in all places I am creating a new instance of
> JAXBContext. I hve the follwing exception:
>
> javax.xml.bind.JAXBException: Unable to locate jaxb.properties for package mao.s
> nmp.screens.xmlbindings.screens
> at
> javax.xml.bind.ContextFinder.searchcontextPath(ContextFinder.java:176)
> at javax.xml.bind.ContextFinder.find(ContextFinder.java:126)
> at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:274)
> at mao.snmp.screens.Screen.readTemplate(Screen.java:2054)
> at mao.snmp.screens.Screen.main(Screen.java:2163)
>
> Where 2054 line in Screen.java is the following:
>
> JAXBContext jc = JAXBContext.newInstance("some.my.package",
> some.my.package.WindowTemplate.class.getClassLoader());
>
>
> So, is there any workaroud or should I wait for a new version?
>
> Marek