Errors getting started with unfiltered

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Errors getting started with unfiltered

Yang Zhang
I'm trying to get started with unfiltered (using Scala 2.9.0 and sbt 0.10), but I'm getting:

[info] Set current project to default (in build file:/home/yang/pod/sales/web/)
[info] Compiling 1 Scala source to /home/yang/pod/sales/web/target/scala-2.9.0.final/classes...
[error] class file needed by Plan is missing.
[error] reference value servlet of package javax refers to nonexisting symbol.
[error] one error found
[error] Incomplete tasks (run 'last <task>' for the full log):
[error]   {file:/home/yang/pod/sales/web/}default/compile: Compilation failed
[error] Total time: 3 s, completed Jul 8, 2011 9:22:19 PM

My build.sbt:

name := "POD Web"

version := "1.0"

libraryDependencies ++= Seq(
  "net.databinder" %% "unfiltered" % "0.3.4",
  "net.databinder" %% "unfiltered-filter" % "0.3.4",
  "org.scalaquery" %% "scalaquery" % "0.9.4",
  "postgresql" % "postgresql" % "9.0-801.jdbc4" % "runtime"
)

scalaVersion := "2.9.0"

fork in run := true

But I wasn't sure what dependencies to use. The docs say:

"applications need only explicitly depend on Unfiltered and other top-level dependencies"

Not sure how to parse this but depending on just unfiltered doesn't work (get compilation errors resolving unfiltered.filter).

Poking around the .g8 project, I saw unfiltered-jetty and unfiltered-filter as the key dependency artifacts, but listing those (or unfiltered-filter and unfiltered) yielded the above runtime errors. (Side note: I find it off-putting to have to use conscript/giter8 to get started, since I don't want to pollute my home directory and don't see the need to install and use these additional programs.)

Thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: Errors getting started with unfiltered

chris_lewis
Hi Yang,

Your project depends on unfiltered-filter, which wraps the javax.servlet api, but you haven't declared a dependency on javax.servlet or anything that *provides* it. unfiltered-filter declares a *provided* dependency configuration on javax.servlet, which is analogous the provided scope in maven. unfiltered-filter must do this because servlet containers provide the implementations for javax.servlet, and you would run into unexpected behavior due to conflicting libraries. unfiltered-jetty embeds the jetty servlet container which satisfies this need.

About conscript or g8; you don't need either of these. However, once you create a few sbt projects by hand you'll find yourself wanting g8 or something like it. sbt lacks anything like maven's archetypes; g8 is a simple tool providing bootstrapping via templates, which gives equivalent functionality. I always use g8 to bootstrap projects, and if no template exists, I create and publish one. conscript aims to make it easy to install console apps built in scala into your system, taking care of binary (ie shell launcher) and binary dependency woes. You don't need it to install g8, but some prefer this method (I don't).

Let me know how you get along.

-chris

https://github.com/harrah/xsbt/wiki/Configurations
http://ant.apache.org/ivy/history/2.2.0/tutorial/conf.html

On 7/9/11 12:28 AM, Yang Zhang [via Databinder] wrote:
I'm trying to get started with unfiltered (using Scala 2.9.0 and sbt 0.10), but I'm getting:

[info] Set current project to default (in build file:/home/yang/pod/sales/web/)
[info] Compiling 1 Scala source to /home/yang/pod/sales/web/target/scala-2.9.0.final/classes...
[error] class file needed by Plan is missing.
[error] reference value servlet of package javax refers to nonexisting symbol.
[error] one error found
[error] Incomplete tasks (run 'last <task>' for the full log):
[error]   {file:/home/yang/pod/sales/web/}default/compile: Compilation failed
[error] Total time: 3 s, completed Jul 8, 2011 9:22:19 PM

My build.sbt:

name := "POD Web"

version := "1.0"

libraryDependencies ++= Seq(
  "net.databinder" %% "unfiltered" % "0.3.4",
  "net.databinder" %% "unfiltered-filter" % "0.3.4",
  "org.scalaquery" %% "scalaquery" % "0.9.4",
  "postgresql" % "postgresql" % "9.0-801.jdbc4" % "runtime"
)

scalaVersion := "2.9.0"

fork in run := true

But I wasn't sure what dependencies to use. The docs say:

"applications need only explicitly depend on Unfiltered and other top-level dependencies"

Not sure how to parse this but depending on just unfiltered doesn't work (get compilation errors resolving unfiltered.filter).

Poking around the .g8 project, I saw unfiltered-jetty and unfiltered-filter as the key dependency artifacts, but listing those (or unfiltered-filter and unfiltered) yielded the above runtime errors. (Side note: I find it off-putting to have to use conscript/giter8 to get started, since I don't want to pollute my home directory and don't see the need to install and use these additional programs.)

Thanks in advance.


If you reply to this email, your message will be added to the discussion below:
http://databinder.3617998.n2.nabble.com/Errors-getting-started-with-unfiltered-tp6564959p6564959.html
To start a new topic under Unfiltered, email [hidden email]
To unsubscribe from Unfiltered, click here.

Reply | Threaded
Open this post in threaded view
|

Re: Errors getting started with unfiltered

Yang Zhang
Thanks, that worked.  Note: I don't see any message printed out
informing me of the listening port.

On Sat, Jul 9, 2011 at 4:35 AM, chris_lewis [via Databinder]
<[hidden email]> wrote:

> Hi Yang,
>
> Your project depends on unfiltered-filter, which wraps the javax.servlet
> api, but you haven't declared a dependency on javax.servlet or anything that
> *provides* it. unfiltered-filter declares a *provided* dependency
> configuration on javax.servlet, which is analogous the provided scope in
> maven. unfiltered-filter must do this because servlet containers provide the
> implementations for javax.servlet, and you would run into unexpected
> behavior due to conflicting libraries. unfiltered-jetty embeds the jetty
> servlet container which satisfies this need.
>
> About conscript or g8; you don't need either of these. However, once you
> create a few sbt projects by hand you'll find yourself wanting g8 or
> something like it. sbt lacks anything like maven's archetypes; g8 is a
> simple tool providing bootstrapping via templates, which gives equivalent
> functionality. I always use g8 to bootstrap projects, and if no template
> exists, I create and publish one. conscript aims to make it easy to install
> console apps built in scala into your system, taking care of binary (ie
> shell launcher) and binary dependency woes. You don't need it to install g8,
> but some prefer this method (I don't).
>
> Let me know how you get along.
>
> -chris
>
> https://github.com/harrah/xsbt/wiki/Configurations
> http://ant.apache.org/ivy/history/2.2.0/tutorial/conf.html
>
> On 7/9/11 12:28 AM, Yang Zhang [via Databinder] wrote:
>
> I'm trying to get started with unfiltered (using Scala 2.9.0 and sbt 0.10),
> but I'm getting:
>
> [info] Set current project to default (in build
> file:/home/yang/pod/sales/web/)
> [info] Compiling 1 Scala source to
> /home/yang/pod/sales/web/target/scala-2.9.0.final/classes...
> [error] class file needed by Plan is missing.
> [error] reference value servlet of package javax refers to nonexisting
> symbol.
> [error] one error found
> [error] Incomplete tasks (run 'last <task>' for the full log):
> [error]   {file:/home/yang/pod/sales/web/}default/compile: Compilation
> failed
> [error] Total time: 3 s, completed Jul 8, 2011 9:22:19 PM
>
> My build.sbt:
>
> name := "POD Web"
>
> version := "1.0"
>
> libraryDependencies ++= Seq(
>   "net.databinder" %% "unfiltered" % "0.3.4",
>   "net.databinder" %% "unfiltered-filter" % "0.3.4",
>   "org.scalaquery" %% "scalaquery" % "0.9.4",
>   "postgresql" % "postgresql" % "9.0-801.jdbc4" % "runtime"
> )
>
> scalaVersion := "2.9.0"
>
> fork in run := true
>
> But I wasn't sure what dependencies to use. The docs say:
>
> "applications need only explicitly depend on Unfiltered and other top-level
> dependencies"
>
> Not sure how to parse this but depending on just unfiltered doesn't work
> (get compilation errors resolving unfiltered.filter).
>
> Poking around the .g8 project, I saw unfiltered-jetty and unfiltered-filter
> as the key dependency artifacts, but listing those (or unfiltered-filter and
> unfiltered) yielded the above runtime errors. (Side note: I find it
> off-putting to have to use conscript/giter8 to get started, since I don't
> want to pollute my home directory and don't see the need to install and use
> these additional programs.)
>
> Thanks in advance.
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://databinder.3617998.n2.nabble.com/Errors-getting-started-with-unfiltered-tp6564959p6564959.html
> To start a new topic under Unfiltered, email [hidden email]
> To unsubscribe from Unfiltered, click here.
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://databinder.3617998.n2.nabble.com/Errors-getting-started-with-unfiltered-tp6564959p6565580.html
> To unsubscribe from Errors getting started with unfiltered, click here.



--
Yang Zhang
http://yz.mit.edu/