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

minimum support for Play 2.5 #587

Closed
wants to merge 1 commit into from

Conversation

kildievr
Copy link

minimum support for Play 2.5

@kildievr kildievr mentioned this pull request Apr 12, 2016
@kildievr kildievr force-pushed the minimum_support_of_Play2.5 branch 2 times, most recently from f74a2f4 to e722092 Compare April 14, 2016 17:38
@kildievr kildievr force-pushed the minimum_support_of_Play2.5 branch from e722092 to be4079c Compare April 14, 2016 20:55
@lloydmeta
Copy link

👍

/**
* The default responses sent when the invoker is not authenticated or authorized to execute a protected
* action.
*
* @see securesocial.core.java.SecuredActionResponses
*/
public class DefaultSecuredActionResponses extends Controller implements SecuredActionResponses {
@Inject
play.api.i18n.Messages messages = null;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable messages, is of type Scala Messages, and later it seems not to be used. See line 48.

@zezuha
Copy link

zezuha commented May 27, 2016

@kildievr
I am a bit confused. When I try demo apps, both Java and Scala they fail:

ProvisionException: Unable to provision, see the following errors:

1) Could not find a suitable constructor in play.api.i18n.Messages. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.
  at play.api.i18n.Messages.class(Messages.scala:352)
  while locating play.api.i18n.Messages
    for field at controllers.Application.messages(Application.scala:25)
  while locating com.google.inject.Provider<controllers.Application>
    for parameter 1 at router.Routes.<init>(Routes.scala:40)
  while locating router.Routes
  while locating play.api.inject.RoutesProvider
  while locating play.api.routing.Router
    for parameter 0 at play.api.http.JavaCompatibleHttpRequestHandler.<init>(HttpRequestHandler.scala:200)
  while locating play.api.http.JavaCompatibleHttpRequestHandler
  while locating play.api.http.HttpRequestHandler
    for parameter 4 at play.api.DefaultApplication.<init>(Application.scala:221)
  at play.api.DefaultApplication.class(Application.scala:221)
  while locating play.api.DefaultApplication
  while locating play.api.Application

@odroz
Copy link

odroz commented May 28, 2016

Which version of Play do you use? From Play 2.4, they introduced injection.
Looks like it might be the cause of your error.

Le Friday, May 27, 2016, zezuha [email protected] a écrit :

@kildievr https://github.com/kildievr
I am a bit confused. When I try demo apps, both Java and Scala they fail:

ProvisionException: Unable to provision, see the following errors:

  1. Could not find a suitable constructor in play.api.i18n.Messages. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.
    at play.api.i18n.Messages.class(Messages.scala:352)
    while locating play.api.i18n.Messages
    for field at controllers.Application.messages(Application.scala:25)
    while locating com.google.inject.Provider<controllers.Application>
    for parameter 1 at router.Routes.(Routes.scala:40)
    while locating router.Routes
    while locating play.api.inject.RoutesProvider
    while locating play.api.routing.Router
    for parameter 0 at play.api.http.JavaCompatibleHttpRequestHandler.(HttpRequestHandler.scala:200)
    while locating play.api.http.JavaCompatibleHttpRequestHandler
    while locating play.api.http.HttpRequestHandler
    for parameter 4 at play.api.DefaultApplication.(Application.scala:221)
    at play.api.DefaultApplication.class(Application.scala:221)
    while locating play.api.DefaultApplication
    while locating play.api.Application


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#587 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AKpKAQB_iHDrgot4rRNAzuImJohHYTB9ks5qF1KQgaJpZM4IFvUu
.

Olivier Droz

@zezuha
Copy link

zezuha commented May 28, 2016

@odroz. What do you mean? Pull Request 587 was branched from jaliss/securesocial/master in version 3.0-M4 that already has injection, is compatible with Play2.4.4 and in fact it works. I am just trying to run a "javaDemo" project on this pull request.

@loicdescotte
Copy link

+1
Is it planned to merge this ?

@k4200
Copy link

k4200 commented Jul 19, 2016

@zezuha
I've got the same issue. The project compiles, but the same error occurs when running the demo app. (I only tried the Scala one.)

I'm not 100% sure, but I don't think this PR works. For example, I think the following @Inject has no effect, resulting in CacheApi being null, which prevents the code from working properly. Correct me if I'm wrong.
https://github.com/jaliss/securesocial/pull/587/files#diff-b4d4fb480020e2f51acd34919a40729fR52

If there's anyone that successfully used this code with Play 2.5, let me how to do that.

In the meantime, I created a forked version, tested it briefly, and it seems working with Play 2.5. The code is really messy, but for anyone interested, I uploaded the code and jars on the locations shown below:
https://github.com/k4200/securesocial/tree/migrate-to-play2.5
https://oss.sonatype.org/content/repositories/snapshots/tv/kazu/securesocial_2.11/3.2.0-SNAPSHOT/

@kildievr kildievr closed this Feb 28, 2017
@kildievr kildievr deleted the minimum_support_of_Play2.5 branch February 28, 2017 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants