|
From: Mark R. D. <mdi...@la...> - 2003-06-11 18:13:05
|
I've identified the following Classes that are the only ones dependent on Xerces (by removing Xerces from my build path). ChartArchiver.java repast/src/uchicago/src/sim/analysis line 76 CompUnitParser.java repast/src/uchicago/src/codegen line 12 FrameFactory.java repast/src/uchicago/src/sim/gui line 120 XMLParameterReader.java repast/src/uchicago/src/sim/parameter line 21 I went throught these files and adjusted the code to use JAXP. This is untested. Your current copy of xerces.jar has the JAXP dom and sax parsers api's present in it, so it should still be safe on pre 1.3. -Mark Mark R. Diggory wrote: > Well, the good news is that using JAXP "frees up" the determination of > which XML parser to the point that you could easily package a pre 1.4 > "Mac"able version of your packages that has the JAXP and your favorite > parser included and a "post 1.4" version that finds the JAXP in the > J2sdk. > > -M. > > Nick Collier wrote: > >> I agree. The reason we were using Xerces is for pre 1.4. support for the >> Mac. However, I think Tom and I have decided to standardize on 1.4 >> >> Nick >> >> On Wed, 2003-06-11 at 09:55, thowe wrote: >> >> >>> I agree, I like abstracting the parser implementation out like this. I >>> also like not having to include the xerces jar file. If there is >>> anyone >>> who is interested in working on this, that would be great. I'll do it, >>> if not, but I'm not sure when I can get to it. >>> >>> Thanks, >>> Tom >>> >>> On Wed, 2003-06-11 at 08:49, Mark R. Diggory wrote: >>> >>> >>>> We keep encountering the following problem with RePast and trying >>>> to use Charts, I've been using a newer version of Xerces, I don't >>>> know if this is to blame. There appear to be issues with Xerces DTD >>>> validation feature attempting to resolve external ftp url's for >>>> some reason. >>>> >>>> I personally would recommend using the JAXP interface over Xerces >>>> directly, the default configuration and validation behavior is more >>>> predictable through the JAXP interface with something like: >>>> >>>> DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); >>>> DocumentBuilder docBuilder = factory.newDocumentBuilder(); >>>> Document doc = docBuilder.parse(new File(file)); >>>> >>>> this frees you from the particular Xerces Implementation too. You >>>> can rely on the default parser implmentation included with the >>>> latest J2SDK (which I believe is actually Xerces right now) and not >>>> have to provide a copy of Xerces directly within your distribution. >>>> >>>> -Mark >>>> >>>> The exception: >>>> [java] Error loading persistent chart sizes and positions >>>> [java] java.net.UnknownHostException: C >>>> [java] at >>>> java.net.InetAddress.getAllByName0(InetAddress.java:571) >>>> [java] at >>>> java.net.InetAddress.getAllByName0(InetAddress.java:540) >>>> [java] at >>>> java.net.InetAddress.getByName(InetAddress.java:449) >>>> [java] at java.net.Socket.<init>(Socket.java:100) >>>> [java] at >>>> sun.net.NetworkClient.doConnect(NetworkClient.java:50) >>>> [java] at >>>> sun.net.NetworkClient.openServer(NetworkClient.java:38) >>>> [java] at >>>> sun.net.ftp.FtpClient.openServer(FtpClient.java:267) >>>> [java] at sun.net.ftp.FtpClient.<init>(FtpClient.java:381) >>>> [java] at >>>> sun.net.www.protocol.ftp.FtpURLConnection.connect >>>> (FtpURLConnection.java:77) >>>> [java] at >>>> sun.net.www.protocol.ftp.FtpURLConnection.getInputStream >>>> (FtpURLConnection.java:96) >>>> [java] at java.net.URL.openStream(URL.java:798) >>>> [java] at >>>> org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown >>>> Source) >>>> [java] at >>>> org.apache.xerces.impl.XMLEntityManager.startDocumentEntity >>>> (Unknown Source) >>>> [java] at >>>> org.apache.xerces.impl.XMLDocumentScannerImpl.setInputSource >>>> (Unknown Source) >>>> [java] at >>>> org.apache.xerces.parsers.DTDConfiguration.parse(Unknown >>>> Source) >>>> [java] at >>>> org.apache.xerces.parsers.DTDConfiguration.parse(Unknown >>>> Source) >>>> [java] at >>>> org.apache.xerces.parsers.XMLParser.parse(Unknown Source) >>>> [java] at >>>> org.apache.xerces.parsers.DOMParser.parse(Unknown Source) >>>> [java] at uchicago.src.sim.analysis.ChartArchiver.loadXML >>>> (ChartArchiver.java:77) >>>> [java] at >>>> uchicago.src.sim.analysis.ChartArchiver.loadCharts >>>> (ChartArchiver.java:67) >>>> [java] at >>>> uchicago.src.sim.engine.AbstractGUIController.setModel >>>> (AbstractGUIController.java:165) >>>> [java] at uchicago.src.sim.engine.Controller.setModel >>>> (Controller.java:146) >>> |