Pushing play 2.0.x app to Heroku issue - deployment

I'm trying to push a locally working app to Heroku but i'm getting this error
[info] Compiling 20 Scala sources and 12 Java sources to /tmp/build_mhfyee4j841a/target/scala-2.9.1/classes...
[error] /tmp/build_mhfyee4j841a/target/scala-2.9.1/src_managed/main/views/html/showitem.template.scala:74: value showItem is not a member of controllers.ReverseApplication
[error]
[error] ^
[error] one error found
[error] {file:/tmp/build_mhfyee4j841a/}quoiacheter/compile:compile: Compilation failed
[error] Total time: 25 s, completed Dec 8, 2012 8:07:38 PM
! Failed to build app with sbt
! Heroku push rejected, failed to compile Play 2.0 - java app
as i said before the app is running fine locally and you can see here the part that's supposed to have an error in showitem template
<p>
#for(p <- Items.getRelated(item.categories.get(0).id) ) {
}
</p>
Heroku think that i'm calling #routes.Application.showItem instead of #routes.Items.showItem ! you can see here the concerned part of my routes file:
...
# ITEMS
GET /items/:id/:title controllers.Items.showItem(id: Long,title: String)
...

The only reason this should happen is if your git repository is not up to date and somehow in the git repo is calling Application, not Items. Please check you really committed your changes to git locally.

Related

PlayFramework - Creating Scala seed template with sbt

I am attempting to create the PlayFramework Scala seed project.
So far I've used sbt new playframework/play-scala-seed.g8 command and it has created the necessary files within my root directory movie-app.
From this point, PlayFramework says to run sbt run, so I tried that, but I get the following error:
[info] Updated file *omitting personal directories*/Movie-App/project/build.properties: set sbt.version to 1.4.7
[info] welcome to sbt 1.4.7 (Ubuntu Java 11.0.10)
[info] loading project definition from *omitting personal directories*/Movie-App/project
[info] set current project to movie-app (in build file:*omitting personal directories*/Movie-App/)
[error] java.lang.RuntimeException: No main class detected.
[error] at scala.sys.package$.error(package.scala:30)
[error] stack trace is suppressed; run last Compile / bgRun for the full output
[error] (Compile / bgRun) No main class detected.
[error] Total time: 0 s, completed Jul 2, 2021, 11:27:33 PM
I haven't found anything helpful online yet.
Do I need to set the current project to "movie-app" like the error says? If so what do I need to write in the build.properties file?
If not, can anyone please explain the issue?
Thanks
$> sbt new playframework/play-scala-seed.g8
This template generates a Play Scala project.
Give it a name when asked. Skip rest by pressing enter.
name [play-scala-seed]: movie-app
$> cd movie-app
$> sbt run

Unable to run the gatling test (jvm issue)

I am trying to run the gatling test on MacOS.
Java version: openjdk version "1.8.0_275"
scala version: 2.12.12
sbt version :1.4.4
I am unable to run my tests because of this error. I have tried changing the java versions(recommended one) and tried reinstalling the sbt as well.
The error log is as follows:
Unrecognized VM option 'AggressiveOpts'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
[error] Could not accept connection from test agent: class java.net.SocketException: Socket closed
[error] java.net.SocketException: Socket closed
[error] at java.base/sun.nio.ch.NioSocketImpl.endAccept(NioSocketImpl.java:689)
[error] at java.base/sun.nio.ch.NioSocketImpl.accept(NioSocketImpl.java:762)
[error] at java.base/java.net.ServerSocket.implAccept(ServerSocket.java:684)
[error] at java.base/java.net.ServerSocket.platformImplAccept(ServerSocket.java:650)
[error] at java.base/java.net.ServerSocket.implAccept(ServerSocket.java:626)
[error] at java.base/java.net.ServerSocket.implAccept(ServerSocket.java:583)
[error] at java.base/java.net.ServerSocket.accept(ServerSocket.java:540)
[error] at sbt.ForkTests$Acceptor$1$.run(ForkTests.scala:71)
[error] at java.base/java.lang.Thread.run(Thread.java:832)
I would appreciate your feedback on this. Thank you.
There's no way you're using Java 8 as indicated, as your stacktrace clearly shows Jigsaw modules (java.base/). You're using Java 9 or older.
What happens is that the test forked JVM crashes on boot because it's being passed the AggressiveOpts option that was dropped after Java 8.
This option was removed in recent versions of Gatling's sbt plugin, meaning that you're using an older version.
In short: update your sbt plugin version.

can't push spring boot application repository from github to heroku

I created a spring boot application in eclipse with just web dependency, and a single template I called index.html.
I managed to push my application to github, but It failed to push to Heroku,
It gave me this log error
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project hanoiproject12: Fatal error compiling: invalid target release: 11 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
! ERROR: Failed to build app with Maven
We're sorry this build is failing! If you can't find the issue in application code,
please submit a ticket so we can help: https://help.heroku.com/
! Push rejected, failed to compile Java app.
! Push failed

error while loading <root>, Error accessing .ivy2/cache/org.apache.spark/spark-core_2.11/jars/spark-core_2.11-1.4.0.jar

While following an example to deploy an application in Spark, I keep getting the error below while "compile" in sbt.
[info] Updating {file:/home/sankalp/Desktop/spark/SVMexample/}svmexample...
[info] Resolving com.sun.jersey.jersey-test-framework#jersey-test-framework-grizzl[info] Resolving jline#jline;2.12.1 ...
[info] Done updating.
[info] Compiling 1 Scala source to /home/sankalp/Desktop/spark/SVMexample/target/scala-2.11/classes...
[error] error while loading <root>, Error accessing /home/sankalp/.ivy2/cache/org.apache.spark/spark-core_2.11/jars/spark-core_2.11-1.4.0.jar
[trace] Stack trace suppressed: run last compile:compileIncremental for the full output.
[error] (compile:compileIncremental) scala.reflect.internal.MissingRequirementError: object java.lang.Object in compiler mirror not found.
[error] Total time: 21 s, completed Aug 16, 2015 2:36:53 AM
Can anyone help?
Thanks,
I am no expert, but in my case it helped editing:
project/Versions.scala -> val Spark = "1.4.0" -> "1.4.1".
Although it is actually a mystery to me why it did help :).
EDIT:
On the second thought i've noticed by accident, that the file spark-core_2.11-1.4.0.jar was broken (each time it was downloaded by sbt).
It also helped to replacing .jar with valid one from:
http://mvnrepository.com/artifact/org.apache.spark/spark-core_2.11/1.4.0
I suppose it is somehow connected with spark-cassandra-connector build system or repo from which file is downloaded.
Maybe we should file an issue.
EDIT2:
i found out, that broken .jar comes from (at least in my case):
https://jcenter.bintray.com/org/apache/spark/spark-core_2.11/1.4.0/spark-core_2.11-1.4.0.jar
you can see its origin in: .ivy2/cache/org.apache.spark/spark-core_2.11/ivydata-1.4.0.properties
i did not manage to find out why it comes from jcenter (https://bintray.com/bintray/jcenter). maybe it is somehow connected with adding bintray repo to my linux mint or new version of sbt or datastax uses bintray. i will probably investigate later.
The previous suggestions seemed very specific to a particular use case. My solution is inefficient, brute force, but was effective:
Reinstall IntelliJ completely

how to get more debugging for sbt compile error? "MethodHandle not found"

Attempting to sbt compile a branch of my project ENSIME (experiment if you're interested) under Java 6 is giving a bizarre compiler warning:
[info] Compiling 48 Scala sources to /home/fommil/Projects/ensime-server/target/scala-2.11/classes...
[error] Class java.lang.invoke.MethodHandle not found - continuing with a stub.
[error] two errors found
[error] (compile:compile) Compilation failed
[error] Total time: 18 s, completed 03-Sep-2014 22:57:44
It works under Java 7.
Calling last reveals nothing more than the classpath of the compile (this would be equivalent to setting --debug level).
I've removed all the plugins from the project, and the problem still shows.
If I remove all my code - leaving just the build system and dependencies - with some stub scala entry points then there is no problem.
However, I can't exactly bisect my source code file because then it doesn't compile.
When the code is compiled, a grep (including binaries) of MethodHandle doesn't give any hits (although there is a jdk8 file in the tests resources, it is not relevant because the problem appears if it is removed).
It is only one (big) patch that has caused the problem (the previous commit compiles ok).
How can I debug this further in sbt? it doesn't want to give any more info
is this a known problem, or can anyone make an informed guess what is going on?
It turns out that this was caused by pulling in Lucene, which requires Java 7.
A bit of an epic message fail from sbt: there doesn't appear to be any way to get it to output anything sensible.