playframework 2.5.0 Template fail to compile (fresh one) - scala

I would like to get started with play running play 2.5...
but even installing the template with activator "play-java" has an error.
Using unsupported version of Play: 2.5.0
I have downloaded the full activator package and the minimal.
Both fail on 2 machines(JDK 73).
NO clue how to catch up on this, perhaps some could help me out. I would appreciate it very much.
Bets regards

Using 'activator ui', causes the activator to cycle. The error message is "Getting 'Using unsupported version of Play: 2.5.0'". The issue tracking the problem is https://github.com/typesafehub/activator/issues/1102.
Using 'activator' without the ui argument is a work-around.
Change directories to the play-java directory and running ./activator without the ui argument. This brings up the sbt command line. Sbt commands help, about, tasks, update, compile, test, and run work. A web browser pointed at localhost:9000 will contain a text field with "You're using Play 2.5.0" as content.
The "run" command starts a Netty server. Application interaction is possible using localhost:9000 in a web browser.

As a workaround you can create a project without the UI by using something like
activator new my-app play-scala

Play framework requires java 8 since 2.4 version
https://www.playframework.com/documentation/2.4.x/Migration24#Java-8-support

Related

Running an Erlang Application in Eclipse is throwing an exception

I have installed Erlang OTP 25.0, erlide 0.56.0, Eclipse 2022-09 & Java 18. I have created a new Erlang project and module. I am facing 2 issues.
Issue #1:
Getting an error when I tried to launch the Eclipse after creating the Erlang project.
Issue #2:
When I tried to run the application, I am getting an exception "Launching App1 has encountered a problem. An internal error occurred during launching App1. Expected the service OtpNodeProxy 5756dc#null FAILED to be running, but the service has FAILED" as shown in the screenshot ErlangRunConfigException. Please help me in resolving the issue.
I have followed the procedure given below.
Installed Eclipse and Erlide plugin
Installed Erlang OTP 25.0 from https://www.erlang.org/patches/otp-25.0
Updated the environment PATH to refer to the Erlang installation path. I cross-checked this setting by typing "werl".
In Eclipse, Erlang InstalledRuntimes is automatically updated with the Erlang version 25.0. Refer to the screenshot ErlangInstalledRuntime
Created a Erlang project and module.
Edited the Hello.erl with HelloWorld code.
In Eclipse->RunConfguration, created an ErlangApplication (refer to the screenshot RunConfig-ErlangApp-Erlang). I set RunTime and Node name as shown in the screenshot RunConfig-ErlangApp-Runtime. Selected the Windows PATH as shown in the screenshot RunConfig-ErlangApp-Environment.
Hello.erl
```
-module(hello).
-export([hello_world/0]).
hello_world() -> io:fwrite("hello, world\n").
```
Images:
ErlangRunConfigException.png
ErlangInstalledRuntime.png
RunConfig-ErlangApp-Environment.png
RunConfig-ErlangApp-Runtime.png
werl output
RunConfig-ErlangApp-Erlang.png
Project structure
Eclipse Launching Error
Unfortunately, Erlang 25 doesn't load beam files older than v21, and the files included in erlide are that old. I am not really maintaining the project anymore, I can try to rebuild with v25, but can make no promises. Even then, the debugger will no longer work, it can be good to note.
The reported issue is seen with the latest Erlang version 25.0 and the older versions I have checked till 23.0. As a workaround, I have migrated to IntelliJ IDE.

Timeout resolving sbt-plugin

I'm trying to run a simple play-scala example, but I've some problem launching activator because I have a lot of connection timeout. I've only created the application with activator and tried to launch it. No development or custom configuration. I'm using play 2.4.2.
It seems that many of the dependencies that it tries to resolve do not exist: if I try to open the url in browser I obtain only "The request path was not found".
Examples are the following:
https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.webjars/rjs/2.1.15/ivys/ivy.xml
https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-rjs/scala_2.10/sbt_0.13/1.0.7/ivys/ivy.xml
This behaviour wastes a lot of time without any value. Is it possible to avoid non-existing path or minimize connection timeout time?
Thanks,
Michele.
As suggested in the comment, please try the latest version of Play.
As of 2018, it's 2.6.16.

Doesn't work debug for play project in IDEA 14 Ultimate

I do following steps:
Import to IDEA Play project generated with Activator UI from Play Scala Seed template.
Create Run/Debug configuragion using standart "Play 2 App" template.
Add break point in my project.
Run debug and open page in a browser.
I can see in IDE console "play - Application started", and debugger tells me
"Connected to the target VM, address: '127.0.0.1:58354', transport: 'socket'"
But program execution doesn't stop at my break points. In a browser I can see
what a code for that I've made a break point is executed.
What's wrong with IDEA?
I use play version 2.3.9, and I start the play app from an IDEA ide not from a play console.
seems duplicate with :
How to run Play Framework 2.x in debug mode in IntelliJ IDEA?
Your first step seems wrong. Just open (and don't import) your project is enough from IntelliJ.

How to run GWT RequestFactory Validation Tool on Eclipse project

I've got a Android AppEngine Connected Project I'm trying to build using GWT2.4 RequestFactory and Objectify on my Eclipse IDE.
Apparently I need to run the RequestFactory Validation Tool because I'm using ServiceName and ProxyForName annotations (these are required especially when working on the Android client side). My problem is the Eclipse can't validate it and the solution provided at http://code.google.com/p/google-web-toolkit/wiki/RequestFactoryInterfaceValidation#IDE_configuration is enough to make me rip my eyes out.
Since I'm working on a Windows machine, the shell script provided is not very useful. Trying to run Validation Tool from a cmd propt returns the error message:"This tool must be run with a JDK, not a JRE"
Can someone explain how this Tool is supposed to be run? Is there a way to use it as an External Tool in eclipse?
Normally if you follow carefully the instructions in the link you show, and run the GWT Development Mode from Eclipse, the Validation should be done automatically at the time you access the development URL with your browser.
For the record, I've actually had some problems with it, but launching the application several times maked it work.
Well, I ran into the same problem as well. When I tried annotation processing (under Java Compiler-> Annotation processing )was being disabled. So RequestFactoryDeobfuscatorBuilder was not being generated. Try enabling that and rebuilding your project.
I've just recovered from two days of hunting this bug down in a project that used to run validation properly but stopped.
In my case I had a new-ish generic BaseRequestContext and a specific sub-interface that extended it. My parent interface declared a method that didn't match the Locator's exactly (e.g. getThing(T) vs get(T)) and this wasn't reported as an error but did stop the validation tool from completing.
Apt is also removed in Java 8 : http://openjdk.java.net/jeps/117 . So beware.
Switching back to Java 7 will fix the issue if you are using Java 8.
I understood why the error happens sometimes in a project: the compiler was complaining it cannot find the directory .apt . But when I tried to create it manually it was not possible (under windows). I think the validation tool mutes the exception of not being able to create the directory: try renaming .apt in your validation tool calls (do a text search in your project)

Vaadin - GWT error "module xxx may need to be recompiled

I'm ramping up on Vaadin and I'm getting this javascript alert whenever I try and run the demo apps.
GWT module 'com.vaadin.terminal.gwt.DefaultWidgetSet' may need to be recompiled
I've tried cleaning the project to no avail.
As I said, I'm ramping up so I'm sure there's some simple step I'm missing or a concept I haven't grasped.
I don't know anything about Vaadin, but there's a more general context in which this error occurs:
So long as you're testing in Eclipse, the dynamic coding of your app is still real Java coding being run in a JVM. This coding is made available through debugger that's accessible via a socket. You get a URL that looks like this:
http://127.0.0.1:8888/MyApp.html?gwt.codesvr=127.0.0.1:9997
with this codesvr thing being your eclipse-hosted debugger process for your Java code.
Before your app can run standalone, GWT has to translate your Java code to JavaScript; separate versions of the code are produced for each browser type (Firefox, WebKit, Opera, ...) and language that you want to support. Only once this is done can you access your app the usual way via
http://127.0.0.1:8888/MyApp.html
After weeks of running my app only in Eclipse, I'd managed to forget about the compiling-for-browsers step and wondered about the message. The way to fire up the compiler, if you're not using the Ant task, is to hit Google|GWT Compile in the project's context menu. That done, the JS in your app gets fleshed out and your app can run without Java on the client side.
And of course the message goes away.
It is a warning not an error. Does the app work? Otherwise you have to recompile the Vaadin widgetset. These might help too: http://vaadin.com/directory/help/using-vaadin-add-ons
Often this message meens:
you're missing the ?gwt.codesvr=127.0.0.1:9997 parameter in the URL (or have misspelled it).
your module uses the xs linker <add-linker name="xs" />. This is a known limitation and will be fixed in the future: Issue 4232: Allow Development Mode to work with XS Linker
You may need to clear the browser cache. It is possible that the compiled js that the browser is using is not the js that has most recently been compiled.
In Chrome you can see if the cached js is being used in the developer tools windows (ctrl + shift + i). In the size column it will say (from cache) instead of the actual size. You can then right click and clear the browser cache. ctrl + r to reload and the error should be gone.
Carl Smotricz is absolutely right.
Just Cleaning and Build Project on the topmost menu doesn't work.
You must use "Google | GWT Compile" on the context menu generated when right-clicking on your GWT project, prior to deployment.
The error may not be about not-adding "?gwt.codesvr=127.0.0.1:9997" at the end of host web page if he or she tried to deploy the GWT-based webapp on WAS external to Eclipse.
Server restart did the job for me.
I had tried clearing cache, clean and rebuild .. but i was still getting the same warning message.
Server restart made it reload all the stull from the latest compiled war.
It was a hit and trial and i am glad it worked :) :)