Re: JNDI datasource for standalone application?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Jul 23 2004 - 18:11:10 EDT

  • Next message: Mike Kienenberger: "Re: JNDI datasource for standalone application?"

    Mike,

    In the past I saw a few open source frameworks for standalone
    embeddable JNDI object bindings. Don't remember the project name
    though. Try googling it, you may find more than one such framework out
    there.

    Still none of them are likely to help you with reusing existing OAS
    JNDI configuration. I would imagine every such framework will have its
    own configuration requirements. So using "cdeploy" doesn't sound more
    complex than any such embedded JNDI framework.

    Andrus

    On Jul 23, 2004, at 2:47 PM, Mike Kienenberger wrote:
    > This isn't quite a cayenne question, but I don't know a better place
    > to ask
    > it.
    >
    > I'm using Cayenne with Oracle Application Server and have defined a
    > JNDI
    > datasource in OAS for Cayenne to use.
    >
    > However, I also have some batch processes that run out of the web
    > application directory as standalone applications.
    >
    > Obviously, running them gives me a JNDI lookup error (which is what I'd
    > expect).
    >
    > Cayenne DEBUG [main 07-23 14:29:41] QueryLogger: Connecting. JNDI path:
    > jdbc/CachedDS
    > Cayenne DEBUG [main 07-23 14:29:42] QueryLogger: *** Connecting:
    > FAILURE.
    > javax.naming.NoInitialContextException: Need to specify class name in
    > environment or system property, or as an applet parameter, or in an
    > application resource file: java.naming.factory.initial
    > at
    > javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:
    > 640)
    > at
    > javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
    > at
    > javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:
    > 280)
    > at javax.naming.InitialContext.lookup(InitialContext.java:347)
    > at
    > org.objectstyle.cayenne.conf.JNDIDataSourceFactory.getDataSource(JNDIDa
    > taSourceFactory.java:104)
    >
    >
    > I'm already using FileConfiguration to set up Cayenne in my standalone
    > application, and I suppose I could specify an alternate JDBC
    > DataSource in
    > an alternate Cayenne.xml file, but what I'd really like to do is
    > define some
    > JNDI datasources external to my standalone application just like
    > they're
    > defined externally to the web application. Ideally, they'd share the
    > same
    > definitions with Oracle Application Server, but I suspect that's
    > probably
    > asking too much.
    >
    > So...
    >
    > Is there any way to do this? Or is the cdeploy ant task the only
    > choice?
    >
    > Another possibility I'm considering is writing a flat-file
    > DataSourceFactory
    > that parses Oracle's xml data files to read the JNDI datasource setup
    > info.
    >
    > -Mike
    >



    This archive was generated by hypermail 2.0.0 : Fri Jul 23 2004 - 18:11:15 EDT