Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No main class detected. #133

Closed
0xAX opened this issue Apr 18, 2014 · 9 comments

Comments

@0xAX
Copy link

commented Apr 18, 2014

Hello,

I created simple sbt application and added finatra to the dependencies. And simple code:

package com.mixer

import com.twitter.finatra._
import com.twitter.finatra.ContentType
import com.twitter.finatra.FinatraServer

class App extends FinatraServer {

  class ExampleApp extends Controller {

    get("/") { request =>
      render.static("index.html").toFuture
    }

    register(new ExampleApp())
  }
}

And now i have 2 problems:

  1. I execute sbt run and got:
java.lang.RuntimeException: No main class detected.
    at scala.sys.package$.error(package.scala:27)
[trace] Stack trace suppressed: run last compile:run for the full output.
[error] (compile:run) No main class detected.
[error] Total time: 0 s, completed 19.04.2014 0:30:32
  1. I executed sbt assembly and got:
[trace] Stack trace suppressed: run last *:assembly for the full output.
[error] (*:assembly) deduplicate: different file contents found in the following:
[error] public/index.html
[error] /home/alex/.ivy2/cache/com.twitter/finatra_2.10/jars/finatra_2.10-1.5.3.jar:public/index.html
[error] Total time: 5 s, completed 19.04.2014 0:30:51

How can i fix it?

Thank you.

@0xAX

This comment has been minimized.

Copy link
Author

commented Apr 18, 2014

UPD First problem solved.

@capotej

This comment has been minimized.

Copy link
Contributor

commented Apr 18, 2014

  1. register needs to be called on the FinatraServer class, not the
    Controller

  2. not sure what's wrong here, please check out
    https://github.com/capotej/finatra-example for a fully working finatra
    example

On Fri, Apr 18, 2014 at 11:44 AM, 0xAX notifications@github.com wrote:

UPD* First problem solved.


Reply to this email directly or view it on GitHubhttps://github.com//issues/133#issuecomment-40833561
.

Julio Capote

@0xAX

This comment has been minimized.

Copy link
Author

commented Apr 18, 2014

@capotej yep, thank you, first problem solved. Searing second problem.

Also i got another problem. I have now successfully launched project and i have route there:

get("/hello") { request =>
      render.static("index.html").toFuture
    }

I have index.html in src/main/resources/public But when i'm openning /hello in browser i see 'Not found'

@capotej

This comment has been minimized.

Copy link
Contributor

commented Apr 18, 2014

Hmmm, try /index.html ?

On Fri, Apr 18, 2014 at 12:05 PM, 0xAX notifications@github.com wrote:

@capotej https://github.com/capotej yep, thank you, first problem
solved. Searing second problem.

Also i got another problem. I have now successfully launched project and i
have route there:

get("/hello") { request =>
render.static("index.html").toFuture
}

I have index.html in src/main/resources/public But when i'm openning
/hello in browser i see 'Not found'


Reply to this email directly or view it on GitHubhttps://github.com//issues/133#issuecomment-40835335
.

Julio Capote

@0xAX

This comment has been minimized.

Copy link
Author

commented Apr 18, 2014

Hmmm, try /index.html ?

The same: Not found

@0xAX

This comment has been minimized.

Copy link
Author

commented Apr 18, 2014

But http://localhost:7070/index.html works perfectly

@0xAX

This comment has been minimized.

Copy link
Author

commented Apr 18, 2014

Second problem solved, still only problem with index.html serving.

@0xAX

This comment has been minimized.

Copy link
Author

commented Apr 19, 2014

Af i found error. I registered my App in the App class, not in FinatraServer.

@capotej thank you for the help

@0xAX 0xAX closed this Apr 19, 2014

@pvoznenko

This comment has been minimized.

Copy link

commented Oct 23, 2014

Hi guys,

By running command $ sbt assembly I got:

[error] (*:assembly) deduplicate: different file contents found in the following:
[error] public/index.html
[error] /Users/pavlo/.ivy2/cache/com.twitter/finatra_2.10/jars/finatra_2.10-1.5.2.jar:public/index.html
[error] Total time: 7 s, completed Oct 23, 2014 12:26:51 PM

Do not know where I made mistake, could you please help? My repo with project: https://github.com/fosco-maestro/finatra-angular-example

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.