Results 1 to 2 of 2

Thread: Newbie Tapestry/Spring Problem: appContext Null

  1. #1
    Join Date
    Dec 2004
    Posts
    2

    Default Newbie Tapestry/Spring Problem: appContext Null

    I have a virtually empty applicationContext.xml and web.xml as per the betterpetshop example. In my Home page, I (try to) instantiate the appContext in a finishLoad method via
    Code:
    WebApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(cycle.getRequestContext().getServlet().getServletContext());
    if (ac == null)
    {
         throw new ApplicationRuntimeException("once again ac is null.");
    }
    I've tried doing the instantiation in a custom MyEngine as per the spring documentation. The appContext winds up null every time.

    Thanks for any help!
    Can you handle your hi?

  2. #2
    Join Date
    Dec 2004
    Posts
    2

    Default

    Solved my own problem.

    I needed to have the following in my web.xml (apparently) to load the application context correctly:

    Code:
    <context-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>/WEB-INF/applicationContext.xml</param-value>
    </context-param>
    
    <listener>
      <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    I also needed to have spring-web.jar in my /WEB-INF/lib. Beans now loading nicely.
    Can you handle your hi?

Similar Threads

  1. Replies: 2
    Last Post: Oct 17th, 2005, 08:41 PM
  2. Replies: 2
    Last Post: Oct 13th, 2005, 02:47 PM
  3. Replies: 4
    Last Post: Sep 27th, 2005, 11:31 PM
  4. Replies: 3
    Last Post: Sep 4th, 2005, 11:11 PM
  5. Strange Data Access Error
    By webifyit in forum Data
    Replies: 2
    Last Post: Dec 28th, 2004, 11:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •