[Lift] Getting Started ToDo: ToDo.scala:8: error: not found: type IdPK

37 views
Skip to first unread message

ghostM

unread,
Apr 26, 2010, 12:32:46 AM4/26/10
to Lift
I'm trying to get started with Lift -- I come from a strong
programming background with experience with many other web frameworks,
but limited knowledge of Scala and Maven.

However, when I try and get the ToDo app running I get the following
error.
ToDo.scala:8: error: not found: type IdPK

line 8 is:
class ToDo extends LongKeyedMapper[ToDo] with IdPK {

I think I started the project correctly because when I got the correct
default page before trying to make the ToDo model.

I'm not sure if this is a scala, lift or maven problem I'm
encountering.

I'm running Scala 2.8 on Mac 10.6 if that could be the source of my
problem.

Thanks in advance.

The full message when run with -e:

[INFO] Compiling 4 source files to /Users/matthew/Documents/sandbox/
scala/todo/target/classes at 1272256266201
[ERROR] /Users/matthew/Documents/sandbox/scala/todo/src/main/scala/com/
liftworkshop/model/ToDo.scala:8: error: not found: type IdPK
[INFO] class ToDo extends LongKeyedMapper[ToDo] with IdPK {
[INFO] ^
[ERROR] one error found
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] wrap: org.apache.commons.exec.ExecuteException: Process exited
with an error: 1(Exit value: 1)

[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: wrap:
org.apache.commons.exec.ExecuteException: Process exited with an
error: 1(Exit value: 1)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:
703)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:
540)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle(DefaultLifecycleExecutor.java:
1190)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLifecycleExecutor.java:
1022)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:
627)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:
553)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:
523)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:
371)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:
332)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:
181)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:
41)
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: org.apache.maven.plugin.MojoExecutionException: wrap:
org.apache.commons.exec.ExecuteException: Process exited with an
error: 1(Exit value: 1)
at
org_scala_tools_maven.ScalaMojoSupport.execute(ScalaMojoSupport.java:
331)
at
org_scala_tools_maven.ScalaCompilerSupport.execute(ScalaCompilerSupport.java:
33)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:
483)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:
678)
... 21 more
Caused by: org.apache.commons.exec.ExecuteException: Process exited
with an error: 1(Exit value: 1)
at
org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:
346)
at
org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:
149)
at
org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:
136)
at
org_scala_tools_maven_executions.JavaMainCallerByFork.run(JavaMainCallerByFork.java:
84)
at
org_scala_tools_maven.ScalaCompilerSupport.compile(ScalaCompilerSupport.java:
183)
at
org_scala_tools_maven.ScalaCompilerSupport.doExecute(ScalaCompilerSupport.java:
114)
at
org_scala_tools_maven.ScalaMojoSupport.execute(ScalaMojoSupport.java:
323)
... 24 more

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

David Brooks

unread,
Apr 26, 2010, 6:28:23 AM4/26/10
to lif...@googlegroups.com

On 26 Apr 2010, at 05:32, ghostM wrote:

> However, when I try and get the ToDo app running I get the following
> error.
> ToDo.scala:8: error: not found: type IdPK

Sounds like you're missing an import statement: net.liftweb.mapper.IdPK (or net.liftweb.mapper._)

You'll probably find yourself missing quite a few of these import statements. It can be a bit of a pain determining which you need up front.

> I'm not sure if this is a scala, lift or maven problem I'm
> encountering.

It's a Lift issue (since that's where IdPK comes from).

> I'm running Scala 2.8 on Mac 10.6 if that could be the source of my
> problem.

I've only tested the above in Scala 2.7 and Lift 1.0 (since IdPK is part of Lift, it's really the Lift version that determines where the import should come from), so I can't vouch for 2.8, where things seem to be less stable at present.

Note that Maven will install versions of Scala and Lift. Your pom.xml file determines which Scala/Lift you are using.

Cheers,
D

ghostM

unread,
Apr 26, 2010, 8:34:47 PM4/26/10
to Lift
Changing the import didn't make any difference, but I started over and
followed the new maven generate command that was given in the message:
http://groups.google.com/group/liftweb/t/4336f3170b41e60f
And I'm up and running.
Thanks!
Reply all
Reply to author
Forward
0 new messages