Re: cayenne wicket unit test => Current thread has no bound ObjectContext

From: Michael Gentry (mgentr..asslight.net)
Date: Thu Apr 22 2010 - 10:13:40 EDT

  • Next message: Joe Baldwin: "Re: cayenne wicket unit test => Current thread has no bound ObjectContext"

    Did you configure your web.xml file to use the Cayenne web filter? In
    my application (which is Tapestry, but should apply to Wicket, I
    think) I have:

        <filter>
            <filter-name>Cayenne Filter</filter-name>
            <filter-class>org.apache.cayenne.conf.WebApplicationContextFilter</filter-class>
        </filter>
        <filter-mapping>
            <filter-name>Cayenne Filter</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>

    mrg

    On Thu, Apr 22, 2010 at 10:00 AM, Arnaud Garcia <arnau..magemed-87.com> wrote:
    > Hello,
    >
    > I am working on a Wicket Cayenne application and when I launch the tests I
    > have an error when the DataContext is initialized:
    >
    > This line, DataContext ctxt = (DataContext)
    > DataContext.getThreadObjectContext();  throws an
    >
    > java.lang.IllegalStateException: Current thread has no bound ObjectContext
    >
    >
    > Well, any ideas to set up correctly the tests ?
    >
    > thanks
    >
    >
    > Arnaud
    >



    This archive was generated by hypermail 2.0.0 : Thu Apr 22 2010 - 10:14:30 EDT