- This topic has 2 replies, 2 voices, and was last updated 16 years, 4 months ago by
DougMH.
-
AuthorPosts
-
DougMHMemberWhen I added Spring capabilities to a project, I selected \WEB-INF over \src in the wizard because when I added DWR capabilities, it looks for applicationContext.xml in \WEB-INF. Everything works fine until I try to run the application and invariably these kinds of statements…
beanFactory = new XmlBeanFactory(new ClassPathResource(“applicationContext.xml”));
… are looking in \src and can’t find applicationContext.xml.
My unacceptable solution was to have two (2) applicationContext.xml files, one in \WEB-INF for the DWR entries and one in over \src for everything else.
Is there some setting I can change in .classpath or other file to have…
beanFactory = new XmlBeanFactory(new ClassPathResource(“applicationContext.xml”));
… look in \WEB-INF for a single copy applicationContext.xml?
January 29, 2009 at 1:40 pm #294131
Loyal WaterMemberDouglas,
We have a DWRSpringJPAExample in examples on demand that follows the same structure. You can refer to that example.I think the change has to be made in the .springbean file.
January 29, 2009 at 8:20 pm #294154
DougMHMember@support-nipun wrote:
Douglas,
We have a DWRSpringJPAExample in examples on demand that follows the same structure. You can refer to that example.I think the change has to be made in the .springbean file.
I know you guys are busy, but I don’t think you read all my mail. Yes, when you put DWR beans in applicationContext.xml, it works fine to put it in WEB-INF. Now add Hibernate capability, designate WebRoot/WEB-INF, then try to run your application instantiating one of the hibernate beans…
beanFactory = new XmlBeanFactory(new ClassPathResource(“applicationContext.xml”));
.. and it will say it can’t find applicationContext.xml in src.
My .springBeans is pointing to WebRoot/WEB-INF.
All I can ask is that your try it with both DWR and Hibernate.
Doug
-
AuthorPosts