【发布时间】:2011-05-05 01:01:42
【问题描述】:
我正在对 Mapper 问题进行故障排除,但在尝试在 Scala/Lift 控制台中使用 Mapper 类时遇到了问题。我们的 MetaMapper 的数据源通过 ConnectionIdentifier 配置,该 ConnectionIdentifier 指向在 JNDI 中配置的 JDBC 数据源。这在通过 Jetty 引导时非常有用。
加载控制台并运行(new bootstrap.liftweb.Boot).boot 进行初始化时,Schemifier.schemify 失败 JNDI 配置不可用。
scala> (new bootstrap.liftweb.Boot).boot
java.lang.NullPointerException: Looking for Connection Identifier ConnectionIdentifier(jdbc/svcHub) but failed to find either a JNDI data source with the name jdbc/svcHub or a lift connection manager with the correct name
at net.liftweb.mapper.DB$$anonfun$7$$anonfun$apply$12.apply(DB.scala:141)
at net.liftweb.mapper.DB$$anonfun$7$$anonfun$apply$12.apply(DB.scala:141)
at net.liftweb.common.EmptyBox.openOr(Box.scala:465)
at net.liftweb.mapper.DB$$anonfun$7.apply(DB.scala:140)
at net.liftweb.mapper.DB$$anonfun$7.apply(DB.scala:140)
at net.liftweb.common.EmptyBox.openOr(Box.scala:465)
at net.liftweb.mapper.DB$.newConnection(DB.scala:134)
at net.liftweb.mapper.DB$.getConnection(DB.scala:230)
at net.liftweb.mapper.DB$.use(DB.scala:581)
at net.liftweb.mapper.Schemifier$.schemify(Sche...
基本上,我希望在控制台中拥有完整的 MetaMapper 功能。我的问题是:从控制台引导 Lift 应用程序以使基于 JNDI 的依赖项也可以在支持 JNDI 的 Web 容器之外实现的最佳方式是什么?
【问题讨论】:
标签: maven-2 scala scala-2.8 lift