Re: Configuration question - please help

From: Craig Miskell (cmiskel..lbatross.co.nz)
Date: Tue Jan 14 2003 - 19:47:27 EST

  • Next message: Craig Miskell: "RE: 1:n deletion problem"

    OK, what application are you referering to (is it one of the
    tutorials?). If so, or if you are storing a DataContext in your
    HttpSession, then it might be as follows:
    Tomcat deserializes sessions that were serialised to disk at the last
    shutdown (it does this so that sessions can survive a restart of the
    container, very useful during dev work). However, it does this *before*
    initializing the servlet (dubious IMHO, but no doubt there's good
    reason). So, if you're using BasicServletConfiguration (as seems likely
    given that you have cayenne.xml in your WEB-INF directory) and setting
    that up in the servlet init, then this is likely the problem. New
    sessions created after startup will cause the configuration to be
    properly read, and all will be well.

    This has been worked around recently (committed to cvs last night - the
    datamap loading is delayed a bit so that it's likely the Serlvet has
    been inited). In the meantime, it doesn't actually hurt at all, unless
    you *really* want to access a session that was around at the last
    shutdown of tomcat.

    Craig Miskell

    On Wed, 2003-01-15 at 13:37, Justin Peck wrote:
    > Hello. I have downloaded Cayenne and really like what I see so far. Here's
    > a small configuration problem I've been having that I hope you could help me
    > with.
    >
    > 1. I am using Tomcat 4.1.12 and have a JNDI <ResoureParams> xml snippet to
    > register "jdbc/mysql" to org.objectstyle.cayenne.conn.ContainerPoolFactory
    > under my application's context (in server.xml).
    >
    > 2. I am using <listener> and <resource-ref> tags in my war's web.xml file to
    > reference "jdbc/mysql" and this seems to work fine.
    >
    > 3. My cayenne.xml, and referenced Map.xml file, are both in the web-inf
    > folder inside my war file.
    >
    > The problems is, upon starting up Tomcat, half of the time I get a
    > Configuration error that says "Error initializing shared configuration:
    > Domain configuration file 'cayenne.xml' is not found."
    >
    > It seems like because I am using a JNDI resource in server.xml, the
    > ContainerPoolFactory is attempting to location my cayenne.xml file -
    > however, this file is in my war file and not anywhere under Tomcat. Does
    > this sound reasonable? Could you please point me to a better configuration?
    >
    > I'd like to still use JNDI for your connection pooling in server.xml, and
    > include cayenne.xml in my war file if that is possible.
    >
    > Thanks,
    >
    > Justin Peck
    > jpec..earningoptics.com
    >



    This archive was generated by hypermail 2.0.0 : Tue Jan 14 2003 - 19:44:22 EST