facebook

Spring Framework and applicationContext.xml

  1. MyEclipse Archived
  2.  > 
  3. Web Development (HTML, CSS, etc.)
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #294071 Reply

    DougMH
    Member

    When 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?

    #294131 Reply

    Loyal Water
    Member

    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.

    #294154 Reply

    DougMH
    Member

    @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

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Spring Framework and applicationContext.xml

You must be logged in to post in the forum log in