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: [email protected]
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]







      
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 

Reply via email to