Jetty doesn't get managed as a dependency

788 views
Skip to first unread message

Maxime Lévesque

unread,
Apr 4, 2010, 11:59:00 AM4/4/10
to simple-build-tool

Hi everyone, I included Jetty as a dependency in a DefaultWebProject,

when I do an 'update' it doesn't get downloaded like other
dependencies, and
and when I do 'jetty-run', I get a java.lang.NoClassDefFoundError: org/
eclipse/jetty/server/Connector.

I have tried clean-lib, clean-cache and many things without success.

Here's my build definition :

sbt.version=0.7.2
project.version=0.0.1
def.scala.version=2.7.7
build.scala.versions=2.8.0.Beta1-RC8
project.initialize=false

Thanks !

class GwtBuild(info: ProjectInfo) extends DefaultWebProject(info) {

val h2 = "com.h2database" % "h2" % "1.2.127"

val jetty7 = "org.eclipse.jetty" % "jetty-project" % "7.0.2.RC0" %
"test" // jetty is only need for testing

// val jetty7 = "org.eclipse.jetty" % "jetty-project" % "7.0.2.RC0"

// val jetty6 = "org.mortbay.jetty" % "jetty" % "6.1.14" % "test" //
jetty is only need for testing

// val jetty = "org.mortbay.jetty" % "jetty" % "6.1.18" % "test-
>default"

}

Mark Harrah

unread,
Apr 5, 2010, 7:27:50 AM4/5/10
to simple-b...@googlegroups.com
I don't think you want jetty-project- it doesn't appear to declare any dependencies or artifacts. Try jetty-server and jetty-webapp or whatever specific Jetty modules you need.

-Mark

Maxime Lévesque

unread,
Apr 5, 2010, 7:34:09 PM4/5/10
to simple-build-tool

Thanks, jetty-webapp did it...

Maxime Lévesque

unread,
Apr 5, 2010, 10:27:37 PM4/5/10
to simple-build-tool

Declaring this dependency :

val jetty7 = "org.eclipse.jetty" % "jetty-webapp" % "7.0.2.RC0"

caused the proper jars to get downloaded into :

lib_managed\scala_2.8.0.Beta1-RC8\compile

but, when I call jetty-run, I see that all the jetty jars get copied
to :

target\scala_2.8.0.Beta1-RC8\webapp\WEB-INF\lib

but I get a ClassNotFoundException, even though I see the class in
jetty-server-7.0.2.RC0.jar

the stack trace is :

Caused by: java.lang.ClassNotFoundException:
org.eclipse.jetty.server.Connector
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:303)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at xsbt.DualLoader.loadClass(DualLoader.scala:28)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at
sbt.LazyFrameworkLoader.doLoadClass(ClasspathUtilities.scala:204)
at sbt.LoaderBase.loadClass(ClasspathUtilities.scala:118)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
316)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at sbt.ModuleUtilities$.getObject(ModuleUtilities.scala:10)
at sbt.JettyRunner.createRunner$1(WebApp.scala:47)
at sbt.JettyRunner.runJetty$1(WebApp.scala:49)
at sbt.JettyRunner.apply(WebApp.scala:59)
at sbt.WebScalaProject$$anonfun$jettyRunTask
$1.apply(ScalaProject.scala:370)
at sbt.WebScalaProject$$anonfun$jettyRunTask
$1.apply(ScalaProject.scala:370)
at sbt.TaskManager$Task.invoke(TaskManager.scala:62)
at sbt.impl.RunTask.doRun$1(RunTask.scala:77)
at sbt.impl.RunTask.runTask(RunTask.scala:85)
at sbt.impl.RunTask.run(RunTask.scala:32)
at sbt.impl.RunTask$.apply(RunTask.scala:17)
at sbt.impl.RunTask$.apply(RunTask.scala:16)
at sbt.Project$class.run(Project.scala:98)
at sbt.Project$class.act(Project.scala:129)
at sbt.BasicScalaProject.act(DefaultProject.scala:20)
at sbt.xMain$$anonfun$8.apply(Main.scala:486)
at sbt.xMain$$anonfun$8.apply(Main.scala:486)
at sbt.xMain.withAction(Main.scala:519)
at sbt.xMain.sbt$xMain$$handleAction(Main.scala:486)
at sbt.xMain.handleCommand(Main.scala:476)
at sbt.xMain.processAction(Main.scala:417)
at sbt.xMain.process$1(Main.scala:237)
at sbt.xMain$Continue$1.apply(Main.scala:130)
at sbt.xMain.run$1(Main.scala:134)
at sbt.xMain.processArguments(Main.scala:246)
at sbt.xMain.startProject(Main.scala:105)
at sbt.xMain.run(Main.scala:82)
at sbt.xMain.run0$1(Main.scala:33)
at sbt.xMain.run(Main.scala:40)
at xsbt.boot.Launch$.run(Launch.scala:57)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:44)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:44)
at xsbt.boot.Launch$.launch(Launch.scala:63)
at xsbt.boot.Launch$.explicit(Launch.scala:44)
at xsbt.boot.Launch$.initialized(Launch.scala:40)
at xsbt.boot.Launch$.parsed(Launch.scala:34)
at xsbt.boot.Launch$.configured(Launch.scala:22)
at xsbt.boot.Launch$.apply(Launch.scala:15)
at xsbt.boot.Launch$.apply(Launch.scala:12)
at xsbt.boot.Boot$.run(Boot.scala:20)
at xsbt.boot.Boot$.main(Boot.scala:15)
at xsbt.boot.Boot.main(Boot.scala)

Max

Mark Harrah

unread,
Apr 5, 2010, 10:31:06 PM4/5/10
to simple-b...@googlegroups.com
You probably need to declare jetty-server as a dependency as well.

-Mark

David Bernard

unread,
Apr 6, 2010, 3:22:54 AM4/6/10
to simple-b...@googlegroups.com
>> but, when I call jetty-run, I see that all the jetty jars get copied
>> to :
>>
>> target\scala_2.8.0.Beta1-RC8\webapp\WEB-INF\lib

I'm not familliar with SBT+webapp but jetty'jars should not be part of
the webapp (dir and .war).
Jetty is provided as a servlet container where webapp are running.
So I don't think jetty jars should be copied to


target\scala_2.8.0.Beta1-RC8\webapp\WEB-INF\lib

/davidB

Mark Harrah

unread,
Apr 6, 2010, 8:12:25 AM4/6/10
to simple-b...@googlegroups.com

Good point. In this instance, Jetty was declared as a compile time dependency, though, which is why it got copied there.

-Mark

Maxime Lévesque

unread,
Apr 7, 2010, 1:48:17 PM4/7/10
to simple-build-tool

Ok, perhaps I should reformulate my question :
How do I tell SBT that I want to use Jetty as a serlvet engine ?

The doc :
http://code.google.com/p/simple-build-tool/wiki/WebApplications

Says : if you add Jetty as a dependency (manually or automatically),
you can use jetty-run.

How do I add Jetty as a dependency ?

I thought that this line would be declaring the dependence
'manually' :

val jetty7 = "org.eclipse.jetty" % "jetty-webapp" % "7.0.2.RC0"

I guess not...

my only requirement is that I can call jetty-run.

Cheers !

Mark Harrah

unread,
Apr 7, 2010, 2:19:06 PM4/7/10
to simple-b...@googlegroups.com
On Wednesday 07 April 2010 01:48:17 pm Maxime Lévesque wrote:
> Ok, perhaps I should reformulate my question :
> How do I tell SBT that I want to use Jetty as a serlvet engine ?
>
> The doc :
> http://code.google.com/p/simple-build-tool/wiki/WebApplications
>
> Says : if you add Jetty as a dependency (manually or automatically),
> you can use jetty-run.
>
> How do I add Jetty as a dependency ?
>
> I thought that this line would be declaring the dependence
> 'manually' :
>
> val jetty7 = "org.eclipse.jetty" % "jetty-webapp" % "7.0.2.RC0"

That is actually considered the automatic way. Manually would be downloading
Jetty and its dependencies, putting them in a directory, and adding them. I
have updated the WebApplications page with Jetty 7 and manual examples.

In your case, you need to put jetty in the 'test' configuration.

-Mark

javierg

unread,
Apr 19, 2010, 5:52:55 PM4/19/10
to simple-build-tool
I'm having the exact same problem (I'm using sbt 0.7.3)
my entry in the config file reads

val jettyWebapp = "org.eclipse.jetty" % "jetty-webapp" %
"7.0.2.v20100331" % "test"

which according to the sbt wiki and this threat should work (actually,
the right jars are being copied to the right places and everything
else works) but I continue to get java.lang.ClassNotFoundException:
org.eclipse.jetty.server.Connector after invoking jetty-run
Am I missing something here?


On Apr 7, 2:19 pm, Mark Harrah <dmhar...@gmail.com> wrote:
> On Wednesday 07 April 2010 01:48:17 pm Maxime Lévesque wrote:
>
> >   Ok, perhaps I should reformulate my question :
> > How do I tell SBT that I want to use Jetty as a serlvet engine ?
>
> > The doc :
> >  http://code.google.com/p/simple-build-tool/wiki/WebApplications
>
> > Says : if you add Jetty as a dependency (manually or automatically),
> > you can use jetty-run.
>
> > How do I add Jetty as a dependency ?
>
> > I thought that this line would be declaring the dependence
> > 'manually' :
>
> >   valjetty7= "org.eclipse.jetty" % "jetty-webapp" % "7.0.2.RC0"
>
> That is actually considered the automatic way.  Manually would be downloading
> Jetty and its dependencies, putting them in a directory, and adding them.  I
> have updated the WebApplications page with Jetty 7 and manual examples.
>
> In your case, you need to put jetty in the 'test' configuration.
>
> -Mark
>
>
>
> > I guess not...
>
> >  my only requirement is that I can call jetty-run.
>
> >  Cheers !
>
> > On Apr 6, 8:12 am, Mark Harrah <dmhar...@gmail.com> wrote:
> > > On Tuesday 06 April 2010, David Bernard wrote:
> > > > >> but, when I call jetty-run, I see that all the jetty jars get copied
> > > > >> to :
>
> > > > >>    target\scala_2.8.0.Beta1-RC8\webapp\WEB-INF\lib
>
> > > > I'm not familliar with SBT+webapp but jetty'jars should not be part of
> > > > the webapp (dir and .war).
> > > > Jetty is provided as a servlet container where webapp are running.
> > > > So I don't think jetty jars should be copied to
> > > >   target\scala_2.8.0.Beta1-RC8\webapp\WEB-INF\lib
>
> > > Good point.  In this instance, Jetty was declared as a compile time
> > > dependency, though, which is why it got copied there.
>
> > > -Mark

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

Mark Harrah

unread,
Apr 20, 2010, 11:53:46 AM4/20/10
to simple-b...@googlegroups.com
On Monday 19 April 2010, javierg wrote:
> I'm having the exact same problem (I'm using sbt 0.7.3)
> my entry in the config file reads
>
> val jettyWebapp = "org.eclipse.jetty" % "jetty-webapp" %
> "7.0.2.v20100331" % "test"
>
> which according to the sbt wiki and this threat should work (actually,
> the right jars are being copied to the right places and everything
> else works) but I continue to get java.lang.ClassNotFoundException:
> org.eclipse.jetty.server.Connector after invoking jetty-run
> Am I missing something here?

Perhaps you didn't run 'update'. If you did, please post an example project to demonstrate your issue.

Thanks,
Mark

javierg

unread,
Apr 20, 2010, 4:03:30 PM4/20/10
to simple-build-tool
Hi there,
running update was not the problem... Maxime sent me a link to his
config file and at least when it came to configuring Jetty everything
was identical. The problem seems to be this line in my config file

override def managedDependencyPath = sourcePath / "lib"

after I commented it out and let sbt use the default folder for
managed dependencies, everything works fine. Any idea why that would
happen?
regards,

Javier

Mark Harrah

unread,
Apr 23, 2010, 12:45:19 PM4/23/10
to simple-b...@googlegroups.com
Hi Javier,

Your override works for me. Can you post a sample project demonstrating the
issue?

-Mark

javierg

unread,
Apr 23, 2010, 1:15:24 PM4/23/10
to simple-build-tool
This is the config file

class KFSProject(info: ProjectInfo) extends DefaultWebProject(info) {
override def sourcePath = "."
override def mainSourcePath = sourcePath / "src"
override def mainScalaSourcePath = mainSourcePath
override def mainResourcesPath = mainSourcePath / "resources"

override def testSourcePath = sourcePath / "test"
override def testScalaSourcePath = testSourcePath
override def testResourcesPath = testSourcePath / "resources"

//override def managedDependencyPath = sourcePath / "lib"

override def webappPath = sourcePath / "web"

override def scanDirectories = Nil // required for JRebel


override def repositories = Set(
"jBoss" at "http://repository.jboss.org/maven2",
"Multiverse Releases" at "http://multiverse.googlecode.com/svn/
maven-repository/releases/",
"GuiceyFruit" at "http://guiceyfruit.googlecode.com/svn/repo/
releases/",
"DataBinder" at "http://databinder.net/repo",
"Configgy" at "http://www.lag.net/repo",
"Akka Maven Repository" at "http://scalablesolutions.se/akka/
repository",
"Java.Net" at "http://download.java.net/maven/2",
"repo1" at "http://repo1.maven.org/maven2",
ScalaToolsSnapshots)

override def libraryDependencies = Set(
/* jetty 7 */
"org.eclipse.jetty" % "jetty-webapp" % "7.0.2.RC0" % "test",

/* akka */
"se.scalablesolutions.akka" %% "akka-kernel" % "0.8.1",
"se.scalablesolutions.akka" %% "akka-core" % "0.8.1",
"se.scalablesolutions.akka" %% "akka-servlet" % "0.8.1",
"se.scalablesolutions.akka" %% "akka-rest" % "0.8.1",

/* joda-time */
"joda-time" % "joda-time" % "1.6" withJavadoc,

/* scalatest */
"org.scalatest" % "scalatest" % "1.0.1-for-scala-2.8.0.Beta1-RC7-
with-test-interfaces-0.3-SNAPSHOT" % "test" withJavadoc()
withSources(),

/* scala-query */
"com.novocode" % "scala-query_2.8.0.Beta1-RC4" % "1.0.0-SNAPSHOT"
withSources

/* squeryl
"org.squeryl" % "squeryl_2.8.0.Beta1-RC8" % "0.9.3"*/)

}

it works as it is right now, but removing the comment on

override def managedDependencyPath = sourcePath / "lib"

causes jetty-run to fail with java.lang.ClassNotFoundException:
org.eclipse.jetty.server.Connector or
java.lang.ClassNotFoundException: org.eclipse.jetty.server.Server
thanks for looking into this
> > > > On Apr7, 2:19 pm, Mark Harrah <dmhar...@gmail.com> wrote:
> > > > > On Wednesday 07 April 2010 01:48:17 pm Maxime Lévesque wrote:
> > > > > >   Ok, perhaps I should reformulate my question :
> > > > > > How do I tell SBT that I want to useJettyas a serlvet engine ?
>
> > > > > > The doc :
> > > > > >  http://code.google.com/p/simple-build-tool/wiki/WebApplications
>
> > > > > > Says : if you addJettyas a dependency (manually or
> > > > > > automatically), you can usejetty-run.
>
> > > > > > How do I addJettyas a dependency ?
>
> > > > > > I thought that this line would be declaring the dependence
> > > > > > 'manually' :
>
> > > > > >   valjetty7= "org.eclipse.jetty" % "jetty-webapp" % "7.0.2.RC0"
>
> > > > > That is actually considered the automatic way.  Manually would be
> > > > > downloadingJettyand its dependencies, putting them in a directory,
> > > > > and adding them.  I have updated the WebApplications page withJetty
> > > > >7and manual examples.
>
> > > > > In your case, you need to putjettyin the 'test' configuration.
>
> > > > > -Mark
>
> > > > > > I guess not...
>
> > > > > >  my only requirement is that I can calljetty-run.
>
> > > > > >  Cheers !
>
> > > > > > On Apr 6, 8:12 am, Mark Harrah <dmhar...@gmail.com> wrote:
> > > > > > > On Tuesday 06 April 2010, David Bernard wrote:
> > > > > > > > >> but, when I calljetty-run, I see that all thejettyjars
> > > > > > > > >> get copied to :
>
> > > > > > > > >>    target\scala_2.8.0.Beta1-RC8\webapp\WEB-INF\lib
>
> > > > > > > > I'm not familliar with SBT+webapp butjetty'jars should not be
> > > > > > > > part of the webapp (dir and .war).
> > > > > > > >Jettyis provided as a servlet container where webapp are
> > > > > > > > running. So I don't thinkjettyjars should be copied to
> > > > > > > >   target\scala_2.8.0.Beta1-RC8\webapp\WEB-INF\lib
>
> > > > > > > Good point.  In this instance,Jettywas declared as a compile

Mark Harrah

unread,
Apr 23, 2010, 2:57:10 PM4/23/10
to simple-b...@googlegroups.com
On Friday 23 April 2010 01:15:24 pm javierg wrote:
> This is the config file
>
> class KFSProject(info: ProjectInfo) extends DefaultWebProject(info) {
> override def sourcePath = "."

This is the important part. You haven't renamed the managed dependency
directory to src/lib/ but to Iib/, which is the default location for unmanaged
libraries. You need to rename the unmanaged directory because otherwise you
have two directories serving different purposes:

override def dependencyPath = "lib" / "unmanaged"

or wherever.

-Mark

javierg

unread,
Apr 23, 2010, 3:21:48 PM4/23/10
to simple-build-tool
That explains it. I was under the impression you could force both
managed and unmanaged to live in the same directory. Thanks for
clearing that.
> > causesjetty-run to fail with java.lang.ClassNotFoundException:

Mark Harrah

unread,
Apr 23, 2010, 5:10:19 PM4/23/10
to simple-b...@googlegroups.com
On Friday 23 April 2010 03:21:48 pm javierg wrote:
> That explains it. I was under the impression you could force both
> managed and unmanaged to live in the same directory. Thanks for
> clearing that.

You can, but it has to be a subdirectory like I showed or you have to redefine
the default unmanagedClasspath so that it does not recurse into
subdirectories. Otherwise, the nice separation of managed libraries into
configurations gets clobbered.

-Mark

foo

unread,
May 15, 2010, 10:16:50 AM5/15/10
to simple-build-tool
On Apr 23, 8:57 pm, Mark Harrah <dmhar...@gmail.com> wrote:
> On Friday 23 April 2010 01:15:24 pm javierg wrote:
>
> > This is the config file
>
> > class KFSProject(info: ProjectInfo) extends DefaultWebProject(info) {
> >   override def sourcePath = "."
>
> This is the important part.  You haven't renamed the managed dependency
> directory to src/lib/ but to Iib/, which is the default location for unmanaged

So, I do have the same problem, actually but have not changed any
defaults. My configuration is actually very simple, it yet contains
nothing but:

override def libraryDependencies = Set(
"mysql" % "mysql-connector-java" % "5.1.12",
"org.eclipse.jetty" % "jetty-webapp" % "7.1.0.v20100505",
"org.eclipse.jetty" % "jetty-webapp" % "7.1.0.v20100505" % "test",
"org.squeryl" % "squeryl_2.8.0.Beta1" % "0.9.4beta2") ++
super.libraryDependencies

I actually need jetty at compile-time, so when the JARs are copied to /
lib_managed/scala_2.8.0.RC2/compile/, the code compiles and a jetty-
run fails with the trace posted earlier in his thread. When I
additionally copy jetty to test then it fails with:

[info] == jetty-run ==
2010-05-15 15:56:29.643:INFO::Logging to StdErrLog::DEBUG=false via
org.eclipse.jetty.util.log.StdErrLog
Exception in thread "Scanner-0" java.lang.AbstractMethodError:
sbt.jetty.LazyJettyRun7$JettyLogger.debug(Ljava/lang/String;[Ljava/
lang/Object;)V
at org.eclipse.jetty.util.log.Log.debug(Log.java:169)
at
org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:354)
at org.eclipse.jetty.util.Scanner.scan(Scanner.java:306)
at org.eclipse.jetty.util.Scanner$1.run(Scanner.java:258)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
java.lang.AbstractMethodError:
sbt.jetty.LazyJettyRun7$JettyLogger.warn(Ljava/lang/String;[Ljava/lang/
Object;)V
at org.eclipse.jetty.util.log.Log.warn(Log.java:233)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.setFailed(AbstractLifeCycle.java:
202)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
65)
at sbt.jetty.LazyJettyRun7$.apply(LazyJettyRun7.scala:96)
at sbt.JettyRunner.runJetty$1(WebApp.scala:49)
at sbt.JettyRunner.apply(WebApp.scala:58)
at sbt.WebScalaProject$$anonfun$jettyRunTask
$1.apply(ScalaProject.scala:372)
at sbt.WebScalaProject$$anonfun$jettyRunTask
$1.apply(ScalaProject.scala:372)
at sbt.TaskManager$Task.invoke(TaskManager.scala:62)
at sbt.impl.RunTask.doRun$1(RunTask.scala:77)
at sbt.impl.RunTask.runTask(RunTask.scala:85)
at sbt.impl.RunTask.sbt$impl$RunTask$
$runIfNotRoot(RunTask.scala:60)
at sbt.impl.RunTask$$anonfun$runTasksExceptRoot
$2.apply(RunTask.scala:48)
at sbt.impl.RunTask$$anonfun$runTasksExceptRoot
$2.apply(RunTask.scala:48)
at sbt.Distributor$Run$Worker$$anonfun
$2.apply(ParallelRunner.scala:131)
at sbt.Distributor$Run$Worker$$anonfun
$2.apply(ParallelRunner.scala:131)
at sbt.Control$.trapUnit(Control.scala:19)
at sbt.Distributor$Run$Worker.run(ParallelRunner.scala:131)
[info] == jetty-run ==
[error] Error running jetty-run: Error running Jetty:
java.lang.AbstractMethodError:
sbt.jetty.LazyJettyRun7$JettyLogger.warn(Ljava/lang/String;[Ljava/lang/
Object;)V
[info]

And when I tried to copy jetty manually and include it:

[error] found : java.lang.String
[error] required: ?{val *: ?}
[error] Note that implicit conversions are not applicable because they
are ambiguous:
[error] both method path in trait Project of type (String)sbt.Path
[error] and method stringWrapper in object Predef of type
(String)scala.runtime.RichString
[error] are possible conversion functions from java.lang.String to ?
{val *: ?}
[error] override def jettyClasspath = "jetty-libs" * "*.jar"
[error] ^
[error] one error found

Mark Harrah

unread,
May 15, 2010, 10:46:24 PM5/15/10
to simple-b...@googlegroups.com
Here there is the unfortunate collision with RichString's *, so just do path("jetty-libs") * "*.jar" to force it to be a Path. This is indeed the way it has to be done, though.

If you want to keep it managed, put it in a special 'jetty' configuration as well:

val jettyConf = conf("jetty")
val jettyDep = "org.eclipse.jetty" % "jetty-webapp" % "7.1.0.v20100505" % "compile->default,jetty->default"
override def jettyClasspath = managedClasspath(jettyConf)

(overriding libraryDependencies like you do above is of course fine)

Perhaps this approach should be the normal way of doing it as it is cleaner. sbt could handle the first and third line itself, you'd just need to add jetty to the 'jetty' configuration (I can't remember if the ->default parts are necessary.)

-Mark

foo

unread,
May 16, 2010, 9:24:15 AM5/16/10
to simple-build-tool
On May 16, 4:46 am, Mark Harrah <dmhar...@gmail.com> wrote:
> On Saturday 15 May 2010, foo wrote:
> If you want to keep it managed, put it in a special 'jetty' configuration as well:
>
>   val jettyConf = conf("jetty")

[error] val jettyConf = conf("jetty")
[error] ^
[error] one error found
Compilation failed

I'm using SBT 0.7.3.

>   val jettyDep = "org.eclipse.jetty" % "jetty-webapp" % "7.1.0.v20100505" % "compile->default,jetty->default"
>   override def jettyClasspath = managedClasspath(jettyConf)
>
> (overriding libraryDependencies like you do above is of course fine)
>
> Perhaps this approach should be the normal way of doing it as it is cleaner.  sbt could handle the first and third line itself, you'd just need to add jetty to the 'jetty' configuration (I can't remember if the ->default parts are necessary.)

Mark Harrah

unread,
May 16, 2010, 9:26:45 AM5/16/10
to simple-b...@googlegroups.com
On Sunday 16 May 2010, foo wrote:
> On May 16, 4:46 am, Mark Harrah <dmhar...@gmail.com> wrote:
> > On Saturday 15 May 2010, foo wrote:
> > If you want to keep it managed, put it in a special 'jetty' configuration as well:
> >
> > val jettyConf = conf("jetty")
>
> [error] val jettyConf = conf("jetty")
> [error] ^
> [error] one error found
> Compilation failed
>
> I'm using SBT 0.7.3.

'config', sorry.

-Mark
Message has been deleted

Jarod Liu

unread,
May 18, 2010, 4:32:36 AM5/18/10
to simple-build-tool
I encounter the same problem. Can I use jetty 6.1 for jetty-run. It's
a lot better if one can choose the version they want. I don't like
different versions between production/development environment

foo

unread,
May 18, 2010, 6:58:04 AM5/18/10
to simple-build-tool


On May 16, 3:26 pm, Mark Harrah <dmhar...@gmail.com> wrote:
> On Sunday 16 May 2010, foo wrote:
>
> > On May 16, 4:46 am, Mark Harrah <dmhar...@gmail.com> wrote:
> > > On Saturday 15 May 2010, foo wrote:
> > > If you want to keep it managed, put it in a special 'jetty' configuration as well:
>
> > >   val jettyConf = conf("jetty")
>
> > [error] val jettyConf = conf("jetty")
> > [error]                 ^
> > [error] one error found
> > Compilation failed
>
> > I'm using SBT 0.7.3.
>
> 'config', sorry.

I am surprised that now there are no jetty jars nowhere in the
project, it compiles anyway but doesn't start because
NoClassDefFound...?!

Mark Harrah

unread,
May 18, 2010, 7:52:12 AM5/18/10
to simple-b...@googlegroups.com
On Tuesday 18 May 2010, foo wrote:
>
> On May 16, 3:26 pm, Mark Harrah <dmhar...@gmail.com> wrote:
> > On Sunday 16 May 2010, foo wrote:
> >
> > > On May 16, 4:46 am, Mark Harrah <dmhar...@gmail.com> wrote:
> > > > On Saturday 15 May 2010, foo wrote:
> > > > If you want to keep it managed, put it in a special 'jetty' configuration as well:
> >
> > > > val jettyConf = conf("jetty")
> >
> > > [error] val jettyConf = conf("jetty")
> > > [error] ^
> > > [error] one error found
> > > Compilation failed
> >
> > > I'm using SBT 0.7.3.
> >
> > 'config', sorry.
>
> I am surprised that now there are no jetty jars nowhere in the
> project, it compiles anyway but doesn't start because
> NoClassDefFound...?!

val jettyConf = config("jetty")
val jettyDep = "org.eclipse.jetty" % "jetty-webapp" % "7.1.0.v20100505" % "compile,jetty"
override def jettyClasspath = managedClasspath(jettyConf)

Apparently the "->default" part wasn't right. However, even with that, there is an AbstractMethodError because the org.eclipse.jetty.util.log.Logger interface seems to have acquired additional methods in the version you are using. A quick search doesn't turn up API docs for that version. If you can link to them, I can implement the new methods.

foo

unread,
May 18, 2010, 7:56:06 AM5/18/10
to simple-build-tool


On May 18, 12:58 pm, foo <timo.nent...@gmail.com> wrote:
> On May 16, 3:26 pm, Mark Harrah <dmhar...@gmail.com> wrote:
>
>
>
>
>
> > On Sunday 16 May 2010, foo wrote:
>
> > > On May 16, 4:46 am, Mark Harrah <dmhar...@gmail.com> wrote:
> > > > On Saturday 15 May 2010, foo wrote:
> > > > If you want to keep it managed, put it in a special 'jetty' configuration as well:
>
> > > >   val jettyConf = conf("jetty")
>
> > > [error] val jettyConf = conf("jetty")
> > > [error]                 ^
> > > [error] one error found
> > > Compilation failed
>
> > > I'm using SBT 0.7.3.
>
> > 'config', sorry.
>
> I am surprised that now there are no jetty jars nowhere in the
> project, it compiles anyway but doesn't start because
> NoClassDefFound...?!

Hmm, so I browsed some documentation and added some verbosity:

val jettyConf = config("jetty")
val jettyDep = "org.eclipse.jetty" % "jetty-webapp" %
"7.1.0.v20100505" % "compile->default,jetty->default"
override def jettyClasspath = managedClasspath(jettyConf)
lazy val print = task { log.info(managedClasspath(config("jetty"))
toString); None }

unmangedClasspath prints everything I put into /lib,
managedClasspath(config("compile")) prints all dependencies (without
jetty), and the line above prints nothing. jettyClasspath is the
classpath jetty is started with, right? So, it's started with an empty
classpath. Apparently there's something wrong with "compile-
>default,jetty->default" although I do understand the documentation
the same way. Hm, I'm at my wits' end. Advice anyone?

foo

unread,
May 18, 2010, 7:59:37 AM5/18/10
to simple-build-tool


On May 18, 1:52 pm, Mark Harrah <dmhar...@gmail.com> wrote:
> On Tuesday 18 May 2010, foo wrote:
>
>
>
>
>
>
>
> > On May 16, 3:26 pm, Mark Harrah <dmhar...@gmail.com> wrote:
> > > On Sunday 16 May 2010, foo wrote:
>
> > > > On May 16, 4:46 am, Mark Harrah <dmhar...@gmail.com> wrote:
> > > > > On Saturday 15 May 2010, foo wrote:
> > > > > If you want to keep it managed, put it in a special 'jetty' configuration as well:
>
> > > > >   val jettyConf = conf("jetty")
>
> > > > [error] val jettyConf = conf("jetty")
> > > > [error]                 ^
> > > > [error] one error found
> > > > Compilation failed
>
> > > > I'm using SBT 0.7.3.
>
> > > 'config', sorry.
>
> > I am surprised that now there are no jetty jars nowhere in the
> > project, it compiles anyway but doesn't start because
> > NoClassDefFound...?!
>
> val jettyConf = config("jetty")
> val jettyDep = "org.eclipse.jetty" % "jetty-webapp" % "7.1.0.v20100505" % "compile,jetty"
> override def jettyClasspath = managedClasspath(jettyConf)
>
> Apparently the "->default" part wasn't right.

"test->default":
http://code.google.com/p/simple-build-tool/wiki/ManagedConfigurations

But I still have the same NoDefFound with "compile,jetty"
thought...and calling my custom print task (see my other posting)
still outputs an empty classpath.

Mark Harrah

unread,
May 18, 2010, 7:58:21 AM5/18/10
to simple-b...@googlegroups.com
On Tuesday 18 May 2010, Jarod Liu wrote:
> I encounter the same problem. Can I use jetty 6.1 for jetty-run. It's
> a lot better if one can choose the version they want. I don't like
> different versions between production/development environment

You can use Jetty 6 or 7.

-Mark

Mark Harrah

unread,
May 18, 2010, 8:06:38 AM5/18/10
to simple-b...@googlegroups.com
On Tuesday 18 May 2010, foo wrote:
>
> On May 18, 1:52 pm, Mark Harrah <dmhar...@gmail.com> wrote:
> > On Tuesday 18 May 2010, foo wrote:
> >
> >
> >
> >
> >
> >
> >
> > > On May 16, 3:26 pm, Mark Harrah <dmhar...@gmail.com> wrote:
> > > > On Sunday 16 May 2010, foo wrote:
> >
> > > > > On May 16, 4:46 am, Mark Harrah <dmhar...@gmail.com> wrote:
> > > > > > On Saturday 15 May 2010, foo wrote:
> > > > > > If you want to keep it managed, put it in a special 'jetty' configuration as well:
> >
> > > > > > val jettyConf = conf("jetty")
> >
> > > > > [error] val jettyConf = conf("jetty")
> > > > > [error] ^
> > > > > [error] one error found
> > > > > Compilation failed
> >
> > > > > I'm using SBT 0.7.3.
> >
> > > > 'config', sorry.
> >
> > > I am surprised that now there are no jetty jars nowhere in the
> > > project, it compiles anyway but doesn't start because
> > > NoClassDefFound...?!
> >
> > val jettyConf = config("jetty")
> > val jettyDep = "org.eclipse.jetty" % "jetty-webapp" % "7.1.0.v20100505" % "compile,jetty"
> > override def jettyClasspath = managedClasspath(jettyConf)
> >
> > Apparently the "->default" part wasn't right.
>
> "test->default":
> http://code.google.com/p/simple-build-tool/wiki/ManagedConfigurations

Yes, but there are multiple configurations here and I forgot the right syntax (it is defined by Ivy). It would be "compile->default; jetty->default" with a ';' instead of a ',' if we include the "->default" part, but it isn't necessary anyway.

> But I still have the same NoDefFound with "compile,jetty"
> thought...and calling my custom print task (see my other posting)
> still outputs an empty classpath.

Did you run 'update' ? I actually ran what I posted this time and it works for me.

-Mark

foo

unread,
May 19, 2010, 8:11:28 AM5/19/10
to simple-build-tool
Oops, nope :) Yes, do get that java.lang.AbstractMethodError now as
well...:-\

foo

unread,
May 19, 2010, 9:24:49 AM5/19/10
to simple-build-tool


On May 18, 1:52 pm, Mark Harrah <dmhar...@gmail.com> wrote:
> On Tuesday 18 May 2010, foo wrote:
>
>
>
>
>
>
>
> > On May 16, 3:26 pm, Mark Harrah <dmhar...@gmail.com> wrote:
> > > On Sunday 16 May 2010, foo wrote:
>
> > > > On May 16, 4:46 am, Mark Harrah <dmhar...@gmail.com> wrote:
> > > > > On Saturday 15 May 2010, foo wrote:
> > > > > If you want to keep it managed, put it in a special 'jetty' configuration as well:
>
> > > > >   val jettyConf = conf("jetty")
>
> > > > [error] val jettyConf = conf("jetty")
> > > > [error]                 ^
> > > > [error] one error found
> > > > Compilation failed
>
> > > > I'm using SBT 0.7.3.
>
> > > 'config', sorry.
>
> > I am surprised that now there are no jetty jars nowhere in the
> > project, it compiles anyway but doesn't start because
> > NoClassDefFound...?!
>
> val jettyConf = config("jetty")
> val jettyDep = "org.eclipse.jetty" % "jetty-webapp" % "7.1.0.v20100505" % "compile,jetty"
> override def jettyClasspath = managedClasspath(jettyConf)
>
> Apparently the "->default" part wasn't right.  However, even with that, there is an AbstractMethodError because the org.eclipse.jetty.util.log.Logger interface seems to have acquired additional methods in the version you are using.  A quick search doesn't turn up API docs for that version.  If you can link to them, I can implement the new methods.

http://www.jarvana.com/jarvana/view/org/eclipse/jetty/jetty-util/7.1.0.v20100505/jetty-util-7.1.0.v20100505-javadoc.jar!/index.html
(via http://www.jarvana.com/jarvana/doc?search_type=javadoc_project&project=jetty+5&start=100)

Jarod Liu

unread,
May 20, 2010, 8:35:20 AM5/20/10
to simple-build-tool
Yes. After I add the jetty 7 dependencies( I had add jetty 6 before)
found jetty-run actually running jetty 6. But I don't understand why
jetty 7 dependencies is need

On May 18, 7:58 pm, Mark Harrah <dmhar...@gmail.com> wrote:
> On Tuesday 18 May 2010, Jarod Liu wrote:
>
> > I encounter the same problem. Can I usejetty6.1 forjetty-run. It's
> > a lot better if one can choose the version they want. I don't like
> > different versions between production/development environment
>
> You can useJetty6 or 7.
>
> -Mark
>
>
>
>
>
> > On Apr 4, 11:59 pm, Maxime Lévesque <maxime.leves...@gmail.com> wrote:
> > >  Hi everyone, I includedJettyas a dependency in a DefaultWebProject,
>
> > > when I do an 'update' it doesn't get downloaded like other
> > > dependencies, and
> > > and when I do 'jetty-run', I get a java.lang.NoClassDefFoundError: org/
> > > eclipse/jetty/server/Connector.
>
> > >  I have tried clean-lib, clean-cache and many things without success.
>
> > > Here's my build definition :
>
> > > sbt.version=0.7.2
> > > project.version=0.0.1
> > > def.scala.version=2.7.7
> > > build.scala.versions=2.8.0.Beta1-RC8
> > > project.initialize=false
>
> > >  Thanks !
>
> > > class GwtBuild(info: ProjectInfo) extends DefaultWebProject(info) {
>
> > >   val h2 = "com.h2database" % "h2" % "1.2.127"
>
> > >   val jetty7 = "org.eclipse.jetty" % "jetty-project" % "7.0.2.RC0" %
> > > "test"  //jettyis only need for testing
>
> > > //  val jetty7 = "org.eclipse.jetty" % "jetty-project" % "7.0.2.RC0"
>
> > > // val jetty6 = "org.mortbay.jetty" % "jetty" % "6.1.14" % "test"  //
> > >jettyis only need for testing
>
> > > //  valjetty= "org.mortbay.jetty" % "jetty" % "6.1.18" % "test-
>
> > > >default"
> > > }
>
> --
> You received this message because you are subscribed to the Google Groups "simple-build-tool" group.To post to this group, send email tosimple-...@googlegroups.com.To unsubscribe from this group, send email tosimple-build-...@googlegroups.com.

Mark Harrah

unread,
May 22, 2010, 8:55:52 AM5/22/10
to simple-b...@googlegroups.com
On Thursday 20 May 2010, Jarod Liu wrote:
> Yes. After I add the jetty 7 dependencies( I had add jetty 6 before)
> found jetty-run actually running jetty 6. But I don't understand why
> jetty 7 dependencies is need

Jetty 6 should work fine. If you are having problems, please post a small project definition that doesn't work.

Thanks,
Mark

Michael Fortin

unread,
May 24, 2010, 10:33:29 AM5/24/10
to simple-b...@googlegroups.com
Hi,
I see in the docs where I can change the source directories, but is it possible to change where the sbt build configuration (project) directory is? I'd like to use [myPorject]/.project. I want to share the '.project' with other hidden resources. Similarly, Is there a list of options on the sbt-launch.jar somewhere?

Thanks,
Mike
Reply all
Reply to author
Forward
0 new messages