Thanks for the response Indrajit. Yes this is the same issue I had opened 246 for and sorry for beating a dead horse.
The thing is that in most cases, you do want to container to provide the db driver. It's bad practice to create a war file with dependence on a specific database, let alone a specific version of the database (1.2.121 of h2 in this case) as it limits the reusability of that warfile. I say most cases meaning most production cases, but if this is a simple example for development purposes, surely having hot redeploy for rapid development is of high value. Spending an hour on my first day with Liftweb figuring out why Jetty couldn't handle a restart was disgruntling. I still haven't even gotten around to learning the cool stuff in Lift because of the derailing. I recently spoke with another colleague who had the same issue but he just blamed it on Maven so you're off the hook =P If you are 100% intent on providing the h2 jarfile inside of the warfile then you could configure maven-war-plugin to include the dependency only in the warfile rather than compilation class scope so it will not affect jetty:run (it would still affect jetty:run-war). I could quickly provide the xml to do this if you deem it worthwhile, although I would recommend against it. Ultimately I'm just trying to help people who are getting started like myself. Thanks for your time and thoughts in response. On Dec 28, 4:36 am, Indrajit Raychaudhuri <[email protected]> wrote: > Joseph, > > I assume your concern is same as the one that you had mentioned > here:http://github.com/dpp/liftweb/issues/246/find. > > While this is a genuine case for the scenario you described, marking db > driver as 'provided' has the side effect of not being included with the > generated war (because the container would be expected to provide this). > > This is fine if the application is deployed on a container using > container managed persistence. However, if you are expecting the db > driver to be loaded by the same classloader (context classloader) as the > application you would be expected to provide it as part of the war (and > therefore not in 'provided' scope). > > Cheers, Indrajit > > On 28/12/09 1:19 AM, joseph hirn wrote: > > > I had started another thread about this being a derby issue but it's > > more related to the archetype. > > > Still in the M8 archetype, h2 db is dependency of the project rather > > than a dependency of Jetty. It is better to have jetty declare the h2 > > dep because it keeps the sample app database independent. Even if you > > are programming directly to H2 API it is better to mark provided and > > have it be provided at runtime by the system or container. The bigger > > issue I'm experiencing is that it makes Jetty also unable to survive > > hot changes to class files for me. If I change a file and compile > > while jetty is running I get this error: > > > ------------------------------------------------------------------------------------------------------------- > > org.h2.jdbc.JdbcSQLException: Database may be already in use: Locked > > by another process. Possible solutions: close all other connection(s); > > use the server mode [90020-121] > > > $mvn -version > > Apache Maven 2.2.1 (r801777; 2009-08-06 14:16:01-0500) > > Java version: 1.6.0_16 > > Java home: C:\Java\jdk1.6.0_16\jre > > Default locale: en_US, platform encoding: Cp1252 > > OS name: "windows 7" version: "6.1" arch: "x86" Family: "windows" > > > ------------------------------------------------------------------------------------------------------------- > > > This is probably because the application is spinning up the database > > and Jetty is unable to clean it out entirely due to it being outside > > the scope of a normal web application (I assume is spawns some of its > > own threads). > > > By moving the dependency inside of Jetty like this I no longer have > > the issue. I've used Jetty+Maven alot and have had to do this with > > other api's, specifically Tibco RVD: > > [----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] > > <plugin> > > <groupId>org.mortbay.jetty</groupId> > > <artifactId>maven-jetty-plugin</artifactId> > > <configuration> > > <contextPath>/</contextPath> > > <scanIntervalSeconds>5</scanIntervalSeconds> > > </configuration> > > > <dependencies> > > <dependency> > > <groupId>com.h2database</groupId> > > <artifactId>h2</artifactId> > > <version>1.2.121</version> > > </dependency> > > </dependencies> > > > </plugin> > > [------------------------------------------------------------------------------------------------------------------------------------------------------------] > > > On Dec 16, 6:36 am, Xuefeng Wu<[email protected]> wrote: > >> anyone will add the source.jar? > > >> On Wed, Dec 16, 2009 at 3:33 AM, Jim McBeath<[email protected]> wrote: > >>> It looks like the source jars are missing from the M8 repository, at > >>> least for some of the libraries (for example, > >>> <http://scala-tools.org/repo-releases/net/liftweb/lift-util/1.1-M8/>). > > >>> Are these perhaps located somewhere else now? Or do they typically > >>> get added a bit later? > > >>> -- > >>> Jim > > >>> On Mon, Dec 14, 2009 at 11:37:02AM -0800, David Pollak wrote: > >>>> Date: Mon, 14 Dec 2009 11:37:02 -0800 > >>>> From: David Pollak<[email protected]> > >>>> To: liftweb<[email protected]> > >>>> Subject: [Lift] [ANN] Lift 1.1-M8 > > >>>> The Lift Web Framework team is pleased to announce the lift-1.1-M8 > >>> release! > > >>> -- > > >>> You received this message because you are subscribed to the Google Groups > >>> "Lift" group. > >>> To post to this group, send email to [email protected]. > >>> To unsubscribe from this group, send email to > >>> [email protected]<liftweb%[email protected]> > >>> . > >>> For more options, visit this group at > >>>http://groups.google.com/group/liftweb?hl=en. > > >> -- > >> Scala中文社区: http://groups.google.com/group/scalacn > > > -- > > > You received this message because you are subscribed to the Google Groups > > "Lift" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]. > > For more options, visit this group > > athttp://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
