Using just the skeleton project created by lift-archetype-basic, I'm
getting these exceptions out of jetty:
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]
ERROR - Failed to Boot
java.lang.NullPointerException: Looking for Connection Identifier
ConnectionIdentifier(lift) but failed to find either a JNDI data
source with the name lift or a lift connection manager with the
correct name
Once this happens, the app is non-functional. This occurs whenever
jetty restarts due to updated code. I can trigger the issue by:
1. Running mvn jetty:run in one console
2. Running mvn scala:cc in another console
3. Running touch src/main/scala/bootstrap/liftweb/Boot.scala in a 3rd
console
This causes a recompilation, which causes a jetty restart, which blows
up with the exceptions.
Has anybody else seen or fixed this issue? Should it be useful, I've
stashed the project at http://nparry.com/posted_files/jetty_lift_issues/lifttest.tgz
including a jetty.log of the output with the full stack traces.
Wandering into wild-speculation territory (AKA speak and remove all
doubt) ...
Based on the jdbc exception, I poked around in the DB code - looking
at ProtoDBVendor I couldn't see how connections in 'pool' would ever
be released. Thus I tried a quick hack in my project to force the
pool to be empty...
DB.defineConnectionManager(DefaultConnectionIdentifier,
new StandardDBVendor(
Props.get("db.driver") openOr
"org.h2.Driver",
Props.get("db.url") openOr
"jdbc:h2:lift_proto.db",
Props.get("db.user"),
Props.get("db.password")) {
override def maxPoolSize = 0
})
This obviously is not a good solution, but it does seem to clear up
the exceptions when jetty restarts - the theory being that during
shutdown the old connections are not closed, leading to errors during
restart since the new connection can't be created. Forcing an empty
pool means there is no old connection around to trigger the problem.
I guess the question out of all that would be - do we need (or is
there already) a shutdown hook to correspond to the boot hook? This
would allow for cleanup in this sort of situation (ie, close any
connections left in the pool).
--
Nathan
On Dec 30, 7:15 pm, Nathan Parry <npa...@gmail.com> wrote:
> Searching turned up a few older threads similar to the problem I'm
> seeing, but I couldn't find any solution.
>
> Using just the skeleton project created by lift-archetype-basic, I'm
> getting these exceptions out of jetty:
>
> 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]
>
> ERROR - Failed to Boot
> java.lang.NullPointerException: Looking for Connection Identifier
> ConnectionIdentifier(lift) but failed to find either a JNDI data
> source with the name lift or a lift connection manager with the
> correct name
>
> Once this happens, the app is non-functional. This occurs whenever
> jetty restarts due to updated code. I can trigger the issue by:
>
> 1. Running mvn jetty:run in one console
> 2. Running mvn scala:cc in another console
> 3. Running touch src/main/scala/bootstrap/liftweb/Boot.scala in a 3rd
> console
>
> This causes a recompilation, which causes a jetty restart, which blows
> up with the exceptions.
>
> Has anybody else seen or fixed this issue? Should it be useful, I've
> stashed the project athttp://nparry.com/posted_files/jetty_lift_issues/lifttest.tgz
On Dec 31, 12:33 am, joseph hirn <joseph.h...@gmail.com> wrote:
> Yes I had an open thread on this issue but it's not being seen as a
> real issue.
>
> http://groups.google.com/group/liftweb/browse_thread/thread/78454f767...
Searching turned up a few older threads similar to the problem I'm
seeing, but I couldn't find any solution.
Using just the skeleton project created by lift-archetype-basic, I'm
getting these exceptions out of jetty:
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]
ERROR - Failed to Boot
java.lang.NullPointerException: Looking for Connection Identifier
ConnectionIdentifier(lift) but failed to find either a JNDI data
source with the name lift or a lift connection manager with the
correct name
Once this happens, the app is non-functional. This occurs whenever
jetty restarts due to updated code. I can trigger the issue by:
1. Running mvn jetty:run in one console
2. Running mvn scala:cc in another console
3. Running touch src/main/scala/bootstrap/liftweb/Boot.scala in a 3rd
console
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
new StandardDBVendor(Props.get("db.driver") openOr "org.h2.Driver",
Props.get("db.url") openOr
"jdbc:h2:lift_proto.db;AUTO_SERVER=TRUE",
Props.get("db.user"), Props.get("db.password"))
Note the ";AUTO_SERVER=TRUE" part of the DB URL. This makes the H2
restart issue go away. There's an additional issue of ActorPing which
is not restarting correctly. I've got a fix for that as well and I'll
have the code up on review board in a little while.
On Dec 31, 10:13 am, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> > liftweb+u...@googlegroups.com<liftweb%2Bunsu...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890
On Dec 31, 1:41 pm, David Pollak <feeder.of.the.be...@gmail.com>
wrote: