From: <rom...@as...> - 2004-09-22 09:13:23
|
Hi, i have problem with configuration via xml file in servlet environment. My application uses Proxool in Hibernate which is configurated in the Springframework. <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">net.sf.hibernate.dialect.SQLServerDialect</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.proxool.xml">proxool.xml</prop> <prop key="hibernate.proxool.pool_alias">issp</prop> </props> </property> Proxool configuration is stored in proxool.xml, but this doesn't work. JAXPConfigurator cannot find proxool.xml. When i tried to change path to ./WEB-INF/proxool.xml, /WEB-INF/proxool.xml, /WEB-INF/classes/proxool.xml, the result was the same. I think that JAXPConfigurator should test if xml file exists and if not then try look into the classpath. Little improvement of method configure made JAXPConfigurator working and helped me. See below the patched method. public static void configure(String xmlFileName, boolean validate) throws ProxoolException { try { if (LOG.isDebugEnabled()) { LOG.debug("Configuring from xml file: " + xmlFileName); } File xmlFile = new File(xmlFileName); )){ configure(new InputSource(new FileReader(xmlFileName)), validate); }else{ //try look up to classpath InputStream s = JAXPConfigurator.class.getClassLoader().getResourceAsStream(xmlFileName); if(s == null){ throw new FileNotFoundException(xmlFileName); } configure(new InputSource(s), validate); } } catch (FileNotFoundException e) { throw new ProxoolException(e); } } Regards, Roman "Dagi" Pichlik |