I did "mvn clean" but dosn't help. And I try implement a custom
DBVender, found that the newConnection() even not being call.

  def boot {
    LiftRules.formatDate = formatDate

      DB.defineConnectionManager(DefaultConnectionIdentifier,
DBVendor)

    LiftRules.addToPackages("hello")

    LiftRules.setSiteMap(SiteMap(MenuInfo.menu: _*))

    LiftRules.early.append{ _.setCharacterEncoding("UTF-8") }
  }


  object DBVendor extends ConnectionManager {

    def newConnection(name: ConnectionIdentifier): Box[Connection] = {
      try {
        Class.forName(Props.get("db.driver").openOr
("com.mysql.jdbc.Driver"))
        println(Props.props)
        val c = Full(DriverManager.getConnection(
            Props.get("db.url").openOr("jdbc:mysql://localhost/mydb?
autoReconnectForPools=true"),
            Props.get("db.user").openOr("root"), Props.get
("db.password").openOr("")))
        println("============================================")
        println(c)
        c
      } catch {
        case e: Exception => e.printStackTrace; Empty
      }
    }

    def releaseConnection(conn: Connection) {
      conn.close
    }
  }


On Dec 18, 8:05 am, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> Please try doing a "mvn clean" and then retry your application.
>
> I have seen no problems with the dozen+ Lift apps I work with related to
> connections not working between M7 and M8.
>
>
>
>
>
> On Thu, Dec 17, 2009 at 5:59 AM, Jarod Liu <liuyuan...@gmail.com> wrote:
> > The same code works fine in 1.1M7. Anyone know what causes the
> > problem. Or maybe a bug in 1.1M8?
>
> > boot.scala:
> >      DB.defineConnectionManager(DefaultConnectionIdentifier,
> >                                 new StandardDBVendor
> > ("com.mysql.jdbc.Driver",
> >                                                      "jdbc:mysql://
> > localhost/mydb?autoReconnectForPools=true",
> >                                                      "root", ""))
>
> > the error message:
>
> >    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</pre></p><h3>Caused by:</
> > h3><pre>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
> >        at net.liftweb.mapper.DB$$anonfun$2$$anonfun$apply$8.apply(DB.scala:
> > 97)
> >        at net.liftweb.mapper.DB$$anonfun$2$$anonfun$apply$8.apply(DB.scala:
> > 97)
> >        at net.liftweb.common.EmptyBox.openOr(Box.scala:372)
> >        at net.liftweb.mapper.DB$$anonfun$2.apply(DB.scala:96)
> >        at net.liftweb.mapper.DB$$anonfun$2.apply(DB.scala:96)
> >        at net.liftweb.common.EmptyBox.openOr(Box.scala:372)
> >        at net.liftweb.mapper.DB$.newConnection(DB.scala:90)
> >        at net.liftweb.mapper.DB$.getConnection(DB.scala:186)
> >        at net.liftweb.mapper.DB$.use(DB.scala:446)
> >        at net.liftweb.mapper.DB$$anon$1$$anonfun$apply$9.recurseMe$1
> > (DB.scala:160)
> >        at
> > net.liftweb.mapper.DB$$anon$1$$anonfun$apply$9.apply(DB.scala:162)
> >        at net.liftweb.util.DynoVar$class.run(ThreadGlobal.scala:91)
> >        at net.liftweb.mapper.DB$$anon$1$DepthCnt$.run(DB.scala:143)
> >        at net.liftweb.mapper.DB$$anon$1.apply(DB.scala:146)
> >        at net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:912)
> >        at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit
> > $1.apply(S.scala:1112)
> >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >        at net.liftweb.http.S$.net$liftweb$http$S$$_nest2InnerInit(S.scala:
> > 1111)
> >        at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
> > $anonfun$apply$28$$anonfun$apply$29$$anonfun$apply$30$$anonfun$apply
> > $31.apply(S.scala:1133)
> >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >        at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
> > $anonfun$apply$28$$anonfun$apply$29$$anonfun$apply$30.apply(S.scala:
> > 1132)
> >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >        at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
> > $anonfun$apply$28$$anonfun$apply$29.apply(S.scala:1131)
> >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >        at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
> > $anonfun$apply$28.apply(S.scala:1130)
> >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >        at
> > net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1.apply
> > (S.scala:1129)
> >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >        at net.liftweb.http.S$.net$liftweb$http$S$$_innerInit(S.scala:1128)
> >        at net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$38$$anonfun
> > $apply$39$$anonfun$apply$40$$anonfun$apply$41$$anonfun$apply$42.apply
> > (S.scala:1175)
> >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >        at net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$38$$anonfun
> > $apply$39$$anonfun$apply$40$$anonfun$apply$41.apply(S.scala:1174)
> >        at
> > net.liftweb.http.CoreRequestVarHandler$class.apply(Vars.scala:325)
> >        at net.liftweb.http.RequestVarHandler$.apply(Vars.scala:248)
> >        at net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$38$$anonfun
> > $apply$39$$anonfun$apply$40.apply(S.scala:1173)
> >        at
> > net.liftweb.http.CoreRequestVarHandler$class.apply(Vars.scala:325)
> >        at
> > net.liftweb.http.TransientRequestVarHandler$.apply(Vars.scala:252)
> >        at net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$38$$anonfun
> > $apply$39.apply(S.scala:1172)
> >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >        at net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$38.apply
> > (S.scala:1171)
> >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >        at net.liftweb.http.S$$anonfun$_init$1.apply(S.scala:1170)
> >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >        at net.liftweb.http.S$._init(S.scala:1169)
> >        at net.liftweb.http.S$.init(S.scala:825)
> >        at net.liftweb.http.S$.initIfUninitted(S.scala:1514)
> >        at net.liftweb.http.Req$.apply(Req.scala:140)
> >        at net.liftweb.http.provider.HTTPProvider$class.service
> > (HTTPProvider.scala:52)
> >        at net.liftweb.http.LiftFilter.service(LiftServlet.scala:523)
> >        at net.liftweb.http.provider.servlet.ServletFilterProvider
> > $class.protected$service(ServletFilterProvider.scala:43)
> >        at net.liftweb.http.LiftFilter.protected$service(LiftServlet.scala:
> > 523)
> >        at net.liftweb.http.provider.servlet.ServletFilterProvider$$anonfun
> > $doFilter$1$$anonfun$apply$1.apply(ServletFilterProvider.scala:43)
> >        at net.liftweb.http.provider.servlet.ServletFilterProvider$$anonfun
> > $doFilter$1$$anonfun$apply$1.apply(ServletFilterProvider.scala:38)
> >        at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun
> > $apply$10$$anonfun$apply$11$$anonfun$apply$12.apply(Vars.scala:331)
> >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >        at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun
> > $apply$10$$anonfun$apply$11.apply(Vars.scala:330)
> >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >        at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun
> > $apply$10.apply(Vars.scala:329)
> >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >        at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9.apply
> > (Vars.scala:328)
> >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >        at
> > net.liftweb.http.CoreRequestVarHandler$class.apply(Vars.scala:327)
> >        at net.liftweb.http.RequestVarHandler$.apply(Vars.scala:248)
> >        at net.liftweb.http.provider.servlet.ServletFilterProvider$$anonfun
> > $doFilter$1.apply(ServletFilterProvider.scala:37)
> >        at net.liftweb.http.provider.servlet.ServletFilterProvider$$anonfun
> > $doFilter$1.apply(ServletFilterProvider.scala:37)
> >        at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun
> > $apply$10$$anonfun$apply$11$$anonfun$apply$12.apply(Vars.scala:331)
> >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >        at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun
> > $apply$10$$anonfun$apply$11.apply(Vars.scala:330)
> >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >        at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun
> > $apply$10.apply(Vars.scala:329)
> >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >        at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9.apply
> > (Vars.scala:328)
> >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:67)
> >        at
> > net.liftweb.http.CoreRequestVarHandler$class.apply(Vars.scala:327)
> >        at
> > net.liftweb.http.TransientRequestVarHandler$.apply(Vars.scala:252)
> >        at net.liftweb.http.provider.servlet.ServletFilterProvider
> > $class.doFilter(ServletFilterProvider.scala:36)
> >        at net.liftweb.http.LiftFilter.doFilter(LiftServlet.scala:523)
> >        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
> > (ServletHandler.java:1157)
> >        at org.mortbay.jetty.servlet.ServletHandler.handle
> > (ServletHandler.java:388)
> >        at org.mortbay.jetty.security.SecurityHandler.handle
> > (SecurityHandler.java:216)
> >        at org.mortbay.jetty.servlet.SessionHandler.handle
> > (SessionHandler.java:182)
> >        at org.mortbay.jetty.handler.ContextHandler.handle
> > (ContextHandler.java:765)
> >        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
> > 418)
> >        at org.mortbay.jetty.handler.ContextHandlerCollection.handle
> > (ContextHandlerCollection.java:230)
> >        at org.mortbay.jetty.handler.HandlerCollection.handle
> > (HandlerCollection.java:114)
> >        at org.mortbay.jetty.handler.HandlerWrapper.handle
> > (HandlerWrapper.java:152)
> >        at org.mortbay.jetty.Server.handle(Server.java:326)
> >        at
> > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
> > 542)
> >        at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete
> > (HttpConnection.java:923)
> >        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
> >        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
> >        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> >        at org.mortbay.io.nio.SelectChannelEndPoint.run
> > (SelectChannelEndPoint.java:409)
> >        at org.mortbay.thread.QueuedThreadPool$PoolThread.run
> > (QueuedThreadPool.java:582)
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > liftweb+unsubscr...@googlegroups.com<liftweb%2bunsubscr...@googlegroups.com 
> > >
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> --
> Lift, the simply functional web framework ...
>
> read more »

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.


Reply via email to