scala lift actor,错误:类型不匹配;
问候 我正在使用scala版本2.8.0和lift版本2.1用maven编译我的项目,我标记了以下错误: error: type mismatch; [INFO] required: **scala.actors.Actor** [INFO] Auctioneer !? AddListener(**this**, this.itemId) match { [INFO] ^ error: type mismatch; [INFO] required: **scala.actors.Actor** [INFO] Auctioneer ! RemoveListener(**this**, this.itemId) [INFO] ^ 错误:类型不匹配; [信息]必填:*scala.actors.Actor** [信息]拍卖师!?AddListener(**此**,此.itemId)匹配{ [信息]^ 错误:类型不匹配; [信息]必填:*scala.actors.Actor** [信息]拍卖商!RemoveListener(**此**,此.itemId) [信息]^ 该文件是:scala lift actor,错误:类型不匹配;,scala,lift,actor,Scala,Lift,Actor,问候 我正在使用scala版本2.8.0和lift版本2.1用maven编译我的项目,我标记了以下错误: error: type mismatch; [INFO] required: **scala.actors.Actor** [INFO] Auctioneer !? AddListener(**this**, this.itemId) match { [INFO] ^ error: type mismatch; [I
package org.developerworks.comet
import net.liftweb.http._
import net.liftweb.common.Full
import net.liftweb.http.S._
import net.liftweb.http.SHtml._
import net.liftweb.http.js.JsCmd
import net.liftweb.http.js.JsCmds._
import net.liftweb.http.js.JE._
import net.liftweb.util.Helpers._
import net.liftweb.util._
import scala.xml.NodeSeq
import org.developerworks.model._
import org.developerworks.actor._
import java.lang.Long
class AuctionActor extends CometActor {
var highBid : TheCurrentHighBid = null
override def defaultPrefix = Full("auction")
val itemId = S.param("itemId").map(Long.parseLong(_)).openOr(0L)
def render = {
def itemView: NodeSeq = {
val item = if (itemId > 0)
ItemMetaData.findByKey(itemId).openOr(ItemMetaData.create)
else ItemMetaData.create
val currBid = item.highBid
val bidAmt = if (currBid.user.isEmpty) 0L else currBid.amount.is
highBid = TheCurrentHighBid(bidAmt, currBid.user.obj.openOr(User.currentUser.open_!))
val minNewBid = highBid.amount + 1L
val button = <button type="button">{S.?("Bid Now!")}</button> %
("onclick" -> ajaxCall(JsRaw("$('#newBid').attr('value')"), bid _))
(<div>
<strong>{item.name}</strong>
<br/>
<div>
Current Bid: ${highBid.amount} by {highBid.user.niceName}
</div>
<div>
New Bid (min: ${minNewBid}) :
<input type="text" id="newBid"/>
{button}
</div>
{item.description}<br/>
</div>)
}
bind("foo" -> <div>{itemView}</div>)
}
def bid(s:String): JsCmd = {
val user = User.currentUser.open_!
Auctioneer ! BidOnItem(itemId, Long.parseLong(s), user)
Noop
}
override def localSetup {
Auctioneer !? AddListener(this, this.itemId) match {
case Success(true) => println("Listener added")
case _ => println("Other ls")
}
}
override def localShutdown {
Auctioneer ! RemoveListener(this, this.itemId)
}
override def lowPriority : PartialFunction[Any, Unit] = {
case TheCurrentHighBid(a,u) => {
highBid = TheCurrentHighBid(a,u)
reRender(false)
}
case _ => println("Other lp")
}
}
package org.developerworks.comet
导入net.liftweb.http_
导入净额。liftweb.common.Full
导入net.liftweb.http.S_
导入net.liftweb.http.SHtml_
导入net.liftweb.http.js.JsCmd
导入net.liftweb.http.js.JsCmds_
导入net.liftweb.http.js.JE_
导入net.liftweb.util.Helpers_
导入net.liftweb.util_
导入scala.xml.NodeSeq
导入org.developerworks.model_
导入org.developerworks.actor_
导入java.lang.Long
类AuctionActor扩展了CometActor{
var highBid:currenthighbid=null
覆盖def defaultPrefix=Full(“拍卖”)
val itemId=S.param(“itemId”).map(Long.parseLong()).openOr(0L)
def呈现={
def itemView:NodeSeq={
val item=if(itemId>0)
ItemMetaData.findByKey(itemId).openOr(ItemMetaData.create)
else ItemMetaData.create
val currBid=项目。高标
val bidAmt=if(currBid.user.isEmpty)0L else currBid.amount.is
highBid=currenthighbid(bidAmt,currBid.user.obj.openOr(user.currentUser.open!))
val minNewBid=高标金额+1L
val按钮={S.?(“立即出价!”)}%
(“onclick”->ajaxCall(JsRaw($('newBid').attr('value')),bid))
(
{item.name}
当前出价:${highBid.user.niceName}
新出价(最低:${minNewBid}):
{按钮}
{item.description}
)
}
绑定(“foo”->{itemView})
}
def bid(s:字符串):JsCmd={
val user=user.currentUser.open_33;!
拍卖商!BidOnItem(itemId,Long.parseLong,user)
努普
}
覆盖def本地设置{
拍卖商!?AddListener(this,this.itemId)匹配{
案例成功(true)=>println(“添加的侦听器”)
案例=>println(“其他ls”)
}
}
覆盖def本地关机{
拍卖商!RemoveListener(this,this.itemId)
}
覆盖def低优先级:部分功能[任何,单元]={
案例当前高HBID(a,u)=>{
高标=当前高标(a,u)
重新加载程序(错误)
}
案例=>println(“其他lp”)
}
}
任何人都可以告诉我我失踪了还是我做错了
我在2.7.3版中编译了这个项目,没有任何问题
请帮帮我!!!Lift的演员不再是Scala演员。他们可能有一种互操作的方式,但我建议首先尝试更改所有演员,使他们成为Lift演员。Lift的演员不再是Scala演员。他们可能有一种互操作的方式,但我建议首先尝试更改所有演员,使他们不再是Scala演员它们是Lift Actor。您可以在同一个项目中使用Scala Actor和Lift Actor,但不能相互替代。它们使用完全不同的Actor系统实现,因此据我所知,它们无法相互发送消息 在Lift项目中,我通常将LiftActors用于我的singleton,命名的actors将接收显式发送给它的消息。为了便于阅读,我将使用Scala actors来执行后台任务,如记录对数据库的写入:
actor { mapper.save }
您可以在同一个项目中使用Scala Actor和Lift Actor,但不能相互替换。它们使用完全不同的Actor系统实现,因此据我所知,它们不能相互发送消息 在Lift项目中,我通常将LiftActors用于我的singleton,命名的actors将接收显式发送给它的消息。为了便于阅读,我将使用Scala actors来执行后台任务,如记录对数据库的写入:
actor { mapper.save }