Hey Guys,
I am trying to work with lagom to get a
simple production microservice going. I created the helloworld project
and remove the hello stream project and renamed the helloworld project
to quiz project. Just to see where everything has be defined through
failing.
I am still finding out how to my own service locator but
for now I am happy to do the static locator option. I looked at the
documentation and followed it but having some problems.
http://www.lagomframework.com/documentation/1.0.x/java/Overview.html#deploying-using-static-service-locationsI turned off conductR service locator.
//#service-locator-disabled
lagomServiceLocatorEnabled in ThisBuild := false
//#service-locator-disabled
added
this line and its imports to the module for the service quiz. I want
the service locator to work in dev so i do not have the if statement to
check if its production
bind(ServiceLocator.class).to(ConfigurationServiceLocator.class);
When
the application starts cassandra complains about the service locator
not being bound. That stops the whole application working. I have the
impl project dependent on persistence instead of api so that is not the
issue.
[warn] c.l.l.i.p.c.ServiceLocatorSessionProvider - Could not find Cassandra contact points, due to: ServiceLocator is not bound
[warn] c.l.l.i.p.c.ServiceLocatorSessionProvider - Could not find Cassandra contact points, due to: ServiceLocator is not bound
[warn] c.l.l.i.p.c.ServiceLocatorSessionProvider - Could not find Cassandra contact points, due to: ServiceLocator is not bound[error] a.c.s.PersistentShardCoordinator - Persistence failure when replaying events for persistenceId [/sharding/JugQuizEntityCoordinator]. Last known sequence number [0]
java.lang.IllegalStateException: ServiceLocator is not bound
at com.lightbend.lagom.internal.persistence.cassandra.ServiceLocatorSessionProvider.com$lightbend$lagom$internal$persistence$cassandra$ServiceLocatorSessionProvider$$tryAgain$1(ServiceLocatorSessionProvider.scala:52) ~[lagom-javadsl-persistence_2.11-1.0.0-RC1.jar:1.0.0-RC1]
at com.lightbend.lagom.internal.persistence.cassandra.ServiceLocatorSessionProvider$$anonfun$com$lightbend$lagom$internal$persistence$cassandra$ServiceLocatorSessionProvider$$tryAgain$1$1.apply$mcV$sp(ServiceLocatorSessionProvider.scala:58) ~[lagom-javadsl-persistence_2.11-1.0.0-RC1.jar:1.0.0-RC1]
at akka.actor.Scheduler$$anon$4.run(Scheduler.scala:122) ~[akka-actor_2.11-2.4.4.jar:na]
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:39) ~[akka-actor_2.11-2.4.4.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_91]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_91]
at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_91]
The
application does not work with this configuration. even if I have dummy
service in the application.conf. I just wanted to see if where this
information would turn up in the application. is this the information
that will appear in the output of
http://localhost:8000/services ?? Is
service A the actually name of the service that you can inject in?
I am still experimenting with lagom. I will update the docs if i can get this solved. Write it from a beginner perspective.
thanks.