setting up example: Error: Could not find or load main class

405 views
Skip to first unread message

Jeff Dyke

unread,
Dec 22, 2015, 12:07:35 PM12/22/15
to scalatra-user
I have tried on java7 and java8, both with 2.3.1 and 2.4, so i must be doing something stupid, but each time i run a console start i get the same error which does not start the server, at least nothing is listening on 8080

Error: Could not find or load main class

In this latest set up scalatra, i just took the defaults

jeff@macsrv:services jeff$ g8 scalatra/scalatra-sbt
organization [com.example]:
name [My Scalatra Web App]:
version [0.1.0-SNAPSHOT]:
servlet_name [MyScalatraServlet]:
package [com.example.app]:
scala_version [2.11.7]:
sbt_version [0.13.9]:
scalatra_version [2.4.0]:

jeff@macsrv:services jeff$ cd ./my-scalatra-web-app/
jeff@macsrv:services jeff$ ./sbt

Detected sbt version 0.13.9
Starting sbt: invoke with -help for other options
Using /Users/jeff/.sbt/0.13.9 as sbt dir, -sbt-dir to override.
[info] Loading project definition from /src/services/my-scalatra-web-app/project
[info] Set current project to My Scalatra Web App (in build file:/src/services/my-scalatra-web-app/)
> container:start
[info] Updating {file:/src/services/my-scalatra-web-app/}my-scalatra-web-app...
[info] Resolving org.scala-lang.modules#scala-parser-combinators_2.11;1.0.1 ...
[info] Done updating.
[info] Compiling Templates in Template Directory: /src/services/my-scalatra-web-app/src/main/webapp/WEB-INF/templates
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
[info] Compiling 5 Scala sources to /src/services/my-scalatra-web-app/target/scala-2.11/classes...
[info] Packaging /src/services/my-scalatra-web-app/target/scala-2.11/my-scalatra-web-app_2.11-0.1.0-SNAPSHOT.jar ...
[info] Done packaging.
[info] starting server ...
[success] Total time: 7 s, completed Dec 22, 2015 12:01:08 PM
> Error: Could not find or load main class

Any ideas/hints are greatly appreciated!

Jeff

Jeff Dyke

unread,
Dec 28, 2015, 10:12:00 PM12/28/15
to scalatra-user
The example simply did not work for me so (days ago), i just started writing code :)

Shaohong Li

unread,
Feb 8, 2016, 10:55:33 AM2/8/16
to scalatra-user
Hope you've got over this problem now. Funny enough I've met the same issue today and after some careful reading of the http://www.scalatra.org/2.4/getting-started/first-project.html page, it actually says
 
> "jetty:start"

not the old "container:start"

Shaohong

Raghavan alias Saravanan M

unread,
May 20, 2016, 7:06:49 AM5/20/16
to scalatra-user
This indeed saved my time today! :) Thanks Shaohong Li.
Message has been deleted

Hongwei

unread,
Jan 20, 2017, 12:49:05 PM1/20/17
to scalatra-user
Thanks to Shaohong

CookieMonster

unread,
Mar 14, 2017, 5:18:19 AM3/14/17
to scalatra-user
Hey, not sure who to contact or ask for help but a couple of the links on the scalatra.org site are broken (ERR_EMPTY_RESPONSE), and also I can't seem to access the above link either. Pretty sure its not my computer but please do let me know. 

Bruno Rezende

unread,
Mar 16, 2017, 10:54:26 AM3/16/17
to scalat...@googlegroups.com
Hi,

I'm experiencing the same problem. I just tried to access this one: http://www.scalatra.org/2.4/guides/http/requests-and-responses.html, from main site, and got <ERR_EMPTY_RESPONSE>

On 14 March 2017 at 06:18, CookieMonster <123456...@gmail.com> wrote:
Hey, not sure who to contact or ask for help but a couple of the links on the scalatra.org site are broken (ERR_EMPTY_RESPONSE), and also I can't seem to access the above link either. Pretty sure its not my computer but please do let me know. 

--
You received this message because you are subscribed to the Google Groups "scalatra-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalatra-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Bruno
Reply all
Reply to author
Forward
0 new messages