well i hope it will change but right now that's pretty easy: no standard,
efficient and portable way to declare resources (even @DataSourceDefinition)

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/3/12 James Green <[email protected]>

> Why wouldn't I think it was in the standard?
>
> If I download an application server and begin playing with Java EE, and I
> get told to specify resources in resources.xml, where do I go to learn how
> to declare my resources? The application server docs? The Java EE specs?
> I'm having a go at anyone in particular, I'm merely encouraging clarity to
> those who are not yet familiar and don't want to waste time researching
> stuff.
>
> If I download an application server from TomEE and get told to declare XXX
> in tomee-xxx.xml, I know I am looking for TomEE docs and that it'll be
> exclusively for it's use. I'll say no more!
>
>
>
> On 12 March 2013 11:00, Romain Manni-Bucau <[email protected]> wrote:
>
> > i hate adding a hook for compatibility. I do it only when i need +
> > resources.xml sounds good for me :p.
> >
> > well i don't know why you thought resources.xml was standard but changing
> > this name is clearly something i wouldn't do in eager mode (then you'll
> say
> > we have too much conf files).
> >
> > just my opinion...
> >
> > *Romain Manni-Bucau*
> > *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> > *Blog: **http://rmannibucau.wordpress.com/*<
> > http://rmannibucau.wordpress.com/>
> > *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> > *Github: https://github.com/rmannibucau*
> >
> >
> >
> > 2013/3/12 James Green <[email protected]>
> >
> > > Location: fine, it'll "just work" as expected :)
> > >
> > > Names: Never too late. If tomee-resources.xml cannot be found, check
> for
> > > resources.xml that contains the right content - if it doesn't it isn't
> > for
> > > TomEE's consumption and it's to be ignored. Right now resources.xml
> > sounds
> > > like the type of thing I need to Google for in relation to Java EE 6,
> > and I
> > > won't find much.
> > >
> > > I'm never in favour of ambiguous names. Just like you wouldn't add
> TomEE
> > > extensions to java. packages.
> > >
> > >
> > >
> > > On 12 March 2013 08:26, Romain Manni-Bucau <[email protected]>
> > wrote:
> > >
> > > > about the location: the specs (globally) speak about META-INF for
> jars
> > > > and WEB-INF for wars...we did the same for resources.xml
> > > >
> > > > about the name i guess it is too late to change and i don't think it
> > > > could create any collision (maybe i'm wrong on it) but the point is
> ok
> > > > you call it tomee-xxx.xml...but the exact same file  works with
> > > > OpenEJB too...
> > > >
> > > > 2013/3/12, James Green <[email protected]>:
> > > > > Is resources.xml specific to TomEE? If so, shouldn't it be called
> > > > > tomee-resources.xml to prevent possible future collisions in
> naming?
> > > > >
> > > > > And presumably it will be picked up in META-INF in standard jar
> > > archives?
> > > > >
> > > > >
> > > > >
> > > > > On 12 March 2013 06:23, Romain Manni-Bucau <[email protected]>
> > > > wrote:
> > > > >
> > > > >> Hi,
> > > > >>
> > > > >> it should be in WEB-INF. The fact it was being picked in META-INF
> > was
> > > > >> a bug/side effect.
> > > > >>
> > > > >> BTW i added it as a feature since it was working before:
> > > > >> https://issues.apache.org/jira/browse/TOMEE-790
> > > > >>
> > > > >> 2013/3/12, zeeman <[email protected]>:
> > > > >> > I was on Tomee 1.5.1 and upgraded to latest snapshot by removing
> > > 1.5.1
> > > > >> lib
> > > > >> > folder, then copying 1.6 snapshot lib.
> > > > >> >
> > > > >> > My DS was getting picked up fine from
> > > > >> > /sportivity/src/main/resources/META-INF/resources.xml in 1.5
> > > > >> >
> > > > >> > Here is how I have it defined.
> > > > >> >
> > > > >> >       <Resource id="sportivityDS" type="javax.sql.DataSource">
> > > > >> >               DataSourceCreator tomcat
> > > > >> >               JdbcDriver org.postgresql.Driver
> > > > >> >               JdbcUrl jdbc:postgresql://
> 127.0.0.1:5432/sportivity
> > > > >> >               UserName u
> > > > >> >               Password psw
> > > > >> >               JtaManaged true
> > > > >> >               MaxActive 100
> > > > >> >               InitialSize 2
> > > > >> >               MaxIdle 25
> > > > >> >               MinIdle 2
> > > > >> >               suspectTimeout 60
> > > > >> >               maxWait 10000
> > > > >> >               TimeBetweenEvictionRunsMillis 60000
> > > > >> >               minEvictableIdleTimeMillis 60000
> > > > >> >               testOnBorrow true
> > > > >> >               validationInterval 30000
> > > > >> >               removeAbandoned true
> > > > >> >               removeAbandonedTimeout 60
> > > > >> >               logAbandoned true
> > > > >> >               ValidationQuery SELECT 1
> > > > >> >               jmxEnabled false
> > > > >> >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> jdbcInterceptors=ConnectionState;StatementFinalizer;StatementCache(prepared=true,callable=false,max=200);SlowQueryReportJmx(threshold=2000,maxQueries=1000,notifyPool=false);
> > > > >> >       </Resource>
> > > > >> >
> > > > >> > My persistence.xml uses above resources:
> > > > >> >
> > > > >> > <persistence-unit name="sportivity-PU" transaction-type="JTA">
> > > > >> >
> > > > >> > <provider>org.hibernate.ejb.HibernatePersistence</provider>
> > > > >> >               <jta-data-source>sportivityDS</jta-data-source>
> > > > >> >
> > > > >> <exclude-unlisted-classes>false</exclude-unlisted-classes>
> > > > >> >
> > > > >> >
> > > > >> >       </persistence-unit>
> > > > >> > </persistence>
> > > > >> >
> > > > >> > What got changed? The DS that got picked by tomee was the
> default
> > > Hsql
> > > > >> one
> > > > >> > not PG one.
> > > > >> >
> > > > >> >
> > > > >> >
> > > > >> > --
> > > > >> > View this message in context:
> > > > >> >
> > > > >>
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/1-6-snapshot-Tomee-does-not-use-resources-xml-tp4661416.html
> > > > >> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > > > >> >
> > > > >>
> > > > >>
> > > > >> --
> > > > >> *Romain Manni-Bucau*
> > > > >> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> > > > >> *Blog: **http://rmannibucau.wordpress.com/*<
> > > > >> http://rmannibucau.wordpress.com/>
> > > > >> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> > > > >> *Github: https://github.com/rmannibucau*
> > > > >>
> > > > >
> > > >
> > > >
> > > > --
> > > > *Romain Manni-Bucau*
> > > > *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> > > > *Blog: **http://rmannibucau.wordpress.com/*<
> > > > http://rmannibucau.wordpress.com/>
> > > > *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> > > > *Github: https://github.com/rmannibucau*
> > > >
> > >
> >
>

Reply via email to