[Lift] Re: QueryParams and joins
It compiles and works now! :) Thanks a lot for your help everyone On Jan 6, 1:29 pm, Mads Hartmann wrote: > @Indrajit Raychaudhuri, I've applied your changes > > On Jan 6, 1:22 pm, Mads Hartmann wrote: > > > > > And the boot file looks like this: > > > package bootstrap.liftweb > > > import _root_.net.liftweb.util._ > > import _root_.net.liftweb.http._ > > import _root_.net.liftweb.sitemap._ > > import _root_.net.liftweb.sitemap.Loc._ > > import Helpers._ > > import _root_.net.liftweb.mapper.{DB, ConnectionManager, Schemifier, > > DefaultConnectionIdentifier, ConnectionIdentifier} > > import _root_.java.sql.{Connection, DriverManager} > > import _root_.scalableKvidr.model._ > > import _root_.javax.servlet.http.{HttpServletRequest} > > import net.liftweb.common._ > > > /** > > * A class that's instantiated early and run. It allows the > > application > > * to modify lift's environment > > */ > > class Boot { > > def boot { > > if (!DB.jndiJdbcConnAvailable_?) > > DB.defineConnectionManager(DefaultConnectionIdentifier, > > DBVendor) > > > // where to search snippet > > LiftRules.addToPackages("scalableKvidr") > > Schemifier.schemify(true, Log.infoF _, User, Tag, Tweet, TagUser) > > > // Build SiteMap > > val entries = Menu(Loc("forside", List("index"), "Forside")) :: > > > > Menu(Loc("Alle_Kategorier", List("allcategories"), "Alle > > Kategorier")) :: > > > > Menu(Loc("Brugere", List("bruger"), "Brugere")) :: > > > > Menu(Loc("Tilmeld", List("tilmeld"), "Tilmeld")) :: > > > > Menu(Loc("Hvad Er Kvidr?", List("hvad_er_kvidr"), "Hvad Er > > Kvidr?")) :: > > > > Menu(Loc("kategori", List("category"), "Kategori", > > Hidden)) :: > > Nil > > LiftRules.setSiteMap(SiteMap(entries:_*)) > > > // Rewrite rules, rules! ;) > > LiftRules.rewrite.append { > > > case RewriteRequest( > > ParsePath(List("kategori",tag),_,_,_),_,_) => > > RewriteResponse("category" :: Nil, Map("tag" -> tag)) > > /*case RewriteRequest( > > ParsePath(List("kategori","alle"),_,_,_),_,_) => > > RewriteResponse("allcategories" :: Nil)*/ > > > } > > > /* > > * Show the spinny image when an Ajax call starts > > */ > > LiftRules.ajaxStart = > > Full(() => LiftRules.jsArtifacts.show("ajax-loader").cmd) > > > /* > > * Make the spinny image go away when it ends > > */ > > LiftRules.ajaxEnd = > > Full(() => LiftRules.jsArtifacts.hide("ajax-loader").cmd) > > > LiftRules.early.append(makeUtf8) > > > S.addAround(DB.buildLoanWrapper) > > } > > > /** > > * Force the request to be UTF-8 > > */ > > > private def makeUtf8(req: HttpServletRequest) { > > req.setCharacterEncoding("UTF-8") > > } > > > } > > > object DBVendor extends ConnectionManager { > > def newConnection(name : ConnectionIdentifier) = { > > try { > > Class.forName("com.mysql.jdbc.Driver") > > val dm = DriverManager.getConnection("jdbc:mysql://localhost:8889/ > > databaseinformationhere) > > Full(dm) > > } catch { > > case e : Exception => e.printStackTrace; Empty > > } > > } > > def releaseConnection(conn: Connection) {conn.close} > > > } > > > On Jan 6, 1:17 pm, Mads Hartmann wrote: > > > > Aha! It almost compiles now. There's just one last error: > > > > [INFO] Compiling 8 source files to /Users/Mads/Projects/scalableKvidr2/ > > > target/classes at 1262780161026 > > > [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ > > > liftweb/Boot.scala:61: error: type mismatch; > > > [INFO] found : (javax.servlet.http.HttpServletRequest) => Unit > > > [INFO] required: (net.liftweb.http.provider.HTTPRequest) => Any > > > [INFO] LiftRules.early.append(makeUtf8) > > > [INFO] ^ > > > [ERROR] one error found > > > > On Jan 6, 12:59 pm, Jeppe Nejsum Madsen wrote: > > > > > Mads Hartmann writes: > > > > > Again, I really appreciate you guys helping me out :) > > > > > > @Indrajit I just tried with the dependency you declared as the only > > > > > lift related dependency. I get the following error. > > > > > > > > > > > net.liftweb > > > > > lift-mapper > > > > > 1.1-M8 > > > > > > > > > > Note, Lift 1.1 is not source compatible with 1.0. You need to change > > > > your code (in a few places) Specifically, it seems you need to add > > > > > import net.liftweb.common._ > > > > > to Boot.scala > > > > > /Jeppe -- You received this message because you are subscribed to the Google Groups "Lift" group. To
[Lift] Re: QueryParams and joins
@Indrajit Raychaudhuri, I've applied your changes On Jan 6, 1:22 pm, Mads Hartmann wrote: > And the boot file looks like this: > > package bootstrap.liftweb > > import _root_.net.liftweb.util._ > import _root_.net.liftweb.http._ > import _root_.net.liftweb.sitemap._ > import _root_.net.liftweb.sitemap.Loc._ > import Helpers._ > import _root_.net.liftweb.mapper.{DB, ConnectionManager, Schemifier, > DefaultConnectionIdentifier, ConnectionIdentifier} > import _root_.java.sql.{Connection, DriverManager} > import _root_.scalableKvidr.model._ > import _root_.javax.servlet.http.{HttpServletRequest} > import net.liftweb.common._ > > /** > * A class that's instantiated early and run. It allows the > application > * to modify lift's environment > */ > class Boot { > def boot { > if (!DB.jndiJdbcConnAvailable_?) > DB.defineConnectionManager(DefaultConnectionIdentifier, > DBVendor) > > // where to search snippet > LiftRules.addToPackages("scalableKvidr") > Schemifier.schemify(true, Log.infoF _, User, Tag, Tweet, TagUser) > > // Build SiteMap > val entries = Menu(Loc("forside", List("index"), "Forside")) :: > > Menu(Loc("Alle_Kategorier", List("allcategories"), "Alle > Kategorier")) :: > > Menu(Loc("Brugere", List("bruger"), "Brugere")) :: > > Menu(Loc("Tilmeld", List("tilmeld"), "Tilmeld")) :: > > Menu(Loc("Hvad Er Kvidr?", List("hvad_er_kvidr"), "Hvad Er > Kvidr?")) :: > > Menu(Loc("kategori", List("category"), "Kategori", > Hidden)) :: > Nil > LiftRules.setSiteMap(SiteMap(entries:_*)) > > // Rewrite rules, rules! ;) > LiftRules.rewrite.append { > > case RewriteRequest( > ParsePath(List("kategori",tag),_,_,_),_,_) => > RewriteResponse("category" :: Nil, Map("tag" -> tag)) > /*case RewriteRequest( > ParsePath(List("kategori","alle"),_,_,_),_,_) => > RewriteResponse("allcategories" :: Nil)*/ > > } > > /* > * Show the spinny image when an Ajax call starts > */ > LiftRules.ajaxStart = > Full(() => LiftRules.jsArtifacts.show("ajax-loader").cmd) > > /* > * Make the spinny image go away when it ends > */ > LiftRules.ajaxEnd = > Full(() => LiftRules.jsArtifacts.hide("ajax-loader").cmd) > > LiftRules.early.append(makeUtf8) > > S.addAround(DB.buildLoanWrapper) > } > > /** > * Force the request to be UTF-8 > */ > > private def makeUtf8(req: HttpServletRequest) { > req.setCharacterEncoding("UTF-8") > } > > } > > object DBVendor extends ConnectionManager { > def newConnection(name : ConnectionIdentifier) = { > try { > Class.forName("com.mysql.jdbc.Driver") > val dm = DriverManager.getConnection("jdbc:mysql://localhost:8889/ > databaseinformationhere) > Full(dm) > } catch { > case e : Exception => e.printStackTrace; Empty > } > } > def releaseConnection(conn: Connection) {conn.close} > > } > > On Jan 6, 1:17 pm, Mads Hartmann wrote: > > > > > Aha! It almost compiles now. There's just one last error: > > > [INFO] Compiling 8 source files to /Users/Mads/Projects/scalableKvidr2/ > > target/classes at 1262780161026 > > [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ > > liftweb/Boot.scala:61: error: type mismatch; > > [INFO] found : (javax.servlet.http.HttpServletRequest) => Unit > > [INFO] required: (net.liftweb.http.provider.HTTPRequest) => Any > > [INFO] LiftRules.early.append(makeUtf8) > > [INFO] ^ > > [ERROR] one error found > > > On Jan 6, 12:59 pm, Jeppe Nejsum Madsen wrote: > > > > Mads Hartmann writes: > > > > Again, I really appreciate you guys helping me out :) > > > > > @Indrajit I just tried with the dependency you declared as the only > > > > lift related dependency. I get the following error. > > > > > > > > > net.liftweb > > > > lift-mapper > > > > 1.1-M8 > > > > > > > > Note, Lift 1.1 is not source compatible with 1.0. You need to change > > > your code (in a few places) Specifically, it seems you need to add > > > > import net.liftweb.common._ > > > > to Boot.scala > > > > /Jeppe -- 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.
Re: [Lift] Re: QueryParams and joins
Modify makeUtf8 like so: private def makeUtf8(req: HTTPRequest) { req.setCharacterEncoding("UTF-8") } Note the change in signature. - IRC On 06/01/10 5:47 PM, Mads Hartmann wrote: Aha! It almost compiles now. There's just one last error: [INFO] Compiling 8 source files to /Users/Mads/Projects/scalableKvidr2/ target/classes at 1262780161026 [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ liftweb/Boot.scala:61: error: type mismatch; [INFO] found : (javax.servlet.http.HttpServletRequest) => Unit [INFO] required: (net.liftweb.http.provider.HTTPRequest) => Any [INFO] LiftRules.early.append(makeUtf8) [INFO]^ [ERROR] one error found On Jan 6, 12:59 pm, Jeppe Nejsum Madsen wrote: Mads Hartmann writes: Again, I really appreciate you guys helping me out :) @Indrajit I just tried with the dependency you declared as the only lift related dependency. I get the following error. net.liftweb lift-mapper 1.1-M8 Note, Lift 1.1 is not source compatible with 1.0. You need to change your code (in a few places) Specifically, it seems you need to add import net.liftweb.common._ to Boot.scala /Jeppe -- 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.
[Lift] Re: QueryParams and joins
And the boot file looks like this: package bootstrap.liftweb import _root_.net.liftweb.util._ import _root_.net.liftweb.http._ import _root_.net.liftweb.sitemap._ import _root_.net.liftweb.sitemap.Loc._ import Helpers._ import _root_.net.liftweb.mapper.{DB, ConnectionManager, Schemifier, DefaultConnectionIdentifier, ConnectionIdentifier} import _root_.java.sql.{Connection, DriverManager} import _root_.scalableKvidr.model._ import _root_.javax.servlet.http.{HttpServletRequest} import net.liftweb.common._ /** * A class that's instantiated early and run. It allows the application * to modify lift's environment */ class Boot { def boot { if (!DB.jndiJdbcConnAvailable_?) DB.defineConnectionManager(DefaultConnectionIdentifier, DBVendor) // where to search snippet LiftRules.addToPackages("scalableKvidr") Schemifier.schemify(true, Log.infoF _, User, Tag, Tweet, TagUser) // Build SiteMap val entries = Menu(Loc("forside", List("index"), "Forside")) :: Menu(Loc("Alle_Kategorier", List("allcategories"), "Alle Kategorier")) :: Menu(Loc("Brugere", List("bruger"), "Brugere")) :: Menu(Loc("Tilmeld", List("tilmeld"), "Tilmeld")) :: Menu(Loc("Hvad Er Kvidr?", List("hvad_er_kvidr"), "Hvad Er Kvidr?")) :: Menu(Loc("kategori", List("category"), "Kategori", Hidden)) :: Nil LiftRules.setSiteMap(SiteMap(entries:_*)) // Rewrite rules, rules! ;) LiftRules.rewrite.append { case RewriteRequest( ParsePath(List("kategori",tag),_,_,_),_,_) => RewriteResponse("category" :: Nil, Map("tag" -> tag)) /*case RewriteRequest( ParsePath(List("kategori","alle"),_,_,_),_,_) => RewriteResponse("allcategories" :: Nil)*/ } /* * Show the spinny image when an Ajax call starts */ LiftRules.ajaxStart = Full(() => LiftRules.jsArtifacts.show("ajax-loader").cmd) /* * Make the spinny image go away when it ends */ LiftRules.ajaxEnd = Full(() => LiftRules.jsArtifacts.hide("ajax-loader").cmd) LiftRules.early.append(makeUtf8) S.addAround(DB.buildLoanWrapper) } /** * Force the request to be UTF-8 */ private def makeUtf8(req: HttpServletRequest) { req.setCharacterEncoding("UTF-8") } } object DBVendor extends ConnectionManager { def newConnection(name : ConnectionIdentifier) = { try { Class.forName("com.mysql.jdbc.Driver") val dm = DriverManager.getConnection("jdbc:mysql://localhost:8889/ databaseinformationhere) Full(dm) } catch { case e : Exception => e.printStackTrace; Empty } } def releaseConnection(conn: Connection) {conn.close} } On Jan 6, 1:17 pm, Mads Hartmann wrote: > Aha! It almost compiles now. There's just one last error: > > [INFO] Compiling 8 source files to /Users/Mads/Projects/scalableKvidr2/ > target/classes at 1262780161026 > [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ > liftweb/Boot.scala:61: error: type mismatch; > [INFO] found : (javax.servlet.http.HttpServletRequest) => Unit > [INFO] required: (net.liftweb.http.provider.HTTPRequest) => Any > [INFO] LiftRules.early.append(makeUtf8) > [INFO] ^ > [ERROR] one error found > > On Jan 6, 12:59 pm, Jeppe Nejsum Madsen wrote: > > > > > Mads Hartmann writes: > > > Again, I really appreciate you guys helping me out :) > > > > @Indrajit I just tried with the dependency you declared as the only > > > lift related dependency. I get the following error. > > > > > > > net.liftweb > > > lift-mapper > > > 1.1-M8 > > > > > > Note, Lift 1.1 is not source compatible with 1.0. You need to change > > your code (in a few places) Specifically, it seems you need to add > > > import net.liftweb.common._ > > > to Boot.scala > > > /Jeppe -- 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.
Re: [Lift] Re: QueryParams and joins
Ok, few points: 1. Full, Box etc. have a different package location now. Ensure "import net.liftweb.common._" wherever you have Full, Box etc. 2. scala.version should be 2.7.7 2.7.7 3. scala-library dependency is redundant. You can remove that. 4. This shouldn't affect your compilation either. jetty version range should be [6.1.6,7.0) [6.1.6,7.0) Cheers, Indrajit On 06/01/10 5:20 PM, Mads Hartmann wrote: Sure thing, here it is: http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http:// www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http:// maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";> 4.0.0 scalableKvidr scalableKvidr 1.0-SNAPSHOT war scalableKvidr 2007 2.7.3 scala-tools.org Scala-Tools Maven2 Repository http://scala-tools.org/repo-releases scala-tools.org Scala-Tools Maven2 Repository http://scala-tools.org/repo-releases org.scala-lang scala-library ${scala.version} net.liftweb lift-mapper 1.1-M8 org.apache.derby derby 10.4.2.0 mysql mysql-connector-java 5.0.8 javax.servlet servlet-api 2.5 provided junit junit 4.5 test org.mortbay.jetty jetty [6.1.6,) test org.scala-lang scala-compiler ${scala.version} test src/main/scala src/test/scala org.scala-tools maven-scala-plugin compile testCompile ${scala.version} org.mortbay.jetty maven-jetty-plugin / 5 8080 8080 net.sf.alchim yuicompressor-maven-plugin compress true org.apache.maven.plugins maven-eclipse-plugin true org.scala-lang:scala-library ch.epfl.lamp.sdt.launching.SCALA_CONTAINER ch.epfl.lamp.sdt.core.scalanature org.eclipse.jdt.core.javanature ch.epfl.lamp.sdt.core.scalabuilder org.scala-tools maven-scala-plugin ${scala.version} On Jan 6, 12:31 pm, Indrajit Raychaudhuri wrote: Mads, Can you please send me the pom.xml? Cheers, Indrajit On 06/01/10 4:50 PM, Mads Hartmann wrote: Again, I really appreciate you guys helping me out :) @Indrajit I just tried with the dependency you declared as the only lift related dependency. I get the following error. net.liftweb lift-mapper 1.1-M8 [INFO] Nothing to compile - all classes are up to date [INFO] [scala:compile {execution: default}] [INFO] Checking for multiple versions of scala [WARNING] Multiple versions of scala libraries detected! [INFO] includes = [**/*.scala,**/*.java,] [INFO] excludes = [] [INFO] /Users/Mads/Projects/scalableKvidr2/src/main/scala:-1: info: compiling [INFO] Compiling 8 source files to /Users/Mads/Projects/scalableKvidr2/ target/classes at 1262776620713 [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ liftweb/Boot.scala:52: error: not found: value Full [INFO] Full(() =>LiftRules.jsArtifacts.show("ajax-loader").cmd) [INFO] ^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ liftweb/Boot.scala:58: error: not found: value Full [INFO] Full(() =>LiftRules.jsArtifacts.hide("ajax-loader").cmd) [INFO] ^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ liftweb/Boot.scala:60: error: type mismatch; [INFO] found : (javax.servlet.http.HttpServletRequest) =>Unit [INFO] required: (net.liftweb.http.provider.HTTPRequest) =>Any [INFO] LiftRules.early.append(makeUtf8) [INFO]^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ liftweb/Boot.scala:79: error: not found: value Full [INFO] Full(dm) [INFO] ^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ liftweb/Boot.scala:81: error: not found: value Empty [INFO] case e : Exception =>e.printStackTrace; Empty [INFO] ^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/ scalableKvidr/snippet/TagsSnippets.scala:28: error: not found: value Full [INFO] case Full(param) =>
[Lift] Re: QueryParams and joins
Aha! It almost compiles now. There's just one last error: [INFO] Compiling 8 source files to /Users/Mads/Projects/scalableKvidr2/ target/classes at 1262780161026 [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ liftweb/Boot.scala:61: error: type mismatch; [INFO] found : (javax.servlet.http.HttpServletRequest) => Unit [INFO] required: (net.liftweb.http.provider.HTTPRequest) => Any [INFO] LiftRules.early.append(makeUtf8) [INFO]^ [ERROR] one error found On Jan 6, 12:59 pm, Jeppe Nejsum Madsen wrote: > Mads Hartmann writes: > > Again, I really appreciate you guys helping me out :) > > > @Indrajit I just tried with the dependency you declared as the only > > lift related dependency. I get the following error. > > > > > net.liftweb > > lift-mapper > > 1.1-M8 > > > > Note, Lift 1.1 is not source compatible with 1.0. You need to change > your code (in a few places) Specifically, it seems you need to add > > import net.liftweb.common._ > > to Boot.scala > > /Jeppe -- 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.
Re: [Lift] Re: QueryParams and joins
Mads Hartmann writes: > Again, I really appreciate you guys helping me out :) > > @Indrajit I just tried with the dependency you declared as the only > lift related dependency. I get the following error. > > > net.liftweb > lift-mapper > 1.1-M8 > Note, Lift 1.1 is not source compatible with 1.0. You need to change your code (in a few places) Specifically, it seems you need to add import net.liftweb.common._ to Boot.scala /Jeppe -- 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.
[Lift] Re: QueryParams and joins
Sure thing, here it is: http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http:// www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http:// maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";> 4.0.0 scalableKvidr scalableKvidr 1.0-SNAPSHOT war scalableKvidr 2007 2.7.3 scala-tools.org Scala-Tools Maven2 Repository http://scala-tools.org/repo-releases scala-tools.org Scala-Tools Maven2 Repository http://scala-tools.org/repo-releases org.scala-lang scala-library ${scala.version} net.liftweb lift-mapper 1.1-M8 org.apache.derby derby 10.4.2.0 mysql mysql-connector-java 5.0.8 javax.servlet servlet-api 2.5 provided junit junit 4.5 test org.mortbay.jetty jetty [6.1.6,) test org.scala-lang scala-compiler ${scala.version} test src/main/scala src/test/scala org.scala-tools maven-scala-plugin compile testCompile ${scala.version} org.mortbay.jetty maven-jetty-plugin / 5 8080 8080 net.sf.alchim yuicompressor-maven-plugin compress true org.apache.maven.plugins maven-eclipse-plugin true org.scala-lang:scala-library ch.epfl.lamp.sdt.launching.SCALA_CONTAINER ch.epfl.lamp.sdt.core.scalanature org.eclipse.jdt.core.javanature ch.epfl.lamp.sdt.core.scalabuilder org.scala-tools maven-scala-plugin ${scala.version} On Jan 6, 12:31 pm, Indrajit Raychaudhuri wrote: > Mads, > Can you please send me the pom.xml? > > Cheers, Indrajit > > On 06/01/10 4:50 PM, Mads Hartmann wrote: > > > > > Again, I really appreciate you guys helping me out :) > > > @Indrajit I just tried with the dependency you declared as the only > > lift related dependency. I get the following error. > > > > > net.liftweb > > lift-mapper > > 1.1-M8 > > > > > [INFO] Nothing to compile - all classes are up to date > > [INFO] [scala:compile {execution: default}] > > [INFO] Checking for multiple versions of scala > > [WARNING] Multiple versions of scala libraries detected! > > [INFO] includes = [**/*.scala,**/*.java,] > > [INFO] excludes = [] > > [INFO] /Users/Mads/Projects/scalableKvidr2/src/main/scala:-1: info: > > compiling > > > [INFO] Compiling 8 source files to /Users/Mads/Projects/scalableKvidr2/ > > target/classes at 1262776620713 > > [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ > > liftweb/Boot.scala:52: error: not found: value Full > > [INFO] Full(() => LiftRules.jsArtifacts.show("ajax-loader").cmd) > > [INFO] ^ > > [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ > > liftweb/Boot.scala:58: error: not found: value Full > > [INFO] Full(() => LiftRules.jsArtifacts.hide("ajax-loader").cmd) > > [INFO] ^ > > [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ > > liftweb/Boot.scala:60: error: type mismatch; > > [INFO] found : (javax.servlet.http.HttpServletRequest) => Unit > > [INFO] required: (net.liftweb.http.provider.HTTPRequest) => Any > > [INFO] LiftRules.early.append(makeUtf8) > > [INFO] ^ > > [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ > > liftweb/Boot.scala:79: error: not found: value Full > > [INFO] Full(dm) > > [INFO] ^ > > [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ > > liftweb/Boot.scala:81: error: not found: value Empty > > [INFO] case e : Exception => e.printStackTrace; Empty > > [INFO] ^ > > [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/ > > scalableKvidr/snippet/TagsSnippets.scala:28: error: not found: value > > Full > > [INFO] case Full(param) => param > > [INFO] ^ > > [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/ > > scalableKvidr/snippet/TagsSnippets.scala:28: error: missing arguments > > for method param in object S; > > [INFO] follow this method with `_' if you want to treat it as a > > partially applied function > > [INFO] case Full(param) => param > > [INFO] ^ >
Re: [Lift] Re: QueryParams and joins
Mads, Can you please send me the pom.xml? Cheers, Indrajit On 06/01/10 4:50 PM, Mads Hartmann wrote: Again, I really appreciate you guys helping me out :) @Indrajit I just tried with the dependency you declared as the only lift related dependency. I get the following error. net.liftweb lift-mapper 1.1-M8 [INFO] Nothing to compile - all classes are up to date [INFO] [scala:compile {execution: default}] [INFO] Checking for multiple versions of scala [WARNING] Multiple versions of scala libraries detected! [INFO] includes = [**/*.scala,**/*.java,] [INFO] excludes = [] [INFO] /Users/Mads/Projects/scalableKvidr2/src/main/scala:-1: info: compiling [INFO] Compiling 8 source files to /Users/Mads/Projects/scalableKvidr2/ target/classes at 1262776620713 [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ liftweb/Boot.scala:52: error: not found: value Full [INFO] Full(() => LiftRules.jsArtifacts.show("ajax-loader").cmd) [INFO] ^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ liftweb/Boot.scala:58: error: not found: value Full [INFO] Full(() => LiftRules.jsArtifacts.hide("ajax-loader").cmd) [INFO] ^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ liftweb/Boot.scala:60: error: type mismatch; [INFO] found : (javax.servlet.http.HttpServletRequest) => Unit [INFO] required: (net.liftweb.http.provider.HTTPRequest) => Any [INFO] LiftRules.early.append(makeUtf8) [INFO]^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ liftweb/Boot.scala:79: error: not found: value Full [INFO] Full(dm) [INFO] ^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ liftweb/Boot.scala:81: error: not found: value Empty [INFO] case e : Exception => e.printStackTrace; Empty [INFO] ^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/ scalableKvidr/snippet/TagsSnippets.scala:28: error: not found: value Full [INFO] case Full(param) => param [INFO]^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/ scalableKvidr/snippet/TagsSnippets.scala:28: error: missing arguments for method param in object S; [INFO] follow this method with `_' if you want to treat it as a partially applied function [INFO] case Full(param) => param [INFO] ^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/ scalableKvidr/snippet/TagsSnippets.scala:29: error: not found: value Empty [ERROR] case Empty => "error" [INFO]^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/ scalableKvidr/snippet/TagsSnippets.scala:30: error: not found: value Failure [ERROR] case Failure(msg, _, _) => "error" [INFO]^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/ scalableKvidr/snippet/TagsSnippets.scala:41: error: not found: value Full [INFO] case Full(xhtml) => xhtml [INFO]^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/ scalableKvidr/snippet/TagsSnippets.scala:41: error: not found: value xhtml [INFO] case Full(xhtml) => xhtml [INFO] ^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/ scalableKvidr/snippet/TagsSnippets.scala:42: error: not found: value Empty [ERROR] case Empty => Error [INFO]^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/ scalableKvidr/snippet/TagsSnippets.scala:43: error: not found: value Failure [ERROR] case Failure(msg, _, _) => Error [INFO]^ [ERROR] 13 errors found [INFO] [ERROR] BUILD ERROR [INFO] [INFO] wrap: org.apache.commons.exec.ExecuteException: Process exited with an error: 1(Exit value: 1) On Jan 6, 10:15 am, Indrajit Raychaudhuri wrote: Mads, Since you are using mapper, having dependency on lift-mapper should suffice. Other dependencies would be pulled in transitively. So having this dependency tag should do. net.liftweb lift-mapper 1.1-M8 Cheers, Indrajit On 06/01/10 2:39 PM, Mads Hartmann wrote: How would that dependency tag look? Right now it looks like this: net.liftweb lift-core 1.1-M8 On Jan 6, 10:06 am, Timothy Perrettwrote: Remove the lift-core dependency and separately specify lift-webkit, lift-common and lift-util. That should resolve your issue... its probally a problem with the transitive dependencies in maven. Cheers, Tim On 5 Jan 2010, at 22:17, Ross Mellgren wrote: It looks like you probably have some other dependencies somewhere or old jars pointing to the old lift version. Please first try mvn clean jetty:run, and if that doesn't work, run mvn dependency:tree to try and find where the other version of lift-webkit is coming from.
[Lift] Re: QueryParams and joins
Again, I really appreciate you guys helping me out :) @Indrajit I just tried with the dependency you declared as the only lift related dependency. I get the following error. net.liftweb lift-mapper 1.1-M8 [INFO] Nothing to compile - all classes are up to date [INFO] [scala:compile {execution: default}] [INFO] Checking for multiple versions of scala [WARNING] Multiple versions of scala libraries detected! [INFO] includes = [**/*.scala,**/*.java,] [INFO] excludes = [] [INFO] /Users/Mads/Projects/scalableKvidr2/src/main/scala:-1: info: compiling [INFO] Compiling 8 source files to /Users/Mads/Projects/scalableKvidr2/ target/classes at 1262776620713 [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ liftweb/Boot.scala:52: error: not found: value Full [INFO] Full(() => LiftRules.jsArtifacts.show("ajax-loader").cmd) [INFO] ^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ liftweb/Boot.scala:58: error: not found: value Full [INFO] Full(() => LiftRules.jsArtifacts.hide("ajax-loader").cmd) [INFO] ^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ liftweb/Boot.scala:60: error: type mismatch; [INFO] found : (javax.servlet.http.HttpServletRequest) => Unit [INFO] required: (net.liftweb.http.provider.HTTPRequest) => Any [INFO] LiftRules.early.append(makeUtf8) [INFO]^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ liftweb/Boot.scala:79: error: not found: value Full [INFO] Full(dm) [INFO] ^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/bootstrap/ liftweb/Boot.scala:81: error: not found: value Empty [INFO] case e : Exception => e.printStackTrace; Empty [INFO] ^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/ scalableKvidr/snippet/TagsSnippets.scala:28: error: not found: value Full [INFO] case Full(param) => param [INFO]^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/ scalableKvidr/snippet/TagsSnippets.scala:28: error: missing arguments for method param in object S; [INFO] follow this method with `_' if you want to treat it as a partially applied function [INFO] case Full(param) => param [INFO] ^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/ scalableKvidr/snippet/TagsSnippets.scala:29: error: not found: value Empty [ERROR] case Empty => "error" [INFO]^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/ scalableKvidr/snippet/TagsSnippets.scala:30: error: not found: value Failure [ERROR] case Failure(msg, _, _) => "error" [INFO]^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/ scalableKvidr/snippet/TagsSnippets.scala:41: error: not found: value Full [INFO] case Full(xhtml) => xhtml [INFO]^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/ scalableKvidr/snippet/TagsSnippets.scala:41: error: not found: value xhtml [INFO] case Full(xhtml) => xhtml [INFO] ^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/ scalableKvidr/snippet/TagsSnippets.scala:42: error: not found: value Empty [ERROR] case Empty => Error [INFO]^ [ERROR] /Users/Mads/Projects/scalableKvidr2/src/main/scala/ scalableKvidr/snippet/TagsSnippets.scala:43: error: not found: value Failure [ERROR] case Failure(msg, _, _) => Error [INFO]^ [ERROR] 13 errors found [INFO] [ERROR] BUILD ERROR [INFO] [INFO] wrap: org.apache.commons.exec.ExecuteException: Process exited with an error: 1(Exit value: 1) On Jan 6, 10:15 am, Indrajit Raychaudhuri wrote: > Mads, > > Since you are using mapper, having dependency on lift-mapper should > suffice. Other dependencies would be pulled in transitively. > > So having this dependency tag should do. > > > net.liftweb > lift-mapper > 1.1-M8 > > > Cheers, Indrajit > > On 06/01/10 2:39 PM, Mads Hartmann wrote: > > > > > How would that dependency tag look? Right now it looks like this: > > > > > net.liftweb > > lift-core > > 1.1-M8 > > > > > On Jan 6, 10:06 am, Timothy Perrett wrote: > >> Remove the lift-core dependency and separately specify lift-webkit, > >> lift-common and lift-util. That should resolve your issue... its probally > >> a problem with the transitive dependencies in maven. > > >> Cheers, Tim > > >> On 5 Jan 2010, at 22:17, Ross Mellgren wrote: > > >>> It looks like you probably have some other dependencies somewhere or old > >>> jars pointing to the old lift version. > > >>> Please first try mvn clean jetty:run, and if that doesn't work, run mvn > >>> dependency:tree to try and find where the other version of lift-webkit is > >>> coming from. If you're still stuck, pa
Re: [Lift] Re: QueryParams and joins
Mads, Since you are using mapper, having dependency on lift-mapper should suffice. Other dependencies would be pulled in transitively. So having this dependency tag should do. net.liftweb lift-mapper 1.1-M8 Cheers, Indrajit On 06/01/10 2:39 PM, Mads Hartmann wrote: How would that dependency tag look? Right now it looks like this: net.liftweb lift-core 1.1-M8 On Jan 6, 10:06 am, Timothy Perrett wrote: Remove the lift-core dependency and separately specify lift-webkit, lift-common and lift-util. That should resolve your issue... its probally a problem with the transitive dependencies in maven. Cheers, Tim On 5 Jan 2010, at 22:17, Ross Mellgren wrote: It looks like you probably have some other dependencies somewhere or old jars pointing to the old lift version. Please first try mvn clean jetty:run, and if that doesn't work, run mvn dependency:tree to try and find where the other version of lift-webkit is coming from. If you're still stuck, paste the output of dependency:tree please! -Ross On Jan 5, 2010, at 4:06 PM, Mads Hartmann wrote: I really appreciate you taking the time to help me out. depedency now is: net.liftweb lift-core 1.1-M8 It compiles just fine, but when i try to start the server i get the following error: ERROR - Failed to Boot java.lang.NoClassDefFoundError: net/liftweb/util/Box at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at net.liftweb.http.DefaultBootstrap$.boot(LiftRules.scala:1260) at net.liftweb.http.provider.HTTPProvider$class.bootLift (HTTPProvider.scala:70) at net.liftweb.http.LiftFilter.bootLift(LiftServlet.scala:523) at net.liftweb.http.provider.servlet.ServletFilterProvider$class.init (ServletFilterProvider.scala:20) at net.liftweb.http.LiftFilter.init(LiftServlet.scala:523) at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java: 97) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:50) at org.mortbay.jetty.servlet.ServletHandler.initialize (ServletHandler.java:662) at org.mortbay.jetty.servlet.Context.startContext(Context.java:140) at org.mortbay.jetty.webapp.WebAppContext.startContext (WebAppContext.java:1250) at org.mortbay.jetty.handler.ContextHandler.doStart (ContextHandler.java:517) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java: 467) at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart (Jetty6PluginWebAppContext.java:115) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerCollection.doStart (HandlerCollection.java:152) at org.mortbay.jetty.handler.ContextHandlerCollection.doStart (ContextHandlerCollection.java:156) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerCollection.doStart (HandlerCollection.java:152) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerWrapper.doStart (HandlerWrapper.java:130) at org.mortbay.jetty.Server.doStart(Server.java:224) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:50) at org.mortbay.jetty.plugin.Jetty6PluginServer.start (Jetty6PluginServer.java:132) at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty (AbstractJettyMojo.java:441) at org.mortbay.jetty.plugin.AbstractJettyMojo.execute (AbstractJettyMojo.java:383) at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute (AbstractJettyRunMojo.java:210) at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java: 184) at org.apache.maven.plugin.DefaultPluginManager.executeMojo (DefaultPluginManager.java:490) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:694) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal (DefaultLifecycleExecutor.java:569) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal (DefaultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFai lures (DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments (DefaultLifecycleExecutor.java:348) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (DefaultLifecycleExecutor.java:180) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at org.apache.maven.cli.compat.CompatibleMain.main (CompatibleMain.java:60) at sun.reflect.NativeMethodAccessorI
[Lift] Re: QueryParams and joins
How would that dependency tag look? Right now it looks like this: net.liftweb lift-core 1.1-M8 On Jan 6, 10:06 am, Timothy Perrett wrote: > Remove the lift-core dependency and separately specify lift-webkit, > lift-common and lift-util. That should resolve your issue... its probally a > problem with the transitive dependencies in maven. > > Cheers, Tim > > On 5 Jan 2010, at 22:17, Ross Mellgren wrote: > > > > > It looks like you probably have some other dependencies somewhere or old > > jars pointing to the old lift version. > > > Please first try mvn clean jetty:run, and if that doesn't work, run mvn > > dependency:tree to try and find where the other version of lift-webkit is > > coming from. If you're still stuck, paste the output of dependency:tree > > please! > > > -Ross > > > On Jan 5, 2010, at 4:06 PM, Mads Hartmann wrote: > > >> I really appreciate you taking the time to help me out. > > >> depedency now is: > >> > >> net.liftweb > >> lift-core > >> 1.1-M8 > >> > > >> It compiles just fine, but when i try to start the server i get the > >> following error: > > >> ERROR - Failed to Boot > >> java.lang.NoClassDefFoundError: net/liftweb/util/Box > >> at java.lang.Class.forName0(Native Method) > >> at java.lang.Class.forName(Class.java:169) > >> at net.liftweb.http.DefaultBootstrap$.boot(LiftRules.scala:1260) > >> at net.liftweb.http.provider.HTTPProvider$class.bootLift > >> (HTTPProvider.scala:70) > >> at net.liftweb.http.LiftFilter.bootLift(LiftServlet.scala:523) > >> at > >> net.liftweb.http.provider.servlet.ServletFilterProvider$class.init > >> (ServletFilterProvider.scala:20) > >> at net.liftweb.http.LiftFilter.init(LiftServlet.scala:523) > >> at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java: > >> 97) > >> at org.mortbay.component.AbstractLifeCycle.start > >> (AbstractLifeCycle.java:50) > >> at org.mortbay.jetty.servlet.ServletHandler.initialize > >> (ServletHandler.java:662) > >> at org.mortbay.jetty.servlet.Context.startContext(Context.java:140) > >> at org.mortbay.jetty.webapp.WebAppContext.startContext > >> (WebAppContext.java:1250) > >> at org.mortbay.jetty.handler.ContextHandler.doStart > >> (ContextHandler.java:517) > >> at > >> org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java: > >> 467) > >> at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart > >> (Jetty6PluginWebAppContext.java:115) > >> at org.mortbay.component.AbstractLifeCycle.start > >> (AbstractLifeCycle.java:50) > >> at org.mortbay.jetty.handler.HandlerCollection.doStart > >> (HandlerCollection.java:152) > >> at org.mortbay.jetty.handler.ContextHandlerCollection.doStart > >> (ContextHandlerCollection.java:156) > >> at org.mortbay.component.AbstractLifeCycle.start > >> (AbstractLifeCycle.java:50) > >> at org.mortbay.jetty.handler.HandlerCollection.doStart > >> (HandlerCollection.java:152) > >> at org.mortbay.component.AbstractLifeCycle.start > >> (AbstractLifeCycle.java:50) > >> at org.mortbay.jetty.handler.HandlerWrapper.doStart > >> (HandlerWrapper.java:130) > >> at org.mortbay.jetty.Server.doStart(Server.java:224) > >> at org.mortbay.component.AbstractLifeCycle.start > >> (AbstractLifeCycle.java:50) > >> at org.mortbay.jetty.plugin.Jetty6PluginServer.start > >> (Jetty6PluginServer.java:132) > >> at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty > >> (AbstractJettyMojo.java:441) > >> at org.mortbay.jetty.plugin.AbstractJettyMojo.execute > >> (AbstractJettyMojo.java:383) > >> at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute > >> (AbstractJettyRunMojo.java:210) > >> at > >> org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java: > >> 184) > >> at org.apache.maven.plugin.DefaultPluginManager.executeMojo > >> (DefaultPluginManager.java:490) > >> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals > >> (DefaultLifecycleExecutor.java:694) > >> at > >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal > >> (DefaultLifecycleExecutor.java:569) > >> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal > >> (DefaultLifecycleExecutor.java:539) > >> at > >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFai > >> lures > >> (DefaultLifecycleExecutor.java:387) > >> at > >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments > >> (DefaultLifecycleExecutor.java:348) > >> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute > >> (DefaultLifecycleExecutor.java:180) > >> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) > >> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) > >> at org.apache.maven.cli.MavenCli.main(MavenC
Re: [Lift] Re: QueryParams and joins
Remove the lift-core dependency and separately specify lift-webkit, lift-common and lift-util. That should resolve your issue... its probally a problem with the transitive dependencies in maven. Cheers, Tim On 5 Jan 2010, at 22:17, Ross Mellgren wrote: > It looks like you probably have some other dependencies somewhere or old jars > pointing to the old lift version. > > Please first try mvn clean jetty:run, and if that doesn't work, run mvn > dependency:tree to try and find where the other version of lift-webkit is > coming from. If you're still stuck, paste the output of dependency:tree > please! > > -Ross > > On Jan 5, 2010, at 4:06 PM, Mads Hartmann wrote: > >> I really appreciate you taking the time to help me out. >> >> depedency now is: >> >> net.liftweb >> lift-core >> 1.1-M8 >> >> >> It compiles just fine, but when i try to start the server i get the >> following error: >> >> ERROR - Failed to Boot >> java.lang.NoClassDefFoundError: net/liftweb/util/Box >> at java.lang.Class.forName0(Native Method) >> at java.lang.Class.forName(Class.java:169) >> at net.liftweb.http.DefaultBootstrap$.boot(LiftRules.scala:1260) >> at net.liftweb.http.provider.HTTPProvider$class.bootLift >> (HTTPProvider.scala:70) >> at net.liftweb.http.LiftFilter.bootLift(LiftServlet.scala:523) >> at net.liftweb.http.provider.servlet.ServletFilterProvider$class.init >> (ServletFilterProvider.scala:20) >> at net.liftweb.http.LiftFilter.init(LiftServlet.scala:523) >> at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java: >> 97) >> at org.mortbay.component.AbstractLifeCycle.start >> (AbstractLifeCycle.java:50) >> at org.mortbay.jetty.servlet.ServletHandler.initialize >> (ServletHandler.java:662) >> at org.mortbay.jetty.servlet.Context.startContext(Context.java:140) >> at org.mortbay.jetty.webapp.WebAppContext.startContext >> (WebAppContext.java:1250) >> at org.mortbay.jetty.handler.ContextHandler.doStart >> (ContextHandler.java:517) >> at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java: >> 467) >> at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart >> (Jetty6PluginWebAppContext.java:115) >> at org.mortbay.component.AbstractLifeCycle.start >> (AbstractLifeCycle.java:50) >> at org.mortbay.jetty.handler.HandlerCollection.doStart >> (HandlerCollection.java:152) >> at org.mortbay.jetty.handler.ContextHandlerCollection.doStart >> (ContextHandlerCollection.java:156) >> at org.mortbay.component.AbstractLifeCycle.start >> (AbstractLifeCycle.java:50) >> at org.mortbay.jetty.handler.HandlerCollection.doStart >> (HandlerCollection.java:152) >> at org.mortbay.component.AbstractLifeCycle.start >> (AbstractLifeCycle.java:50) >> at org.mortbay.jetty.handler.HandlerWrapper.doStart >> (HandlerWrapper.java:130) >> at org.mortbay.jetty.Server.doStart(Server.java:224) >> at org.mortbay.component.AbstractLifeCycle.start >> (AbstractLifeCycle.java:50) >> at org.mortbay.jetty.plugin.Jetty6PluginServer.start >> (Jetty6PluginServer.java:132) >> at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty >> (AbstractJettyMojo.java:441) >> at org.mortbay.jetty.plugin.AbstractJettyMojo.execute >> (AbstractJettyMojo.java:383) >> at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute >> (AbstractJettyRunMojo.java:210) >> at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java: >> 184) >> at org.apache.maven.plugin.DefaultPluginManager.executeMojo >> (DefaultPluginManager.java:490) >> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals >> (DefaultLifecycleExecutor.java:694) >> at >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal >> (DefaultLifecycleExecutor.java:569) >> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal >> (DefaultLifecycleExecutor.java:539) >> at >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures >> (DefaultLifecycleExecutor.java:387) >> at >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments >> (DefaultLifecycleExecutor.java:348) >> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute >> (DefaultLifecycleExecutor.java:180) >> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) >> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) >> at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) >> at org.apache.maven.cli.compat.CompatibleMain.main >> (CompatibleMain.java:60) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at sun.reflect.NativeMethodAccessorImpl.invoke >> (NativeMethodAccessorImpl.java:39) >> at sun.reflect.DelegatingMethodAccessorImpl.invoke >> (DelegatingMethodAccessorImpl.java:25) >> at java.lang.reflect.Method.invoke(Method.java:597) >> at org.codehaus.class
Re: [Lift] Re: QueryParams and joins
It looks like you probably have some other dependencies somewhere or old jars pointing to the old lift version. Please first try mvn clean jetty:run, and if that doesn't work, run mvn dependency:tree to try and find where the other version of lift- webkit is coming from. If you're still stuck, paste the output of dependency:tree please! -Ross On Jan 5, 2010, at 4:06 PM, Mads Hartmann wrote: I really appreciate you taking the time to help me out. depedency now is: net.liftweb lift-core 1.1-M8 It compiles just fine, but when i try to start the server i get the following error: ERROR - Failed to Boot java.lang.NoClassDefFoundError: net/liftweb/util/Box at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at net.liftweb.http.DefaultBootstrap$.boot(LiftRules.scala:1260) at net.liftweb.http.provider.HTTPProvider$class.bootLift (HTTPProvider.scala:70) at net.liftweb.http.LiftFilter.bootLift(LiftServlet.scala:523) at net.liftweb.http.provider.servlet.ServletFilterProvider$class.init (ServletFilterProvider.scala:20) at net.liftweb.http.LiftFilter.init(LiftServlet.scala:523) at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java: 97) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:50) at org.mortbay.jetty.servlet.ServletHandler.initialize (ServletHandler.java:662) at org.mortbay.jetty.servlet.Context.startContext(Context.java:140) at org.mortbay.jetty.webapp.WebAppContext.startContext (WebAppContext.java:1250) at org.mortbay.jetty.handler.ContextHandler.doStart (ContextHandler.java:517) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java: 467) at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart (Jetty6PluginWebAppContext.java:115) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerCollection.doStart (HandlerCollection.java:152) at org.mortbay.jetty.handler.ContextHandlerCollection.doStart (ContextHandlerCollection.java:156) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerCollection.doStart (HandlerCollection.java:152) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerWrapper.doStart (HandlerWrapper.java:130) at org.mortbay.jetty.Server.doStart(Server.java:224) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:50) at org.mortbay.jetty.plugin.Jetty6PluginServer.start (Jetty6PluginServer.java:132) at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty (AbstractJettyMojo.java:441) at org.mortbay.jetty.plugin.AbstractJettyMojo.execute (AbstractJettyMojo.java:383) at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute (AbstractJettyRunMojo.java:210) at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java: 184) at org.apache.maven.plugin.DefaultPluginManager.executeMojo (DefaultPluginManager.java:490) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:694) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal (DefaultLifecycleExecutor.java:569) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal (DefaultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures (DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments (DefaultLifecycleExecutor.java:348) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (DefaultLifecycleExecutor.java:180) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at org.apache.maven.cli.compat.CompatibleMain.main (CompatibleMain.java:60) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java: 315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java: 430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: java.lang.ClassNotFoundException: net.liftweb.util.Box at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at ja
Re: [Lift] Re: QueryParams and joins
Box etc. wa moved to new.liftweb.common. - Mads Hartmann wrote: I really appreciate you taking the time to help me out. depedency now is: net.liftweb lift-core 1.1-M8 It compiles just fine, but when i try to start the server i get the following error: ERROR - Failed to Boot java.lang.NoClassDefFoundError: net/liftweb/util/Box at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at net.liftweb.http.DefaultBootstrap$.boot(LiftRules.scala:1260) at net.liftweb.http.provider.HTTPProvider$class.bootLift (HTTPProvider.scala:70) at net.liftweb.http.LiftFilter.bootLift(LiftServlet.scala:523) at net.liftweb.http.provider.servlet.ServletFilterProvider$class.init (ServletFilterProvider.scala:20) at net.liftweb.http.LiftFilter.init(LiftServlet.scala:523) at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java: 97) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:50) at org.mortbay.jetty.servlet.ServletHandler.initialize (ServletHandler.java:662) at org.mortbay.jetty.servlet.Context.startContext(Context.java:140) at org.mortbay.jetty.webapp.WebAppContext.startContext (WebAppContext.java:1250) at org.mortbay.jetty.handler.ContextHandler.doStart (ContextHandler.java:517) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java: 467) at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart (Jetty6PluginWebAppContext.java:115) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerCollection.doStart (HandlerCollection.java:152) at org.mortbay.jetty.handler.ContextHandlerCollection.doStart (ContextHandlerCollection.java:156) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerCollection.doStart (HandlerCollection.java:152) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerWrapper.doStart (HandlerWrapper.java:130) at org.mortbay.jetty.Server.doStart(Server.java:224) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:50) at org.mortbay.jetty.plugin.Jetty6PluginServer.start (Jetty6PluginServer.java:132) at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty (AbstractJettyMojo.java:441) at org.mortbay.jetty.plugin.AbstractJettyMojo.execute (AbstractJettyMojo.java:383) at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute (AbstractJettyRunMojo.java:210) at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java: 184) at org.apache.maven.plugin.DefaultPluginManager.executeMojo (DefaultPluginManager.java:490) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:694) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal (DefaultLifecycleExecutor.java:569) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal (DefaultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures (DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments (DefaultLifecycleExecutor.java:348) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (DefaultLifecycleExecutor.java:180) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at org.apache.maven.cli.compat.CompatibleMain.main (CompatibleMain.java:60) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java: 315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java: 430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: java.lang.ClassNotFoundException: net.liftweb.util.Box at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:315) at org.codehaus.classworlds.RealmClassLoader.loadClassDirect (RealmClassLoader.java:195) at o
[Lift] Re: QueryParams and joins
I really appreciate you taking the time to help me out. depedency now is: net.liftweb lift-core 1.1-M8 It compiles just fine, but when i try to start the server i get the following error: ERROR - Failed to Boot java.lang.NoClassDefFoundError: net/liftweb/util/Box at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at net.liftweb.http.DefaultBootstrap$.boot(LiftRules.scala:1260) at net.liftweb.http.provider.HTTPProvider$class.bootLift (HTTPProvider.scala:70) at net.liftweb.http.LiftFilter.bootLift(LiftServlet.scala:523) at net.liftweb.http.provider.servlet.ServletFilterProvider$class.init (ServletFilterProvider.scala:20) at net.liftweb.http.LiftFilter.init(LiftServlet.scala:523) at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java: 97) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:50) at org.mortbay.jetty.servlet.ServletHandler.initialize (ServletHandler.java:662) at org.mortbay.jetty.servlet.Context.startContext(Context.java:140) at org.mortbay.jetty.webapp.WebAppContext.startContext (WebAppContext.java:1250) at org.mortbay.jetty.handler.ContextHandler.doStart (ContextHandler.java:517) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java: 467) at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart (Jetty6PluginWebAppContext.java:115) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerCollection.doStart (HandlerCollection.java:152) at org.mortbay.jetty.handler.ContextHandlerCollection.doStart (ContextHandlerCollection.java:156) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerCollection.doStart (HandlerCollection.java:152) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerWrapper.doStart (HandlerWrapper.java:130) at org.mortbay.jetty.Server.doStart(Server.java:224) at org.mortbay.component.AbstractLifeCycle.start (AbstractLifeCycle.java:50) at org.mortbay.jetty.plugin.Jetty6PluginServer.start (Jetty6PluginServer.java:132) at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty (AbstractJettyMojo.java:441) at org.mortbay.jetty.plugin.AbstractJettyMojo.execute (AbstractJettyMojo.java:383) at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute (AbstractJettyRunMojo.java:210) at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java: 184) at org.apache.maven.plugin.DefaultPluginManager.executeMojo (DefaultPluginManager.java:490) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:694) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal (DefaultLifecycleExecutor.java:569) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal (DefaultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures (DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments (DefaultLifecycleExecutor.java:348) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (DefaultLifecycleExecutor.java:180) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at org.apache.maven.cli.compat.CompatibleMain.main (CompatibleMain.java:60) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java: 315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java: 430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: java.lang.ClassNotFoundException: net.liftweb.util.Box at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:315) at org.codehaus.classworlds.RealmClassLoader.loadClassDirect (RealmClassLoader.java:195) at org.codehaus.classworlds.DefaultClassRealm.loadClass (DefaultClassRealm.java:255) at org.codeha
Re: [Lift] Re: QueryParams and joins
On Tue, Jan 5, 2010 at 12:10 PM, Mads Hartmann wrote: > I've got this in my pom.xml > > > net.liftweb > lift-core > 1.0 > > Ah hah! I'd strongly recommend you upgrade to Lift 1.1-M8. It's faster, more stable and better supported than 1.0. > > On Jan 5, 8:54 pm, David Pollak wrote: > > On Tue, Jan 5, 2010 at 11:51 AM, Mads Hartmann > wrote: > > > Sure thing, it's quite long though :) > > > > > Just one thing, i added the following for it to compile (I want to > > > return List[User] not List[TagUser] : .map(_.user.obj.open_!) > > > > > So in all it looks like this > > > > > def getTopUsers(in: Int) :List[User] = { > > > > >TagUser.findAll(By(TagUser.tag, this.id), In(TagUser.user, User.id, > > > OrderBy(User.followers_count, Descending), MaxRows[User](in))) > > > .map(_.user.obj.open_!) > > > > > } > > > > What version of Lift? > > > > > > > > > > > > > Exception occured while processing / > > > Message: java.lang.NullPointerException > > >net.liftweb.mapper.In$$anon$3.(MetaMapper.scala:1206) > > >net.liftweb.mapper.In$.apply(MetaMapper.scala:1200) > > >scalableKvidr.model.Tag.getTopUsers(Tag.scala:38) > > > > scalableKvidr.snippet.TagsSnippets$$anonfun$frontpageTags$1.apply > > > (TagsSnippets.scala:71) > > > > scalableKvidr.snippet.TagsSnippets$$anonfun$frontpageTags$1.apply > > > (TagsSnippets.scala:68) > > >scala.List.flatMap(List.scala:1125) > > > > scalableKvidr.snippet.TagsSnippets.frontpageTags(TagsSnippets.scala: > > > 67) > > >sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > >sun.reflect.NativeMethodAccessorImpl.invoke > > > (NativeMethodAccessorImpl.java:39) > > >sun.reflect.DelegatingMethodAccessorImpl.invoke > > > (DelegatingMethodAccessorImpl.java:25) > > >java.lang.reflect.Method.invoke(Method.java:597) > > > > > net.liftweb.util.ClassHelpers$$anonfun$net$liftweb$util$ClassHelpers$ > > > $_invokeMethod$2$$anonfun$apply$7.apply(ClassHelpers.scala:352) > > > > net.liftweb.util.ControlHelpers$class.tryo(ControlHelpers.scala:40) > > >net.liftweb.util.Helpers$.tryo(Helpers.scala:29) > > > > net.liftweb.util.ControlHelpers$class.tryo(ControlHelpers.scala:55) > > >net.liftweb.util.Helpers$.tryo(Helpers.scala:29) > > > > > net.liftweb.util.ClassHelpers$$anonfun$net$liftweb$util$ClassHelpers$ > > > $_invokeMethod$2.apply(ClassHelpers.scala:352) > > > > > net.liftweb.util.ClassHelpers$$anonfun$net$liftweb$util$ClassHelpers$ > > > $_invokeMethod$2.apply(ClassHelpers.scala:352) > > >scala.Iterator$$anon$14.next(Iterator.scala:267) > > >scala.Iterator$class.find(Iterator.scala:462) > > >scala.Iterator$$anon$14.find(Iterator.scala:265) > > >net.liftweb.util.ClassHelpers$class.net > $liftweb$util$ClassHelpers$ > > > $_invokeMethod(ClassHelpers.scala:353) > > > > net.liftweb.util.ClassHelpers$class.invokeMethod(ClassHelpers.scala: > > > 285) > > >net.liftweb.util.Helpers$.invokeMethod(Helpers.scala:29) > > > > net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33$$anonfun > > > $apply$36$$anonfun$apply$38.apply(LiftSession.scala:723) > > > > net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33$$anonfun > > > $apply$36$$anonfun$apply$38.apply(LiftSession.scala:705) > > >net.liftweb.util.EmptyBox.openOr(Box.scala:372) > > > > net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33$$anonfun > > > $apply$36.apply(LiftSession.scala:705) > > > > net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33$$anonfun > > > $apply$36.apply(LiftSession.scala:705) > > >net.liftweb.util.EmptyBox.openOr(Box.scala:372) > > >net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33.apply > > > (LiftSession.scala:704) > > >net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33.apply > > > (LiftSession.scala:704) > > >net.liftweb.http.S$.doSnippet(S.scala:725) > > > > > net.liftweb.http.LiftSession$$anonfun$17.apply(LiftSession.scala:702) > > > > > net.liftweb.http.LiftSession$$anonfun$17.apply(LiftSession.scala:701) > > >net.liftweb.util.Full.map(Box.scala:330) > > >net.liftweb.http.LiftSession.net$liftweb$http$LiftSession$ > > > $processSnippet(LiftSession.scala:701) > > >net.liftweb.http.LiftSession$$anonfun$_defaultLiftTagProcessing > > > $1.apply(LiftSession.scala:793) > > >net.liftweb.http.LiftSession$$anonfun$_defaultLiftTagProcessing > > > $1.apply(LiftSession.scala:777) > > >net.liftweb.util.NamedPF.apply(NamedPartialFunction.scala:30) > > >net.liftweb.util.NamedPF$.apply(NamedPartialFunction.scala:76) > > > > net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1$ > > > $anonfun$apply$49.apply(LiftSession.scala:808) > > > > net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1$ > > > $anonfun$apply$49.apply(LiftSession.scala:808) > > >net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala
[Lift] Re: QueryParams and joins
I've got this in my pom.xml net.liftweb lift-core 1.0 On Jan 5, 8:54 pm, David Pollak wrote: > On Tue, Jan 5, 2010 at 11:51 AM, Mads Hartmann wrote: > > Sure thing, it's quite long though :) > > > Just one thing, i added the following for it to compile (I want to > > return List[User] not List[TagUser] : .map(_.user.obj.open_!) > > > So in all it looks like this > > > def getTopUsers(in: Int) :List[User] = { > > > TagUser.findAll(By(TagUser.tag, this.id), In(TagUser.user, User.id, > > OrderBy(User.followers_count, Descending), MaxRows[User](in))) > > .map(_.user.obj.open_!) > > > } > > What version of Lift? > > > > > > > Exception occured while processing / > > Message: java.lang.NullPointerException > > net.liftweb.mapper.In$$anon$3.(MetaMapper.scala:1206) > > net.liftweb.mapper.In$.apply(MetaMapper.scala:1200) > > scalableKvidr.model.Tag.getTopUsers(Tag.scala:38) > > scalableKvidr.snippet.TagsSnippets$$anonfun$frontpageTags$1.apply > > (TagsSnippets.scala:71) > > scalableKvidr.snippet.TagsSnippets$$anonfun$frontpageTags$1.apply > > (TagsSnippets.scala:68) > > scala.List.flatMap(List.scala:1125) > > scalableKvidr.snippet.TagsSnippets.frontpageTags(TagsSnippets.scala: > > 67) > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > sun.reflect.NativeMethodAccessorImpl.invoke > > (NativeMethodAccessorImpl.java:39) > > sun.reflect.DelegatingMethodAccessorImpl.invoke > > (DelegatingMethodAccessorImpl.java:25) > > java.lang.reflect.Method.invoke(Method.java:597) > > > net.liftweb.util.ClassHelpers$$anonfun$net$liftweb$util$ClassHelpers$ > > $_invokeMethod$2$$anonfun$apply$7.apply(ClassHelpers.scala:352) > > net.liftweb.util.ControlHelpers$class.tryo(ControlHelpers.scala:40) > > net.liftweb.util.Helpers$.tryo(Helpers.scala:29) > > net.liftweb.util.ControlHelpers$class.tryo(ControlHelpers.scala:55) > > net.liftweb.util.Helpers$.tryo(Helpers.scala:29) > > > net.liftweb.util.ClassHelpers$$anonfun$net$liftweb$util$ClassHelpers$ > > $_invokeMethod$2.apply(ClassHelpers.scala:352) > > > net.liftweb.util.ClassHelpers$$anonfun$net$liftweb$util$ClassHelpers$ > > $_invokeMethod$2.apply(ClassHelpers.scala:352) > > scala.Iterator$$anon$14.next(Iterator.scala:267) > > scala.Iterator$class.find(Iterator.scala:462) > > scala.Iterator$$anon$14.find(Iterator.scala:265) > > net.liftweb.util.ClassHelpers$class.net$liftweb$util$ClassHelpers$ > > $_invokeMethod(ClassHelpers.scala:353) > > net.liftweb.util.ClassHelpers$class.invokeMethod(ClassHelpers.scala: > > 285) > > net.liftweb.util.Helpers$.invokeMethod(Helpers.scala:29) > > net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33$$anonfun > > $apply$36$$anonfun$apply$38.apply(LiftSession.scala:723) > > net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33$$anonfun > > $apply$36$$anonfun$apply$38.apply(LiftSession.scala:705) > > net.liftweb.util.EmptyBox.openOr(Box.scala:372) > > net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33$$anonfun > > $apply$36.apply(LiftSession.scala:705) > > net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33$$anonfun > > $apply$36.apply(LiftSession.scala:705) > > net.liftweb.util.EmptyBox.openOr(Box.scala:372) > > net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33.apply > > (LiftSession.scala:704) > > net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33.apply > > (LiftSession.scala:704) > > net.liftweb.http.S$.doSnippet(S.scala:725) > > > net.liftweb.http.LiftSession$$anonfun$17.apply(LiftSession.scala:702) > > > net.liftweb.http.LiftSession$$anonfun$17.apply(LiftSession.scala:701) > > net.liftweb.util.Full.map(Box.scala:330) > > net.liftweb.http.LiftSession.net$liftweb$http$LiftSession$ > > $processSnippet(LiftSession.scala:701) > > net.liftweb.http.LiftSession$$anonfun$_defaultLiftTagProcessing > > $1.apply(LiftSession.scala:793) > > net.liftweb.http.LiftSession$$anonfun$_defaultLiftTagProcessing > > $1.apply(LiftSession.scala:777) > > net.liftweb.util.NamedPF.apply(NamedPartialFunction.scala:30) > > net.liftweb.util.NamedPF$.apply(NamedPartialFunction.scala:76) > > net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1$ > > $anonfun$apply$49.apply(LiftSession.scala:808) > > net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1$ > > $anonfun$apply$49.apply(LiftSession.scala:808) > > net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65) > > net.liftweb.http.S$.setVars(S.scala:623) > > net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude > > $1.apply(LiftSession.scala:808) > > net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude > > $1.apply(LiftSession.scala:805) > > scala.Seq$class.flatMap(Seq.scala:294) > >
Re: [Lift] Re: QueryParams and joins
On Tue, Jan 5, 2010 at 11:51 AM, Mads Hartmann wrote: > Sure thing, it's quite long though :) > > Just one thing, i added the following for it to compile (I want to > return List[User] not List[TagUser] : .map(_.user.obj.open_!) > > So in all it looks like this > > def getTopUsers(in: Int) :List[User] = { > >TagUser.findAll(By(TagUser.tag, this.id), In(TagUser.user, User.id, > OrderBy(User.followers_count, Descending), MaxRows[User](in))) > .map(_.user.obj.open_!) > > } > What version of Lift? > > Exception occured while processing / > Message: java.lang.NullPointerException >net.liftweb.mapper.In$$anon$3.(MetaMapper.scala:1206) >net.liftweb.mapper.In$.apply(MetaMapper.scala:1200) >scalableKvidr.model.Tag.getTopUsers(Tag.scala:38) >scalableKvidr.snippet.TagsSnippets$$anonfun$frontpageTags$1.apply > (TagsSnippets.scala:71) >scalableKvidr.snippet.TagsSnippets$$anonfun$frontpageTags$1.apply > (TagsSnippets.scala:68) >scala.List.flatMap(List.scala:1125) >scalableKvidr.snippet.TagsSnippets.frontpageTags(TagsSnippets.scala: > 67) >sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >sun.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:39) >sun.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:25) >java.lang.reflect.Method.invoke(Method.java:597) > > net.liftweb.util.ClassHelpers$$anonfun$net$liftweb$util$ClassHelpers$ > $_invokeMethod$2$$anonfun$apply$7.apply(ClassHelpers.scala:352) >net.liftweb.util.ControlHelpers$class.tryo(ControlHelpers.scala:40) >net.liftweb.util.Helpers$.tryo(Helpers.scala:29) >net.liftweb.util.ControlHelpers$class.tryo(ControlHelpers.scala:55) >net.liftweb.util.Helpers$.tryo(Helpers.scala:29) > > net.liftweb.util.ClassHelpers$$anonfun$net$liftweb$util$ClassHelpers$ > $_invokeMethod$2.apply(ClassHelpers.scala:352) > > net.liftweb.util.ClassHelpers$$anonfun$net$liftweb$util$ClassHelpers$ > $_invokeMethod$2.apply(ClassHelpers.scala:352) >scala.Iterator$$anon$14.next(Iterator.scala:267) >scala.Iterator$class.find(Iterator.scala:462) >scala.Iterator$$anon$14.find(Iterator.scala:265) >net.liftweb.util.ClassHelpers$class.net$liftweb$util$ClassHelpers$ > $_invokeMethod(ClassHelpers.scala:353) >net.liftweb.util.ClassHelpers$class.invokeMethod(ClassHelpers.scala: > 285) >net.liftweb.util.Helpers$.invokeMethod(Helpers.scala:29) >net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33$$anonfun > $apply$36$$anonfun$apply$38.apply(LiftSession.scala:723) >net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33$$anonfun > $apply$36$$anonfun$apply$38.apply(LiftSession.scala:705) >net.liftweb.util.EmptyBox.openOr(Box.scala:372) >net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33$$anonfun > $apply$36.apply(LiftSession.scala:705) >net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33$$anonfun > $apply$36.apply(LiftSession.scala:705) >net.liftweb.util.EmptyBox.openOr(Box.scala:372) >net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33.apply > (LiftSession.scala:704) >net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33.apply > (LiftSession.scala:704) >net.liftweb.http.S$.doSnippet(S.scala:725) > > net.liftweb.http.LiftSession$$anonfun$17.apply(LiftSession.scala:702) > > net.liftweb.http.LiftSession$$anonfun$17.apply(LiftSession.scala:701) >net.liftweb.util.Full.map(Box.scala:330) >net.liftweb.http.LiftSession.net$liftweb$http$LiftSession$ > $processSnippet(LiftSession.scala:701) >net.liftweb.http.LiftSession$$anonfun$_defaultLiftTagProcessing > $1.apply(LiftSession.scala:793) >net.liftweb.http.LiftSession$$anonfun$_defaultLiftTagProcessing > $1.apply(LiftSession.scala:777) >net.liftweb.util.NamedPF.apply(NamedPartialFunction.scala:30) >net.liftweb.util.NamedPF$.apply(NamedPartialFunction.scala:76) >net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1$ > $anonfun$apply$49.apply(LiftSession.scala:808) >net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1$ > $anonfun$apply$49.apply(LiftSession.scala:808) >net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65) >net.liftweb.http.S$.setVars(S.scala:623) >net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude > $1.apply(LiftSession.scala:808) >net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude > $1.apply(LiftSession.scala:805) >scala.Seq$class.flatMap(Seq.scala:294) >scala.xml.NodeSeq.flatMap(NodeSeq.scala:34) >net.liftweb.http.LiftSession.processSurroundAndInclude > (LiftSession.scala:804) >net.liftweb.http.LiftSession.net$liftweb$http$LiftSession$ > $processSurroundElement(LiftSession.scala:948) >net.liftweb.http.LiftSession$$an
[Lift] Re: QueryParams and joins
Sure thing, it's quite long though :) Just one thing, i added the following for it to compile (I want to return List[User] not List[TagUser] : .map(_.user.obj.open_!) So in all it looks like this def getTopUsers(in: Int) :List[User] = { TagUser.findAll(By(TagUser.tag, this.id), In(TagUser.user, User.id, OrderBy(User.followers_count, Descending), MaxRows[User](in))) .map(_.user.obj.open_!) } Exception occured while processing / Message: java.lang.NullPointerException net.liftweb.mapper.In$$anon$3.(MetaMapper.scala:1206) net.liftweb.mapper.In$.apply(MetaMapper.scala:1200) scalableKvidr.model.Tag.getTopUsers(Tag.scala:38) scalableKvidr.snippet.TagsSnippets$$anonfun$frontpageTags$1.apply (TagsSnippets.scala:71) scalableKvidr.snippet.TagsSnippets$$anonfun$frontpageTags$1.apply (TagsSnippets.scala:68) scala.List.flatMap(List.scala:1125) scalableKvidr.snippet.TagsSnippets.frontpageTags(TagsSnippets.scala: 67) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) net.liftweb.util.ClassHelpers$$anonfun$net$liftweb$util$ClassHelpers$ $_invokeMethod$2$$anonfun$apply$7.apply(ClassHelpers.scala:352) net.liftweb.util.ControlHelpers$class.tryo(ControlHelpers.scala:40) net.liftweb.util.Helpers$.tryo(Helpers.scala:29) net.liftweb.util.ControlHelpers$class.tryo(ControlHelpers.scala:55) net.liftweb.util.Helpers$.tryo(Helpers.scala:29) net.liftweb.util.ClassHelpers$$anonfun$net$liftweb$util$ClassHelpers$ $_invokeMethod$2.apply(ClassHelpers.scala:352) net.liftweb.util.ClassHelpers$$anonfun$net$liftweb$util$ClassHelpers$ $_invokeMethod$2.apply(ClassHelpers.scala:352) scala.Iterator$$anon$14.next(Iterator.scala:267) scala.Iterator$class.find(Iterator.scala:462) scala.Iterator$$anon$14.find(Iterator.scala:265) net.liftweb.util.ClassHelpers$class.net$liftweb$util$ClassHelpers$ $_invokeMethod(ClassHelpers.scala:353) net.liftweb.util.ClassHelpers$class.invokeMethod(ClassHelpers.scala: 285) net.liftweb.util.Helpers$.invokeMethod(Helpers.scala:29) net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33$$anonfun $apply$36$$anonfun$apply$38.apply(LiftSession.scala:723) net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33$$anonfun $apply$36$$anonfun$apply$38.apply(LiftSession.scala:705) net.liftweb.util.EmptyBox.openOr(Box.scala:372) net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33$$anonfun $apply$36.apply(LiftSession.scala:705) net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33$$anonfun $apply$36.apply(LiftSession.scala:705) net.liftweb.util.EmptyBox.openOr(Box.scala:372) net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33.apply (LiftSession.scala:704) net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$33.apply (LiftSession.scala:704) net.liftweb.http.S$.doSnippet(S.scala:725) net.liftweb.http.LiftSession$$anonfun$17.apply(LiftSession.scala:702) net.liftweb.http.LiftSession$$anonfun$17.apply(LiftSession.scala:701) net.liftweb.util.Full.map(Box.scala:330) net.liftweb.http.LiftSession.net$liftweb$http$LiftSession$ $processSnippet(LiftSession.scala:701) net.liftweb.http.LiftSession$$anonfun$_defaultLiftTagProcessing $1.apply(LiftSession.scala:793) net.liftweb.http.LiftSession$$anonfun$_defaultLiftTagProcessing $1.apply(LiftSession.scala:777) net.liftweb.util.NamedPF.apply(NamedPartialFunction.scala:30) net.liftweb.util.NamedPF$.apply(NamedPartialFunction.scala:76) net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1$ $anonfun$apply$49.apply(LiftSession.scala:808) net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1$ $anonfun$apply$49.apply(LiftSession.scala:808) net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65) net.liftweb.http.S$.setVars(S.scala:623) net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude $1.apply(LiftSession.scala:808) net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude $1.apply(LiftSession.scala:805) scala.Seq$class.flatMap(Seq.scala:294) scala.xml.NodeSeq.flatMap(NodeSeq.scala:34) net.liftweb.http.LiftSession.processSurroundAndInclude (LiftSession.scala:804) net.liftweb.http.LiftSession.net$liftweb$http$LiftSession$ $processSurroundElement(LiftSession.scala:948) net.liftweb.http.LiftSession$$anonfun$_defaultLiftTagProcessing $1.apply(LiftSession.scala:784) net.liftweb.http.LiftSession$$anonfun$_defaultLiftTagProcessing $1.apply(LiftSession.scala:777) net.liftweb.util
Re: [Lift] Re: QueryParams and joins
On Tue, Jan 5, 2010 at 11:33 AM, Mads Hartmann wrote: > Thanks David, > It compiled just fine but I got a nullpointer exception for some > reason. Please post the stack trace. > For now I'll use the findAllByPreparedStatement method instead > so I can play along with my project. > > Thanks for the help though :) > > On Jan 5, 6:01 pm, David Pollak wrote: > > Lift uses the SQL IN statement rather than joins. This has a negative > > impact for users of MySQL and Derby. > > > > Try: > > > > TagUser.findAll(By(TagUser.tag, this), In(TagUser.user, User.id, > > OrderBy(User.followers_count, Descending), MaxRows[User](10))) > > > > > > > > > > > > On Mon, Jan 4, 2010 at 11:10 PM, Mads Hartmann > wrote: > > > My ultimate goal would be to only pull out the top x users. I'm > > > currently using the following code to achieve this: > > > > > TagUser.findAll(By(TagUser.tag, this.id)).map(_.user.obj.open_!) > > >.sort(_.followers_count.is > _.followers_count.is) > > > .take(x) > > > > > But im concerned that this creates an instance for each of the users > > > in tag tag even though i only need the top x. > > > > > Thanks for helping me out :) > > > > > On Jan 5, 1:47 am, David Pollak wrote: > > > > On Mon, Jan 4, 2010 at 3:24 PM, Mads Hartmann > wrote: > > > > > Hello, I'm having a problem and I'm sure it's an easy fix for > someone > > > > > with a bit more experience > > > > > > > I have 3 model classes: tag, user, tweet and a join class TagUser. > A > > > > > tag has a list of users. > > > > > > > If i want all of the users in a tag i use the following code (which > > > > > works): > > > > > > > def users = TagUser.findAll(By(TagUser.tag, this.id)).map > > > > > (_.user.obj.open_!) > > > > > > > my problem is that i can't figure out how to apply queryparams so i > > > > > don't pull out all of the users from the DB if i don't need em. I > was > > > > > thinking something like this (doesn't compile): > > > > > > > def getTopUsers(in: Int) :List[User] = { > > > > >TagUser.findAll(By(TagUser.tag, this.id), > > > > > OrderBy(User.followers_count, Descending), > > > > > MaxRows(in)) > > > > > > There is an issue: > > > > > > OrderBy(User., Descending) // illegal... you can only order by a > > > > TagUser.xxx field > > > > > > And a potential issue: > > > > > > MaxRows[TagUser](in) // sometimes the Type Inferencer doesn't get it > > > right. > > > > > > What's your ultimate goal? > > > > > > > } > > > > > > > I get the following error: > > > > > [ERROR] ... error: overloaded method value findAll with > alternatives > > > > > (net.liftweb.mapper.QueryParam[scalableKvidr.model.TagUser]*)List > > > > > [scalableKvidr.model.TagUser] ()List > > > > > [scalableKvidr.model.TagUser] cannot be applied to > > > > > (net.liftweb.mapper.Cmp > > > > > [scalableKvidr.model.TagUser,Long],net.liftweb.mapper.OrderBy > > > > > [scalableKvidr.model.User,Int],net.liftweb.mapper.MaxRows[Nothing]) > > > > > > > -- > > > > > > > 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. > > > > > > -- > > > > Lift, the simply functional web frameworkhttp://liftweb.net > > > > Beginning Scalahttp://www.apress.com/book/view/1430219890 > > > > Follow me:http://twitter.com/dpp > > > > Surf the harmonics > > > > > -- > > > > > 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. > > > > -- > > Lift, the simply functional web frameworkhttp://liftweb.net > > Beginning Scalahttp://www.apress.com/book/view/1430219890 > > Follow me:http://twitter.com/dpp > > Surf the harmonics > > -- > 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. > > > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- 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...@
[Lift] Re: QueryParams and joins
Thanks David, It compiled just fine but I got a nullpointer exception for some reason. For now I'll use the findAllByPreparedStatement method instead so I can play along with my project. Thanks for the help though :) On Jan 5, 6:01 pm, David Pollak wrote: > Lift uses the SQL IN statement rather than joins. This has a negative > impact for users of MySQL and Derby. > > Try: > > TagUser.findAll(By(TagUser.tag, this), In(TagUser.user, User.id, > OrderBy(User.followers_count, Descending), MaxRows[User](10))) > > > > > > On Mon, Jan 4, 2010 at 11:10 PM, Mads Hartmann wrote: > > My ultimate goal would be to only pull out the top x users. I'm > > currently using the following code to achieve this: > > > TagUser.findAll(By(TagUser.tag, this.id)).map(_.user.obj.open_!) > > .sort(_.followers_count.is > _.followers_count.is) > > .take(x) > > > But im concerned that this creates an instance for each of the users > > in tag tag even though i only need the top x. > > > Thanks for helping me out :) > > > On Jan 5, 1:47 am, David Pollak wrote: > > > On Mon, Jan 4, 2010 at 3:24 PM, Mads Hartmann wrote: > > > > Hello, I'm having a problem and I'm sure it's an easy fix for someone > > > > with a bit more experience > > > > > I have 3 model classes: tag, user, tweet and a join class TagUser. A > > > > tag has a list of users. > > > > > If i want all of the users in a tag i use the following code (which > > > > works): > > > > > def users = TagUser.findAll(By(TagUser.tag, this.id)).map > > > > (_.user.obj.open_!) > > > > > my problem is that i can't figure out how to apply queryparams so i > > > > don't pull out all of the users from the DB if i don't need em. I was > > > > thinking something like this (doesn't compile): > > > > > def getTopUsers(in: Int) :List[User] = { > > > > TagUser.findAll(By(TagUser.tag, this.id), > > > > OrderBy(User.followers_count, Descending), > > > > MaxRows(in)) > > > > There is an issue: > > > > OrderBy(User., Descending) // illegal... you can only order by a > > > TagUser.xxx field > > > > And a potential issue: > > > > MaxRows[TagUser](in) // sometimes the Type Inferencer doesn't get it > > right. > > > > What's your ultimate goal? > > > > > } > > > > > I get the following error: > > > > [ERROR] ... error: overloaded method value findAll with alternatives > > > > (net.liftweb.mapper.QueryParam[scalableKvidr.model.TagUser]*)List > > > > [scalableKvidr.model.TagUser] ()List > > > > [scalableKvidr.model.TagUser] cannot be applied to > > > > (net.liftweb.mapper.Cmp > > > > [scalableKvidr.model.TagUser,Long],net.liftweb.mapper.OrderBy > > > > [scalableKvidr.model.User,Int],net.liftweb.mapper.MaxRows[Nothing]) > > > > > -- > > > > > 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 > > > > > > > s.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 > > > Follow me:http://twitter.com/dpp > > > Surf the harmonics > > > -- > > > 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. > > -- > Lift, the simply functional web frameworkhttp://liftweb.net > Beginning Scalahttp://www.apress.com/book/view/1430219890 > Follow me:http://twitter.com/dpp > Surf the harmonics -- 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.
Re: [Lift] Re: QueryParams and joins
Lift uses the SQL IN statement rather than joins. This has a negative impact for users of MySQL and Derby. Try: TagUser.findAll(By(TagUser.tag, this), In(TagUser.user, User.id, OrderBy(User.followers_count, Descending), MaxRows[User](10))) On Mon, Jan 4, 2010 at 11:10 PM, Mads Hartmann wrote: > My ultimate goal would be to only pull out the top x users. I'm > currently using the following code to achieve this: > > TagUser.findAll(By(TagUser.tag, this.id)).map(_.user.obj.open_!) >.sort(_.followers_count.is > _.followers_count.is) > .take(x) > > But im concerned that this creates an instance for each of the users > in tag tag even though i only need the top x. > > Thanks for helping me out :) > > On Jan 5, 1:47 am, David Pollak wrote: > > On Mon, Jan 4, 2010 at 3:24 PM, Mads Hartmann wrote: > > > Hello, I'm having a problem and I'm sure it's an easy fix for someone > > > with a bit more experience > > > > > I have 3 model classes: tag, user, tweet and a join class TagUser. A > > > tag has a list of users. > > > > > If i want all of the users in a tag i use the following code (which > > > works): > > > > > def users = TagUser.findAll(By(TagUser.tag, this.id)).map > > > (_.user.obj.open_!) > > > > > my problem is that i can't figure out how to apply queryparams so i > > > don't pull out all of the users from the DB if i don't need em. I was > > > thinking something like this (doesn't compile): > > > > > def getTopUsers(in: Int) :List[User] = { > > >TagUser.findAll(By(TagUser.tag, this.id), > > > OrderBy(User.followers_count, Descending), > > > MaxRows(in)) > > > > There is an issue: > > > > OrderBy(User., Descending) // illegal... you can only order by a > > TagUser.xxx field > > > > And a potential issue: > > > > MaxRows[TagUser](in) // sometimes the Type Inferencer doesn't get it > right. > > > > What's your ultimate goal? > > > > > > > > > > > > > } > > > > > I get the following error: > > > [ERROR] ... error: overloaded method value findAll with alternatives > > > (net.liftweb.mapper.QueryParam[scalableKvidr.model.TagUser]*)List > > > [scalableKvidr.model.TagUser] ()List > > > [scalableKvidr.model.TagUser] cannot be applied to > > > (net.liftweb.mapper.Cmp > > > [scalableKvidr.model.TagUser,Long],net.liftweb.mapper.OrderBy > > > [scalableKvidr.model.User,Int],net.liftweb.mapper.MaxRows[Nothing]) > > > > > -- > > > > > 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. > > > > -- > > Lift, the simply functional web frameworkhttp://liftweb.net > > Beginning Scalahttp://www.apress.com/book/view/1430219890 > > Follow me:http://twitter.com/dpp > > Surf the harmonics > > -- > > 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. > > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- 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.
[Lift] Re: QueryParams and joins
My ultimate goal would be to only pull out the top x users. I'm currently using the following code to achieve this: TagUser.findAll(By(TagUser.tag, this.id)).map(_.user.obj.open_!) .sort(_.followers_count.is > _.followers_count.is) .take(x) But im concerned that this creates an instance for each of the users in tag tag even though i only need the top x. Thanks for helping me out :) On Jan 5, 1:47 am, David Pollak wrote: > On Mon, Jan 4, 2010 at 3:24 PM, Mads Hartmann wrote: > > Hello, I'm having a problem and I'm sure it's an easy fix for someone > > with a bit more experience > > > I have 3 model classes: tag, user, tweet and a join class TagUser. A > > tag has a list of users. > > > If i want all of the users in a tag i use the following code (which > > works): > > > def users = TagUser.findAll(By(TagUser.tag, this.id)).map > > (_.user.obj.open_!) > > > my problem is that i can't figure out how to apply queryparams so i > > don't pull out all of the users from the DB if i don't need em. I was > > thinking something like this (doesn't compile): > > > def getTopUsers(in: Int) :List[User] = { > > TagUser.findAll(By(TagUser.tag, this.id), > > OrderBy(User.followers_count, Descending), > > MaxRows(in)) > > There is an issue: > > OrderBy(User., Descending) // illegal... you can only order by a > TagUser.xxx field > > And a potential issue: > > MaxRows[TagUser](in) // sometimes the Type Inferencer doesn't get it right. > > What's your ultimate goal? > > > > > > > } > > > I get the following error: > > [ERROR] ... error: overloaded method value findAll with alternatives > > (net.liftweb.mapper.QueryParam[scalableKvidr.model.TagUser]*)List > > [scalableKvidr.model.TagUser] ()List > > [scalableKvidr.model.TagUser] cannot be applied to > > (net.liftweb.mapper.Cmp > > [scalableKvidr.model.TagUser,Long],net.liftweb.mapper.OrderBy > > [scalableKvidr.model.User,Int],net.liftweb.mapper.MaxRows[Nothing]) > > > -- > > > 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. > > -- > Lift, the simply functional web frameworkhttp://liftweb.net > Beginning Scalahttp://www.apress.com/book/view/1430219890 > Follow me:http://twitter.com/dpp > Surf the harmonics -- 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.