Thanks for the link Ty.
This is a pretty similar issue (duplicate types) compounded by the
fact that neither of the schemas has a namespace. Its important to
note that use of an xsdconfig will help rename the packages and other
instances in Java source, but it will not manipulate the contents of
the .xsb files (keepers of the schema infoset) and thats why kind of
error is occuring.
It might be easier to see if you try to scomp both schemas at the same
time (scomp metar1_2.xsd taf1_2.xsd). You'll get a lot of duplicate
type found errors.

There is a tool for this in the bin directory of xmlbeans depot called
sfactor that will create a new xsd containing any of the duplicates
elements.
Once sfactor creates this xsd (or you create it by hand), compile it
with scomp, then add the jar it to your classpath when compiling these
other schemas. Xmlbeans tries to look on the classpath when compiling
for types that already exist and use those if they match. This can
help reduce the classpath conflict issue you are seeing.

hope this helps,
-jacobd

On Dec 10, 2007 3:28 PM, worms <[EMAIL PROTECTED]> wrote:
> Hello Ty,
>
> Thanks for the reply, I'll take a look at that link.
>
> --Lance
>
>
> On Dec 10, 2007 5:19 PM, tyju tiui <[EMAIL PROTECTED]> wrote:
> >
> > Hi Lance,
> >
> > Check this out: http://www.nabble.com/Re-3A-package-to14256496.html
> > I'd elaborate, but I basically got my hand slapped by the real dev earlier
> > today for trying to help someone who had a similar problem so I'll leave it
> > to them.
> >
> > By the way, I recently had this exact same issue ... I think it must be very
> > common among us lowly xmlbeans users.
> >
> > Good Luck,
> >
> > Ty
> >
> >
> >
> > ----- Original Message ----
> > From: worms <[EMAIL PROTECTED]>
> > To: user@xmlbeans.apache.org
> > Sent: Monday, December 10, 2007 6:09:46 PM
> > Subject: Problems with same class names in different packages.
> >
> >  Hello,
> >
> > I am trying to pull back Aviation weather information from:
> > http://weather.aero
> >
> > There are two types of data I am trying to get back; METARs and TAFs.
> >
> > http://weather.aero/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&stationString=KSLC,KHDC,KRSN,KMSY&mostRecentForEachStation=true&hoursBeforeNow=4
> > http://weather.aero/dataserver_current/httpparam?dataSource=tafs&requestType=retrieve&format=xml&stationString=KSLC,KHDC,KRSN,KMSY&mostRecentForEachStation=true&hoursBeforeNow=4
> >
> > So I used XML beans to generate some jars from the following XSDs:
> > http://weather.aero/schema/metar1_2.xsd
> > http://weather.aero/schema/taf1_2.xsd
> >
> > with the following config:
> > <xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config";>
> >  <xb:namespace uri="##any">
> >     <xb:package>aero.weather.schema.taf</xb:package>
> >  </xb:namespace>
> > </xb:config>
> >
> > However, when i call
> >
> > aero.weather.schema.metar.ResponseDocument xmlResponse =
> > aero.weather.schema.metar.ResponseDocument.Factory.parse(metarXmlUrl);
> > aero.weather.schema.taf.ResponseDocument xmlResponse =
> > aero.weather.schema.taf.ResponseDocument.Factory.parse(tafXmlUrl);
> >
> > whichever one is call second will error out with:
> >
> > Exception in thread "main" java.lang.ClassCastException:
> > aero.weather.schema.metar.impl.ResponseDocumentImpl
> >     at aero.weather.schema.taf.ResponseDocument$Factory.parse(Unknown
> > Source)
> >     at htmltorss.TafRetriever.getTAFs(TafRetriever.java:29)
> >     at htmltorss.TafFeedGenerator.getRssFeed(TafFeedGenerator.java:85)
> >     at htmltorss.Main.main(Main.java:31)
> >
> > It looks like there is some sort of problem with ResponseDocumentImpl
> > existing in two different packages and it uses whichever one is called
> > first all subsequent calls to prase.
> >
> > Any help would be appreciated.
> > I am just getting into Java programming so I hope that I'm doing
> > something that is fairly obviously wrong.
> >
> > Thanks,
> > Lance
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >  ________________________________
> > Looking for last minute shopping deals? Find them fast with Yahoo! Search.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to