Upgrade online-auction-scala with Lago 1.4.0-RC

55 views
Skip to first unread message

Pascal Havé

unread,
Jan 19, 2018, 12:04:53 PM1/19/18
to Lagom Framework Users
Hi All,

Is there someone who has migrated the online-auction-scala example with Lagom 1.4 ? (https://github.com/lagom/online-auction-scala)

I want to merge this example with another code done with Play 2.6 for the web-gateway part, so I have to upgrade it with Lagom to 1.4.
The upgrade seems to be not so complicated but unfortunatly, I didn't success to solve 2 compilation errors when I upgrade Lagom in the web-gateway component:

Error:(22, 8) illegal inheritance;
 self-type WebGateway does not conform to com.lightbend.lagom.scaladsl.client.LagomServiceClientComponents's selftype com.lightbend.lagom.scaladsl.client.LagomServiceClientComponents with com.lightbend.lagom.scaladsl.api.LagomConfigComponent
  with LagomServiceClientComponents {

Error:(43, 25) Cannot find a value of type: [controllers.AssetsMetadata]
  lazy val assets = wire[Assets]

The second error seems due to a new injection requirement for Play class controllers.Assets, but I don't know where and how to declare it.
The first one is more cryptical for me.

Thank you for your help,
Pascal.

Pascal Havé

unread,
Jan 19, 2018, 4:40:29 PM1/19/18
to Lagom Framework Users
I've found the problem. 
I don't see that detail in the migration guide.

The original code was:
abstract class WebGateway(context: Context) extends BuiltInComponentsFromContext(context)
with I18nComponents
with AhcWSComponents
with LagomServiceClientComponents {
/* ... */ 
  lazy val assets = wire[Assets]
}

What it must be replaced by
abstract class WebGateway(context: Context) extends BuiltInComponentsFromContext(context)
 
/* with I18nComponents ; no more required; provided by trait BuiltInComponents */
  with AhcWSComponents
with AssetsComponents /* required to provide assets & cie */
with LagomConfigComponent /* required by LagomServiceClientComponents for self-type */
with LagomServiceClientComponents
{
/* ... */ 
  /* lazy val assets = wire[Assets] ; no more required; provided by AssetsComponents */
  lazy val httpFilters: Seq[EssentialFilter] = Nil /* or any implementation; required by upgraded trait BuiltInComponents */
}

Pascal.

Tim Moore

unread,
Jan 25, 2018, 12:56:07 AM1/25/18
to Pascal Havé, Lagom Framework Users
Hi Pascal,

Thanks for raising this. We now have a pull request in progress at https://github.com/lagom/online-auction-scala/pull/58 that will be merged when the final 1.4.0 release has been published.

The new requirement to add LagomConfigComponents where you use LagomServiceClientComponents is an unintentional omission from the migration guide. We'll get that added.

All of the others are covered by the Play 2.6 migration guide https://www.playframework.com/documentation/2.6.x/Migration26

The web gateway app is of course a Play application, not a Lagom service, so the Play migration guide applies. I'll just add a note to the Lagom migration guide to make that more clear.

Thanks,
Tim


--
You received this message because you are subscribed to the Google Groups "Lagom Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lagom-framework+unsubscribe@googlegroups.com.
To post to this group, send email to lagom-framework@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lagom-framework/8cd08848-9092-4ffe-b771-cb67b64a591b%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Tim Moore
Lagom Tech Lead, Lightbend, Inc.

Tim Moore

unread,
Jan 25, 2018, 1:47:09 AM1/25/18
to Pascal Havé, Lagom Framework Users
The pull request for the migration guide update is https://github.com/lagom/lagom/pull/1193

Best,
Tim
Reply all
Reply to author
Forward
0 new messages