|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
How to configure data source for Jetty server?Hi all,
When I've started learning Wicket, I followed configuration described in the book Enjoy web dev ... Now I'm trying to migrate my project under Maven's management. I seem to be almost finished except data source configuration in the Tomcat's context file: <Resource name="jdbc/trackerDataSource" auth="Container" type="javax.sql.DataSource" driverClassName="org.postgresql.Driver" url="jdbc:postgresql://localhost/tracker" username="xxx" password="xxx" maxActive="20" maxIdle="8" defaultAutoCommit="false" defaultTransactionIsolation="SERIALIZABLE" testOnBorrow="true" validationQuery="select 1"/> Please, could somebody show me how to achieve the same effect in Jetty's configuration? Thanks, Peter --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: How to configure data source for Jetty server?http://docs.codehaus.org/display/JETTY/JNDI
-igor On Mon, Jul 6, 2009 at 1:22 PM, Petr Fejfar<petr.fejfar@...> wrote: > Hi all, > > When I've started learning Wicket, I followed configuration described > in the book Enjoy web dev ... > > Now I'm trying to migrate my project under Maven's management. I seem > to be almost > finished except data source configuration in the Tomcat's context file: > > <Resource > name="jdbc/trackerDataSource" > auth="Container" > type="javax.sql.DataSource" > driverClassName="org.postgresql.Driver" > url="jdbc:postgresql://localhost/tracker" > username="xxx" > password="xxx" > maxActive="20" > maxIdle="8" > defaultAutoCommit="false" > defaultTransactionIsolation="SERIALIZABLE" > testOnBorrow="true" > validationQuery="select 1"/> > > Please, could somebody show me how to achieve > the same effect in Jetty's configuration? > > > Thanks, Peter > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@... > For additional commands, e-mail: users-help@... > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: How to configure data source for Jetty server?On Tue, Jul 7, 2009 at 2:08 AM, Igor Vaynberg <igor.vaynberg@...>wrote:
> http://docs.codehaus.org/display/JETTY/JNDI > > -igor > > On Mon, Jul 6, 2009 at 1:22 PM, Petr Fejfar<petr.fejfar@...> wrote: > > Hi all, > > > > When I've started learning Wicket, I followed configuration described > > in the book Enjoy web dev ... > > > > Now I'm trying to migrate my project under Maven's management. I seem > > to be almost > > finished except data source configuration in the Tomcat's context file: > > > > <Resource > > name="jdbc/trackerDataSource" > > auth="Container" > > type="javax.sql.DataSource" > > driverClassName="org.postgresql.Driver" > > url="jdbc:postgresql://localhost/tracker" > > username="xxx" > > password="xxx" > > maxActive="20" > > maxIdle="8" > > defaultAutoCommit="false" > > defaultTransactionIsolation="SERIALIZABLE" > > testOnBorrow="true" > > validationQuery="select 1"/> > > > > Please, could somebody show me how to achieve > > the same effect in Jetty's configuration? > > > A couple of tips to do the Jetty DataSource JNDI configuration the 'wicket way' - in code, instead of xml. Use a datasource implementation like org.apache.commons.dbcp.BasicDataSource In the Start.java that you get after following the instructions here: http://wicket.apache.org/quickstart.html Add the following: BasicDataSource ds = new BasicDataSource(); ds.setUrl("jdbc:hsqldb:."); ds.setDriverClassName("org.hsqldb.jdbcDriver"); ds.setUsername("sa"); ds.setPassword(""); NamingEntry.setScope(NamingEntry.SCOPE_GLOBAL); // this line actually registers object in jetty jndi new Resource("java:/mydatasource", ds); And you can refer the documentation of Apache DPCP to set properties like this: ds.setValidationQuery("SELECT 1"); Thanks, Peter. > > > > > Thanks, Peter > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscribe@... > > For additional commands, e-mail: users-help@... > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@... > For additional commands, e-mail: users-help@... > > |
|
|
Re: How to configure data source for Jetty server?> A couple of tips to do the Jetty DataSource JNDI configuration the 'wicket
> way' - in code, instead of xml. Hi Peter, thanks for your help. I like your solution without those .xml files everywere around... I completed dependencies into my POM and some additional BasicDataSource() settings into code and it works. Thanks, Petr --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: How to configure data source for Jetty server?On Mon, Jul 6, 2009 at 10:38 PM, Igor Vaynberg<igor.vaynberg@...> wrote:
> http://docs.codehaus.org/display/JETTY/JNDI Hi Igor, thanks for you prompt reply, but I was not able to utilize it (I had a glance at some Jetty docs before asking my question), because I don't know, how is Jetty integrated into Eclipse IDE, hence I do not know where to put/modify its configurations files. I didn't install Jetty server on my machine, I do not have Jetty's plugin installed in Eclipse. I can find its .jar files in local Maven's repository only. In spite of it, I can run it from Eclipse and it works (e.g. with some wicketstuff examples) :-OOO Thanks, Petr --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: How to configure data source for Jetty server?Peter Thomas wrote: > On Tue, Jul 7, 2009 at 2:08 AM, Igor Vaynberg <igor.vaynberg@...>wrote: > > >> http://docs.codehaus.org/display/JETTY/JNDI >> >> -igor >> >> On Mon, Jul 6, 2009 at 1:22 PM, Petr Fejfar<petr.fejfar@...> wrote: >> >>> Hi all, >>> >>> When I've started learning Wicket, I followed configuration described >>> in the book Enjoy web dev ... >>> >>> Now I'm trying to migrate my project under Maven's management. I seem >>> to be almost >>> finished except data source configuration in the Tomcat's context file: >>> >>> <Resource >>> name="jdbc/trackerDataSource" >>> auth="Container" >>> type="javax.sql.DataSource" >>> driverClassName="org.postgresql.Driver" >>> url="jdbc:postgresql://localhost/tracker" >>> username="xxx" >>> password="xxx" >>> maxActive="20" >>> maxIdle="8" >>> defaultAutoCommit="false" >>> defaultTransactionIsolation="SERIALIZABLE" >>> testOnBorrow="true" >>> validationQuery="select 1"/> >>> >>> Please, could somebody show me how to achieve >>> the same effect in Jetty's configuration? >>> >>> > > A couple of tips to do the Jetty DataSource JNDI configuration the 'wicket > way' - in code, instead of xml. > > Use a datasource implementation like org.apache.commons.dbcp.BasicDataSource > > In the Start.java that you get after following the instructions here: > http://wicket.apache.org/quickstart.html > > Add the following: > > BasicDataSource ds = new BasicDataSource(); > ds.setUrl("jdbc:hsqldb:."); > ds.setDriverClassName("org.hsqldb.jdbcDriver"); > ds.setUsername("sa"); > ds.setPassword(""); > > NamingEntry.setScope(NamingEntry.SCOPE_GLOBAL); > // this line actually registers object in jetty jndi > new Resource("java:/mydatasource", ds); > > And you can refer the documentation of Apache DPCP to set properties like > this: > > ds.setValidationQuery("SELECT 1"); > > Thanks, > > Peter. > > src/main/webapp/WEB-INF/jetty-env.xml. We also deploy to jetty servers in production and use the jetty-env.xml. Btw, does anyone know how to set the hibernate.dialect via JNDI? Thanks, Roman >>> Thanks, Peter >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscribe@... >>> For additional commands, e-mail: users-help@... >>> >>> >>> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@... >> For additional commands, e-mail: users-help@... >> >> >> > > -- Liland ...does IT better Liland IT GmbH Creative Master email: Roman.Zechner@... http://www.Liland.at office: +43 (0)463 220-111 | fax: +43 463 220-111 DW 33 mobil: +43 (0) 699 122 011 28 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
| Free embeddable forum powered by Nabble | Forum Help |