2012-04-18 3 views
0

User.scalajava.util.prefs.BackingStoreException 하니까 2 레코드를 저장할 때 : 원시 기록 자체

import net.liftweb.record.{ MegaProtoUser, MetaMegaProtoUser } 
import net.liftweb.squerylrecord.RecordTypeMode._ 
import net.liftweb.common._ 
import net.liftweb.util.FieldError 
import net.liftweb.http.S 

class User extends MegaProtoUser[User] { 

    def meta = User 

    protected def valUnique(errorMsg: => String)(email: String): List[FieldError] = { 
    List[FieldError]() 
    } 

} 

/** 
* The singleton that has methods for accessing the database 
*/ 
object User extends User with MetaMegaProtoUser[User] { 

    override def basePath = "profile" :: Nil 

    override def signupFields = email :: password :: Nil 

    override def signupXhtml(user: TheUserType) = { 
    (<form method="post" action={ S.uri }><table> 
              <tr><td colspan="2">{ S.??("sign.up") }</td></tr> 
              { localForm(user, false, signupFields) } 
              <tr><td>&nbsp;</td><td><user:submit class="btn btn-primary" /></td></tr> 
              </table></form>) 
    } 

    override def screenWrap = Full(<lift:surround with="default" at="content"> 
            <lift:bind/> 
           </lift:surround>) 

    // redefine login form for nice formatting 
    override def loginXhtml = 
    <form method="post" action={ S.uri }> 
     <lift:msg show="All"/> 
     <div style="margin-bottom: 5px; margin-left: 5px;"> 
     <strong> 
      { S.??("log.in") } 
     </strong> 
     </div> 
     <div style="float: left; line-height: 2.5em;margin-left: 5px; margin-right: 20px;"> 
     { S.??("email.address") }<br/>{ S.??("password") }<br/> 
     <a href={ lostPasswordPath.mkString("/", "/", "") }> 
      { S.??("recover.password") } 
     </a> 
     </div> 
     <div style="line-height: 2.5em;"> 
     <user:email/> 
     <br/> 
     <user:password/> 
     <br/> 
     <user:submit class="btn btn-primary"/> 
     </div> 
    </form> 

    protected def userFromStringId(id: String): Box[User] = from(PPSchema.users)(u => 
    where(u.id === id.toLong) 
     select (u)).headOption 

    protected def findUserByUserName(email: String): Box[User] = from(PPSchema.users)(u => 
    where(u.email === email) 
     select (u)).headOption 

    protected def findUserByUniqueId(id: String): Box[User] = userFromStringId(id) 
} 

내가 클래스 사용자 코드 아래 it.add있어 저장하지 마십시오.

override def saveTheRecord() : Box[User] = { 
    val u = User.createRecord.email(email.is).password(password.is).firstName(firstName.is).lastName(lastName.is).validated(validated.is).superUser(superUser.is) 

    Full(PPSchema.users.insert(u)) 
    } 

오류 메시지는 다음과 같습니다 :

메시지 : java.util.prefs.BackingStoreException : 원시 기록이 스스로 net.liftweb.record.Record $ class.saveTheRecord (Record.scala을 저장하지 마십시오 : 89) com.posplus.model.User.saveTheRecord (User.scala : 17) net.liftweb.record.MetaMegaProtoUser $ MyUserBridge.save (ProtoUser.scala : 294) net.liftweb.proto.ProtoUser $ class.actionsAfterSignup (ProtoUser.scala : 696) com.posplus.model.User $ .actionsAfterSignup (User.scala : 32) net.liftweb.proto.ProtoUser $ class. (ProtoUser.scala : 745) net.liftweb.proto.ProtoUser $$ anonfun $ innerSignup $ 1 $ 1.apply net.liftweb.http.S $ NFuncHolder $$ anonfun $ 적용 $ 5.apply (S.scala : 190) scala.collection.TraversableLike $$ anonfun $ map $ 1.apply (TraversableLike.scala : 194) scala.collection.TraversableLike $$ anonfun $ map $ 1.apply (TraversableLike.scala : 194) scala.collection.LinearSeqOptimized $ class.foreach (LinearSeqOptimized.scala : 59) scala.collection.immutable.List.foreach (List.scala : 45) scala.collection.TraversableLike $ class.map (TraversableLike.scala : 194) scala.collection.immutable.List.map (List.scala : 45) net.liftweb.http.S $ NFuncHolder.apply (S.scala : 190) net.liftweb.http.S $ ProxyFuncHolder.apply (S .scala : 115) net.liftweb.http.LiftSession $$ anonfun $ buildFunc $ 1 $ 2.apply (LiftSession.scala : 651) net.liftweb.http.LiftSession $$ anonfun $ 16 $$ anonfun $ apply $ 39.apply (LiftSession.scala : 667) net.liftweb.http.LiftSession $$ anonfun $ 16 $$ anonfun $ 적용 39.apply (LiftSession.scala : 667) scala.collection.TraversableLike $$ anonfun $ map $ 1.apply (TraversableLike. scala : 194) scala.collection.TraversableLike $$ anonfun $ map $ 1.apply (TraversableLike.scala : 194) scala.collection.LinearSeqOptimized $ class.foreach (LinearSeqOptimized.scala : 59) scala.collection.immutable (List.scala : 45) net.liftweb. http.LiftSession $$ anonfun $ 16.apply (LiftSession.scala : 667) net.liftweb.http.LiftSession $$ anonfun $ 16.apply (LiftSession.scala : 656) scala.collection.TraversableLike $$ anonfun $ flatMap $ 1. 적용 (TraversableLike.scala 200) scala.collection.TraversableLike $$ anonfun $ flatMap $ 1.apply (TraversableLike.scala 200) scala.collection.LinearSeqOptimized $의 class.foreach (LinearSeqOptimized.scala 59) scala.collection .immutable.List.foreach (List.scala : 45) scala.collection.TraversableLike $ class.flatMap (TraversableLike.scala : 200) sc ala.collection.immutable.List.flatMap (List.scala : 45) net.liftweb.http.LiftSession.runParams (LiftSession.scala : 655) net.liftweb.http.LiftSession.processRequest (LiftSession.scala : 1074) net.liftweb.http.LiftServlet.net $ liftweb $ http $ LiftServlet $$ dispatchStatefulRequest (LiftServlet.scala : 414) net.liftweb.http.LiftServlet $$ anonfun $ doSession $ 1 $ 1.apply (LiftServlet.scala : 279) net.liftweb.http.LiftServlet $$ anonfun $ doSession $ 1 $ 1.apply (LiftServlet.scala : 279) net.liftweb.http.S $ class.net $ liftweb $ http $ S $$ wrapQuery (S.scala : 1376) net.liftweb. http.S $$ anonfun $ net $ liftweb $ http $ S $$ _ nest2InnerInit $ 1 $$ anonfun $ 적용 34.apply (S.scala : 1524) net.liftweb.http.S $ class.net $ liftweb $ http $ S $$ doAround (S.scala : 1305) net.liftweb.http.S $$ anonfun $ net $ liftweb $ http $ S $$ doAround $ 1.apply (S.scala : 1306) org.squeryl.dsl. (QueryDsl.scala : 91) org.squeryl.dsl.QueryDsl $ class._Transaction (QueryDsl.scala : 105) net.liftweb.squerylrecord.RecordTypeMode $ .inTransaction (RecordTypeMode.scala : 34) bootstrap.liftweb.Boot $$ anon $ 1.apply (부 t.scala : 58) net.liftweb.http.S $ class.net $ liftweb $ http $ S $$ doAround (S.scala : 1306) net.liftweb.http.S $$ anonfun $ net $ liftweb $ http $ S $$ _ nest2InnerInit $ 1.apply (S.scala : 1522) net.liftweb.util.ThreadGlobal.doWith (ThreadGlobal.scala : 71) net.liftweb.http.S $ class.net $ liftweb $ http $ S $$ _ nest2InnerInit (S.scala : 1521) net.liftweb.http.S $$ anonfun $ net $ liftweb $ http $ S $$ _ innerInit $ 1 $$ anonfun $ 적용 $ 38 $$ anonfun $ 적용 $ 39 $$ anonfun $ $ 40 $$ anonfun $ 적용 $ 41.apply 적용 (S.scala : 1561) net.liftweb.util.ThreadGlobal.doWith (ThreadGlobal.scala : 71) net.liftweb.http.S $$ anonfun $ withReq $ 1.apply (S.scala : 1571) net.liftweb.util.ThreadGlobal.doWith (ThreadGlobal.scala : 71) net.liftweb.http.S $ class.withReq (S.scala : 1570) net.liftweb.http.S $ .withReq (S.scala : 48) net.liftweb.http.S $$ anonfun $ net $ liftweb $ http $ S $$ _ innerInit $ 1 $$ anonfun $ 적용 $ 38 $$ anonfun $ apply $ 39 $$ anonfun $ 적용 $ 40.apply (S.scala : 1560) net.liftweb.util.ThreadGlobal.doWith (ThreadGlobal.scala : 71) net.liftweb.http.S $$ anonfun $ net $ liftweb $ http $ S $$ _ innerInit $ 1 $$ anonfun $ 적용 $ 38 $$ anonfun $ 적용 $ 39.apply (S.scala : 1559) net.liftweb.util.ThreadGlobal.doWith (ThreadGlobal.scala : 71) net.liftweb .http.S $$ anonfun $ net $ liftweb $ http $ S $$ _ innerInit $ 1 $$ anonfun $ 적용 $ 38.apply (S.scala : 1558) net.liftweb.util.ThreadGlobal.doWith (ThreadGlobal.scala : 71) net.liftweb.http.S $$ anonfun $ net $ liftweb $ http $ S $$ _ innerInit $ 1.apply (S.scala : 1557) net.liftweb.util.ThreadGlobal.doWith (ThreadGlobal.scala : 71) net.liftweb.http.S $ class.net $ liftweb $ http $ S $$ _ innerInit (S.scala : 1556) net.liftweb.http.S $$ anonfun $ net $ liftweb $ http $ S $$ _ init $ 1 $$ anonfun $ 적용 $ 44 $$ anonfun $ 적용 $ 45 $$ anonfun $ 적용 $ 46 $$ anonfun $ 적용 $ 47 $$ anonfun $ 적용 $ 48.apply (S.scala : 1594) net.liftweb.util.ThreadGlobal.doWith (ThreadGlobal.scala : 71) net.liftweb.http.S $$ anonfun $ net $ liftweb $ http $ S $$ _ init $ 1 $$ anonfun $ 적용 $ 44 $$ anonfun $ 적용 $ 45 $$ anonfun $ 적용 $ 46 $$ anonfun $ apply $ 47.apply (S.scala : 1592) net.liftweb.http.CoreRequestVarHandler $ class.apply (Vars.scala : 613) net.liftweb.http.RequestVarHandler $ .apply (Vars.scala : 515) net.liftweb.http.S $$ anonfun $ net $ liftweb $ http $ S $$ _ init $ 1 $$ anonfun $ 적용 $ 44 $$ anonfun $ 적용 $ 45 $$ anonfun $ 적용 $ 46.apply (S.scala : 1591) net.liftweb.http.CoreRequestVarHandler $ class.apply (V ars.scala : 613) net.liftweb.http.TransientRequestVarHandler $ .apply (Vars.scala : 528) net.liftweb.http.S $$ anonfun $ net $ liftweb $ http $ S $$ _ init $ 1 $$ anonfun $ apply $ 44 $$ anonfun $ 적용 $ 45.apply (S.scala : 1590) net.liftweb.util.ThreadGlobal.doWith (ThreadGlobal.scala : 71) net.liftweb.http.S $$ anonfun $ net $ liftweb $ http $ S $$ _ init $ 1 $$ anonfun $ 적용 $ 44.apply (S.scala : 1589) net.liftweb.util.ThreadGlobal.doWith (ThreadGlobal.scala : 71) net.liftweb.http.S $$ anonfun $ net $ liftweb $ http $ S $$ _ init $ 1.apply (S.scala : 1588) net.liftweb.util.ThreadGlobal.doWith (ThreadGlobal.scala : 71) net.liftweb.http.S $ class. net $ liftweb $ http $ S $$ init (S.scala : 1587) net.liftweb.http.S $ class.init (S.(LiftServlet.scala : 278) net.liftweb.http.LiftServlet.doService (LiftServlet.scala : 288) net.liftweb.http.LiftServlet $$ anonfun $ doIt $ 1 $ 1.apply (LiftServlet.scala : 132) net.liftweb.http.LiftServlet $$ anonfun $ doIt $ 1 $ 1.apply (LiftServlet.scala : 131) net.liftweb.util.TimeHelpers $ class.calcTime (TimeHelpers.scala : 344) net.liftweb.util.Helpers $ .calcTime (Helpers.scala : 34) net.liftweb.util.TimeHelpers $ class.logTime (TimeHelpers.scala : 363) net.liftweb.util. 도우미 $ .logTime (Helpers.scala : 34) net.liftweb.http.LiftServlet.doIt $ 1 (LiftServlet.scala : 131) net.liftweb.http.LiftServlet.service (LiftServlet.scala : 142) net.liftweb.http.provider.HTTPProvider $$ anonfun $ service $ 2 $$ anonfun $ apply $ mcV $ sp $ 1 $$ anonfun $ 적용 $ mcV $ sp $ 2.apply $ mcV $ sp (HTTPProvider.scala : 72) net.liftweb.http.provider.HTTPProvider $$ anonfun $ service $ 2 $$ anonfun $ apply $ mcV $ sp $ 1 $$ anonfun $ 적용 $ mcV $ sp $ 2.apply (HTTPProvider.scala : 71) net.liftweb.http .provider.HTTPProvider $$ anonfun $ service $ 2 $$ anonfun $ apply $ mcV $ sp $ 1 $$ anonfun $ 적용 $ mcV $ sp $ 2.apply (HTTPProvider.scala : 71) net.liftweb.util.ThreadGlobal.doWith (ThreadGlobal.scala : 71) net.liftweb.http.URLRewriter $ .doWith (Req.scala : 1253) net.liftweb.http.provider.HTTPProvider $$ anonfun $ service $ 2 $$ anonfun $ apply $ mcV $ sp $ 1 .apply $ mcV $ sp (HTTPProvider.scala : 70) net.liftweb.http.provider.HTTPProvider $$ anonfun $ service $ 2 $$ anonfun $ apply $ mcV $ sp $ 1.apply (HTTPProvider.scala : 70) net .엘 iftweb.http.provider.HTTPProvider $$ anonfun $ service $ 2 $$ anonfun $ apply $ mcV $ sp $ 1.apply (HTTPProvider.scala : 70) net.liftweb.util.ThreadGlobal.doWith (ThreadGlobal.scala : 71) net.liftweb.http.provider.HTTPProvider $$ anonfun $ service $ 2.apply $ mcV $ sp (HTTPProvider.scala : 66) net.liftweb.http.provider.HTTPProvider $$ anonfun $ service $ 2.apply (HTTPProvider.scala : 60) net.liftweb.http.provider.HTTPProvider $$ anonfun $ service $ 2.apply (HTTPProvider.scala : 60) net.liftweb.util.ThreadGlobal.doWith (ThreadGlobal.scala : 71) net.liftweb. http.provider.HTTPProvider $ class.service (HTTPProvider.scala : 60) net.liftweb.http.LiftFilter.service (LiftServlet.scala : 757) net.liftweb.http.provider.servlet.ServletFilterProvider $$ anonfun $ doFilter $ 1 $$ anonfun $ 적용 $ mcV $ sp $ 1.apply $ m cV $ sp (ServletFilterProvider.scala : 67) net.liftweb.http.provider.servlet.ServletFilterProvider $$ anonfun $ doFilter $ 1 $$ anonfun $ apply $ mcV $ sp $ 1.apply (ServletFilterProvider.scala : 62) net. liftweb.http.provider.servlet.ServletFilterProvider $$ anonfun $ doFilter $ 1 $$ anonfun $ apply $ mcV $ sp $ 1.apply (ServletFilterProvider.scala : 62) net.liftweb.http.CoreRequestVarHandler $$ anonfun $ apply $ 16 $$ anonfun $ apply $ 17 $$ anonfun $ apply $ 18 $$ anonfun $ apply $ 19.apply (Vars.scala : 619) net.liftweb.util.ThreadGlobal.doWith (ThreadGlobal.scala : 71) net.liftweb.http.CoreRequestVarHandler $$ anonfun $ 적용 $ 16 $$ anonfun $ 적용 $ 17 $$ anonfun $ 적용 $ 18.apply (Vars.scala : 618) net.liftweb.util.ThreadGlobal.doWith (ThreadGlobal.scala : 71) net.liftweb.http .CoreRequestVarHandler $$ anonfun $ 적용 $ 16 $$ anonfun $ 적용 $ 17.apply (Vars.s cala : 617) net.liftweb.util.ThreadGlobal.doWith (ThreadGlobal.scala : 71) net.liftweb.http.CoreRequestVarHandler $$ anonfun $ apply $ 16.apply (Vars.scala : 616) net.liftweb.util .ThreadGlobal.doWith (ThreadGlobal.scala : 71) net.liftweb.http.CoreRequestVarHandler $ class.apply (Vars.scala : 615) net.liftweb.http.RequestVarHandler $ .apply (Vars.scala : 515) net .liftweb.http.provider.servlet.ServletFilterProvider $$ anonfun $ doFilter $ 1.apply (ServletFilterProvider.scala : 61) net.liftweb.http.provider.servlet.ServletFilterProvider $$ anonfun $ doFilter $ 1.apply (ServletFilterProvider.scala : 61) net.liftweb.http.CoreRequestVarHandler $$ anonfun $ 적용 $ 16 $$ anonfun $ 적용 $ 17 $$ anonfun $ 적용 $ 18 $$ anonfun $ 적용 $ 19.apply (Vars.scala : 619) net.liftweb.util.ThreadGlobal.doWith (ThreadGlobal.scala : 71) net.liftweb.http.CoreRequestVarHandler $$ anonfun $ 적용 $ 16 $$ anonfun $ 적용 $ 17 $$ anonfun $ 적용 $ 18.apply (Vars.scala : 618) net.liftweb.util.ThreadGlobal.doWith (ThreadGlobal.scala : 71) net.liftweb.http.CoreRequestVarHandler $$ anonfun $ apply $ 16 $$ anonfun $ apply $ 17.apply (Vars.scala : 617) net.liftweb. (ThreadGlobal.scala : 71) net.liftweb.http.CoreRequestVarHandler $$ anonfun $ apply $ 16.apply (Vars.scala : 616) net.liftweb.util.ThreadGlobal.doWith (ThreadGlobal.scala : 71) net.liftweb.http.CoreRequestVarHandler $ class.apply (Vars.scala : 615) net.liftweb.http.provider.servlet.ServletFilterProvider $ class.doFilter (ServletFilterProvider.scala : 60) net.li (LletServlet.scala : 757) org.eclipse.jetty.servlet.ServletHandler $ CachedChain.doFilter java : 486) org.eclipse.jetty.server.handler.ScopedHandler.handle (ScopedHandler.java:119) org.eclipse.jetty.security.SecurityHandler.handle (SecurityHandler.java:520) org.eclipse.jetty .server.session.Session.SessionHandler.doHandle (SessionHandler.java:233) org.eclipse.jetty.server.handler.ContextHandler. _doHandle (ContextHandler.java:973) org.eclipse.jetty.server.handler.ContextHandler.doHandle (ContextHandler.java) org.eclipse.jetty.servlet.ServletHandler.doScope (ServletHandler.java:417) 조직도. eclipse.jetty.server.session.SessionHandler.doScope (SessionHandler.java:192) org.eclipse.jetty.server.handler.ContextHandler.doScope (ContextHandler.java:907) org.eclipse.jetty.server.handler. ScopedHandler.handle (ScopedHandler.java:117) org.eclipse.jetty.server.handler.ContextHandlerCollection.handle (ContextHandlerCollection.java:250) org.eclipse.jetty.server.handler.HandlerWrapper.handle (HandlerWrapper.java : 110) org.eclipse.jetty.server.Server.handle (Server.java:346) org.eclip httpConnection.java : 442). HttpParser.java:801) org.eclipse.jetty.http.HttpParser.parseAvailable (HttpParser.java:224) org.eclipse.jetty.server.AsyncHttpConnection.handle (AsyncHttpConnection.java:51) org.eclipse.jetty org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle runJob (QueuedThreadPool.java:598) org.eclipse.jetty.util.thread.QueuedThreadPool $ 3.run (QueuedThreadPool.java:533) java.lang.Thread.run (Thread.java:680)

답변

2

나는 ProtoUser가 SquerylRecord와 지금은 작동하지 않을까 걱정됩니다.

+0

이 ProtoUser는 패키지 net.liftweb.record에 있습니다. 틀림 없습니까? thanks for last. 감사합니다. – sjbwylbs

+0

예, 확실합니다. Squeryl이 기본 키와 ProtoUser의 필드를 참조하는 방식과 비 호환성이 있습니다. beens는 해결 방법에 대해 이야기하지만 아직 구현 된 방법은 없습니다. –