From: Gavin_King/Cirrus%<CI...@ci...> - 2002-07-13 07:17:56
|
>If this code runs as standalone application all execute without errors. >But when this code runs inside my web application (Tapestry framework >2.1 under Jetty 4.0.1 web server) throws exception in last string > >java.lang.ClassCastException avp.forum.biz.Forum > >The type of object witch returned by iterator is avp.forum.biz.Forum. >This is means that object not want to cast to his real type. >I think that is because of different ClassLoaders. >Can anybody help me? How to avoid this error? Don't know anything about classloaders in Jetty, so can't help you on this one ... I'll leave that for others.... might even be better to ask on a Jetty mailing list. >And another problem. > ><!DOCTYPE hibernate-mapping SYSTEM >"http://hibernate.sourceforge.net/hibernate-mapping.dtd"> >When I use DOCTYPE string in my *.hbm.xml file throws exception. If you wish to use a SYSTEM id, rather than a PUBLIC id, you should provide the absolute path to the mapping dtd, ie. "C:/hibernate-1.0/src/cirrus/hibernate/hibernate-mapping.dtd" but this is not recommended. Try using the PUBLIC id recommended in the documentation: <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping.dtd"> This will NOT actually hit the given URL. Instead it will load the mapping DTD from the classpath. Hope that helps. Peace. Gavin P.S. please post these kind of questions to the forum, rather than the devel list, so other users will be able to find the answers..... TIA. |