I am using play framework 2.4 and i am trying to send an email using play mailer plugin but keep getting this error:
[ClassNotFoundException: play.api.libs.mailer.CommonsMailerPlugin]
I asm using this dependenct:
"com.typesafe.play" %% "play-mailer" % "3.0.1"
And this plugin:
1500:play.api.libs.mailer.CommonsMailerPlugin
Any idea how to fix that?
I removed these lines in play.plugins file and clean the project (delete target and project folders) and it works for me.
Related
Scalavista, or Scala Syntax (official) - these are the Scala extensions I have.
I have in build.sbt e.g.
, "org.scalatra" %% "scalatra-json" % "latest.integration"
and when I write
import org.scalatra.json._
then it marks it as an error and says object scalatra is not a member of package org. And it's just one example, my code is full of red waves. And that's only in vscode; when I run the program from sbt, it compiles and works OK.
Shouldn't it be aware of the dependencies?
You should install the sbt-scalavista SBT plugin in order to let it generate the scalavista config for your project.
I have a Play project and need to add Swagger to it. Started following this guide: play-swagger and even did thealternative setup steps, but the swagger page is empty. Just a header appears on the page. Where should I look for mistakes or did I miss something?
Also, there is another guide: Swagger UI and Play Framework, but the sbt cannot resolve the given dependency. Does it need a specific resolver?
I've added this dependency:
"org.webjars" % "swagger-ui" % "2.2.0"
and this sbt plugin:
addSbtPlugin("com.iheart" %% "sbt-play-swagger" % "0.7.5")
(Play version 2.6, sbt version 1.x, Scala version 2.12.x)
There is a swagger.yml file in the conf folder. The contents of the Swagger UI dist folder is in the public/swagger folder. The routes file contains these lines:
### NoDocs ###
GET /docs/swagger-ui/*file controllers.Assets.at(path:String="/public/lib/swagger-ui", file:String)
### NoDocs ###
GET /assets/swagger.json controllers.swagger.ApiSpecs.specs
from alternative setup and the controller class specified in the same guide is also present. The Swagger UI index.hml contatins this line:
url: "http://localhost:9000/assets/swagger.json"
I'm trying to implement SOAP web service client in Play Framework. I found play-soap lib but I cannot find repository:
https://github.com/playframework/play-soap
http://downloads.typesafe.com/rp/play-soap/SbtWsdl.html
When I add sbt plugin addSbtPlugin("com.typesafe.play" % "play-soap-sbt" % "1.0") it returns:
Error:Unresolved dependencies: com.typesafe.play#play-soap-sbt;1.0: not found
How can I implement SOAP webservices in Play Framework (Scala)?
Go here and follow the install instructions. This is the open-sourced version of the plugin, and from the documentation it looks identical to the one in the official Play docs.
Essentially, add this to your project/plugins.sbt
resolvers += Resolver.url("play-sbt-plugins", url("https://dl.bintray.com/playframework/sbt-plugin-releases/"))(Resolver.ivyStylePatterns)
addSbtPlugin("com.typesafe.sbt" % "sbt-play-soap" % "1.1.3")
I have been trying to create a Play2 IntelliJ project file using the sbt-idea plugin.
I have added the line to my build.sbt file:
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.5.2")
However, since updating to the latest version of Play 2.2.1, I have been seeing the following error when trying to create project files:
[error] java.nio.charset.UnmappableCharacterException: Input length = 1
Has anyone else seen this error? It was working fine prior to updating my Play project to 2.2.1.
The latest version of IntelliJ IDEA 13 comes with "The new version of Scala plugin comes with built-in support for SBT" so you should be able to import the project without the plugin's help.
So after an hour or so of looking at colleague's codebases which WERE able to successfully generate the IntelliJ project files, I have updated the plugin details as follows to version 1.5.1 (rather than 1.5.2):
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.5.1")
And now it works again as expected. Has anyone else seen this issue with Play 2.2.1 and the plugin https://github.com/mpeltonen/sbt-idea ? Is there a better solution, or some other incompatibility I need to resolve?
I was following this tutorial to star using playframework2.1 RC1 + Slick.
When try launch the SoftwareSpec test (that tests Model-like class):
play test
they fail with an error like this:
[error] SQLException: No suitable driver found for
jdbc:h2:mem:test1 (DriverManager.java:190) [error]
SoftwareSpec$$anonfun$1$$anonfun$apply$3.apply(SoftwareSpec.scala:25)
[error]
SoftwareSpec$$anonfun$1$$anonfun$apply$3.apply(SoftwareSpec.scala:25)
But I've enabled h2 db in application.conf like was mentioned in that article.
I've used latest dependencies to slick, in Build.scala file:
"com.typesafe" % "slick_2.10.0-RC1" % "1.0.0-RC1"
Once, when I changed dependency to slick to this version:
"com.typesafe" % "slick_2.10.0-RC1" % "0.11.2"
then the test was passed successfully. But after I change the test to make it fail, the error came back again - "No suitable driver". And after this all my tries (like play clean whatever) were unsuccessful.
I got the same error when running tests on Travis CI.
A work around is loading JDBC driver class like Class.forName("org.h2.Driver").
https://github.com/seratch/scalikejdbc/blob/564cc07505d7a9f217945a7f2c07dc2c7460ed87/scalikejdbc-play-plugin/src/test/scala/scalikejdbc/PlayPluginSpec.scala#L15
Of course, I should investigate the reason of this issue and report to the Play team but I haven't done.
I'm not using Play at the moment, so I can't test the following, but it should be fine. For the latest Slick, you can use:
"com.typesafe" % "slick_2.10" % "1.0.0-RC1"
For h2, the following should work:
"com.h2database" % "h2" % "1.3.166"