Re: Configuring JettyPlus JNDI for Cayenne

From: Mike Kienenberger (mkienen..mail.com)
Date: Thu Aug 23 2007 - 14:49:25 EDT

  • Next message: Clark_Shanno..mc.com: "Pointers for JPA integration tutorial"

    Yes, I was considering whether I should look at commons dbcp and see
    what was there. Thanks!

    On 8/23/07, Andrus Adamchik <andru..bjectstyle.org> wrote:
    > BTW, for the XXX.XXX you may try
    > org.apache.commons.dbcp.BasicDataSource. It is a fairly simple to use
    > bean-property-based DataSource:
    >
    > http://commons.apache.org/dbcp/api-1.2.2/org/apache/commons/dbcp/
    > BasicDataSource.html
    >
    > (I wish we used it for our own DBCP DS wrapper that is insanely
    > complex now, using raw DBCP API).
    >
    > Andrus
    >
    > On Aug 23, 2007, at 9:39 PM, Mike Kienenberger wrote:
    >
    > > Yes, I've used the modeler jndi for some of my projects and that works
    > > reasonably well if it's just for me.
    > >
    > > However, I've got some web page designers trying to run web apps on
    > > eclipse using jndi, and I was hoping for something that could be
    > > configured to run out of the box for them just by checking out the
    > > app-server-ready cvs code and pointing to that config file in the
    > > jettylauncher setttings.
    > >
    > > Having them go in and manually set the data sources from the modeler
    > > is asking too much.
    > > For Tomcat, it was simply a matter of defining the data source in the
    > > config file, but jetty-plus seems to be making everything much more
    > > complicated in the name of "flexibility", so much so that nothing
    > > seems to work out of the box.
    > >
    > > On 8/23/07, Andrus Adamchik <andru..bjectstyle.org> wrote:
    > >> I use CayenneModeler JNDI hack for local work with JettyLauncher.
    > >>
    > >> In production I use Jetty 6 that has a bit different configuration
    > >> (and of course Jetty 6 is not compatible with JettyLauncher). Just in
    > >> case here is an example of Jetty 6 (also requires Cayenne 3.0... so I
    > >> guess that's not helpful at all):
    > >>
    > >> <New class="com.nhl.jetty.DBCPDataSourceFactory">
    > >> <Call name="getDataSource" id="DataSource">
    > >> <Arg><SystemProperty name="jetty.home"
    > >> default="." />etc/
    > >> dbcp.properties</Arg>
    > >> </Call>
    > >> </New>
    > >>
    > >> <New id="JNDIDataSource"
    > >> class="org.mortbay.jetty.plus.naming.Resource">
    > >> <Arg>jdbc/myDS</Arg>
    > >> <Arg>
    > >> <Ref id="DataSource"/>
    > >> </Arg>
    > >> </New>
    > >>
    > >>
    > >> Andrus
    > >>
    > >>
    > >>
    > >>
    > >> On Aug 23, 2007, at 9:21 PM, Mike Kienenberger wrote:
    > >>
    > >>> Has anyone successfully configured jetty to use a jndi connection
    > >>> with Cayenne?
    > >>>
    > >>> Specifically, I'm trying to create a config file for
    > >>> jettylauncher in
    > >>> eclipse for Jetty 5.1.x
    > >>>
    > >>> My apparent problem is that I can't figure out what goes in the
    > >>> place
    > >>> of XXX.XXXX.XXXXX
    > >>>
    > >>>
    > >>> <Call name="addService">
    > >>> <Arg>
    > >>> <New class="org.mortbay.jetty.plus.JotmService">
    > >>> <Call name="addDataSource">
    > >>> <Arg>jdbc/CachedDS</Arg>
    > >>> <Arg>
    > >>> <New class="XXX.XXXX.XXXXX">
    > >>> <Set
    > >>> name="DriverName">oracle.jdbc.driver.OracleDriver</Set>
    > >>> <Set name="Url">jdbc:oracle:thin..bc.xyz.com:
    > >>> 1521:abc</Set>
    > >>> <Set name="User">user</Set>
    > >>> <Set name="Password">password</Set>
    > >>>
    > >>
    > >>
    > >
    >
    >



    This archive was generated by hypermail 2.0.0 : Thu Aug 23 2007 - 14:50:02 EDT