Another option would be to use an EntityResolver within your application and repoint the XML parser to use a DTD stored within your EAR.
Werner > -----Original Message----- > From: Keith Visco [mailto:[EMAIL PROTECTED] > Sent: Mittwoch, 12. Oktober 2005 06:33 > To: [email protected] > Subject: Re: [castor-user] problem loading mapping > > > Seamus, > > Remove this line in your mapping file: > > <!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Object Mapping DTD Version > 1.0//EN" "http://Castor.exolab.org/mapping.dtd"> > > > Or change the "http://castor.exolab.org/mapping.dtd" to a dtd > stored locally on your server. > > The XML parser (most likely Xerces) is trying to fetch the > DTD from exolab.org. There are two things wrong with that, > the first is that exolab.org no longer exists, and the second > is that you definately don't want you application depending > on external servers. > > --Keith > > Seamus Malone wrote: > > I'm doing this inside of JBoss... > > I've read others having a similar problem... but it seemed > to have to > > do with the classLoader needing to be defined. I've done > that and made > > sure I'm able to read the file with the resouceLoader etc. > > > > In my case the url definitely resolves to a file (the commented out > > section successfully prints out the file). I keep getting this > > error... connection timed out. > > If the file is able to be read why > > would the connection 'time out'? is this timing out on reading the > > mapping file or the .class? > > > > find below: stack trace, java source, mapping.xml > > > > thanks. > > sm > > > > > > 17:55:22,203 INFO [STDOUT] mapping exception > > 17:55:22,203 INFO [STDOUT] Connection timed out: connect > > 17:55:22,203 INFO [STDOUT] at > > org.exolab.castor.xml.Unmarshaller.unmarshal( > > Unmarshaller.java:666) > > 17:55:22,203 INFO [STDOUT] at > > org.exolab.castor.mapping.Mapping.loadMapping > > Internal(Mapping.java:535) > > 17:55:22,203 INFO [STDOUT] at > > org.exolab.castor.mapping.Mapping.loadMapping > > (Mapping.java:456) > > > > InputStream is = > > getClass().getResourceAsStream("/WEB-INF/layout-mapping.xml"); > > InputSource isx = new InputSource(is); > > /* > > // read out immediate response > > BufferedReader br = new BufferedReader(new > InputStreamReader(is)); > > System.out.println("\n\n>>>>>>>>>>>> layout-mapping.xml > > >>>>>>>>>>>>>>>>>>>>"); > > String response = null; > > try { > > while((response = br.readLine()) != null) { > > System.out.println(response); > > } > > } catch (IOException e3) { > > // TODO Auto-generated catch block > > e3.printStackTrace(); > > } > > System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\n"); > > */ > > > > Mapping mapping = new Mapping(getClass().getClassLoader()); > > try { > > mapping.loadMapping(isx); > > } catch (RuntimeException e1) { > > System.out.println("runtime exception"); > > e1.printStackTrace(); > > } catch (IOException e2) { > > System.out.println("io exception"); > > e2.printStackTrace(); > > } catch (MappingException e) { > > System.out.println("mapping exception"); > > e.printStackTrace(); > > } > > > > I've reduced the mapping file to this and tried both full class path > > (com.linkify.ejb.session.item_manager.Layout) and just > Layout as the > > name... > > > > <?xml version="1.0"?> > > <!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Object Mapping > DTD Version > > 1.0//EN" "http://Castor.exolab.org/mapping.dtd"> > > > > <mapping> > > <description>item layout</description> <class > > name="com.linkify.ejb.session.item_manager.Layout"> > > <field name="name" type="string" /> > > <field name="buttons" type="string" /> </class> </mapping> > > > > > > > > ------------------------------------------------- > > If you wish to unsubscribe from this list, please send an > empty message > > to the following address: > > > > [EMAIL PROTECTED] > > ------------------------------------------------- > > > > > > > ------------------------------------------------- > If you wish to unsubscribe from this list, please > send an empty message to the following address: > > [EMAIL PROTECTED] > ------------------------------------------------- > > > ------------------------------------------------- If you wish to unsubscribe from this list, please send an empty message to the following address: [EMAIL PROTECTED] -------------------------------------------------

