How should I do that logging in sbt project? - scala

[error] s.c.p.TwitterProvider - [securesocial] error retrieving request token
oauth.signpost.exception.OAuthNotAuthorizedException: Authorization failed (server replied with a 401). This can happen if the consumer key was not correct or the signatures did not match.
at oauth.signpost.AbstractOAuthProvider.handleUnexpectedResponse(AbstractOAuthProvider.java:243) ~[signpost-core-1.2.1.2.jar:na]
at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:193) ~[signpost-core-1.2.1.2.jar:na]
at oauth.signpost.AbstractOAuthProvider.retrieveRequestToken(AbstractOAuthProvider.java:74) ~[signpost-core-1.2.1.2.jar:na]
at play.api.libs.oauth.OAuth.retrieveRequestToken(OAuth.scala:38) ~[play-ws_2.11-2.3.7.jar:2.3.7]
at securesocial.core.OAuth1Client$Default$$anonfun$retrieveRequestToken$1.apply(OAuth1Provider.scala:69) ~[securesocial_2.11-3.0-M3.jar:3.0-M3]
[error] s.c.ProviderController - Unable to log user in. An exception was thrown
securesocial.core.AuthenticationException: null
at securesocial.core.OAuth1Provider$$anonfun$authenticate$1.applyOrElse(OAuth1Provider.scala:141) ~[securesocial_2.11-3.0-M3.jar:3.0-M3]
at securesocial.core.OAuth1Provider$$anonfun$authenticate$1.applyOrElse(OAuth1Provider.scala:138) ~[securesocial_2.11-3.0-M3.jar:3.0-M3]
at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36) [scala-library-2.11.6.jar:na]
at scala.util.Failure$$anonfun$recover$1.apply(Try.scala:215) [scala-library-2.11.6.jar:na]
at scala.util.Try$.apply(Try.scala:191) [scala-library-2.11.6.jar:na]
I want to check a requests. How I do setting the logger into sbt subproject(jar files)?

Related

bundle failure with error: java.lang.Exception: ORPHANED

While bringing up one of the application we are making some calls to DB, but i could see that those calls are failing with below exception,
org.osgi.service.coordinator.CoordinationException: Coordination failed
at org.apache.felix.coordinator.impl.CoordinationImpl.end(CoordinationImpl.java:255)
at org.apache.felix.coordinator.impl.CoordinationHolder.end(CoordinationHolder.java:56)
at org.apache.aries.jpa.blueprint.impl.JpaInterceptor.postCallWithReturn(JpaInterceptor.java:93)
at org.apache.aries.blueprint.proxy.Collaborator.postInvoke(Collaborator.java:98)
at Proxya2d2cd71_d4e4_434e_a965_b48799d154f7.findById(Unknown Source)
at
..............
Caused by: java.lang.Exception: ORPHANED
at org.osgi.service.coordinator.Coordination.<clinit>(Coordination.java:88)
at org.apache.felix.coordinator.impl.CoordinationHolder.finalize(CoordinationHolder.java:178)
at java.lang.System$2.invokeFinalize(System.java:1270)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:98)
at java.lang.ref.Finalizer.access$100(Finalizer.java:34)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:210)
Any information about this "java.lang.Exception: ORPHANED"

com.lightbend.lagom.internal.broker.kafka.KafkaSubscriberActor

I am new to lagom,elasticsearch,I am using lagom,elasticsearch,scala and cassandra.Everything is fine but when i post json data through postman,data go to cassandra but not to the elasticsearch and I am getting an error a warning and as below
12:22:10.688 [error] com.lightbend.lagom.internal.broker.kafka.KafkaSubscriberActor [sourceThread=search-impl-application-akka.actor.default-dispatcher-5, akkaTimestamp=06:52:10.688UTC, akkaSource=akka.tcp://search-impl-application#127.0.0.1:51584/user/KafkaBackoffConsumer1-customerTopic/KafkaConsumerActor1-customerTopic, sourceActorSystem=search-impl-application] - Topic subscription interrupted due to failure: [java.lang.IllegalStateException: Service elastic-search was not found by service locator]
12:22:10.688 [error] akka.actor.OneForOneStrategy [sourceThread=search-impl-application-akka.actor.default-dispatcher-5, akkaTimestamp=06:52:10.688UTC, akkaSource=akka://search-impl-application/user/KafkaBackoffConsumer1-customerTopic/KafkaConsumerActor1-customerTopic, sourceActorSystem=search-impl-application] - Service elastic-search was not found by service locator
java.lang.IllegalStateException: Service elastic-search was not found by service locator
at com.lightbend.lagom.internal.client.ClientServiceCallInvoker.$anonfun$doInvoke$4(ClientServiceCallInvoker.scala:75)
at scala.util.Success.$anonfun$map$1(Try.scala:251)
at scala.util.Success.map(Try.scala:209)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:289)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:91)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:44)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
[warn] com.lightbend.lagom.internal.scaladsl.registry.ServiceRegistryServiceLocator [] - Service name=[elastic-search] was not found. Hint: Maybe it was not registered?
any help??
See https://www.lagomframework.com/documentation/1.4.x/scala/ServiceLocator.html#Communicating-with-external-services for information on configuring the development mode service locator with additional services.
For example, this is how it's configured in the Online Auction Scala example project:
// register 'elastic-search' as an unmanaged service on the service locator so that at 'runAll' our code
// will resolve 'elastic-search' and use it. See also com.example.com.ElasticSearch
lagomUnmanagedServices in ThisBuild += ("elastic-search" -> "http://127.0.0.1:9200")
You'll need to reload your sbt configuration and restart your services for this to take effect.

Error uploading Sonar report: Sonar Scan - 500

We are using SonarQube 6.7 LTS version and facing this below error. Quick search in Stackoverflow shows issue occurs when SonarQube generates a huge report and then tries to upload it in one shot, causing HTTP 500, But we are using POstgreSQL DB (version 9.6.5) already. Anyone has any idea how this can be addressed for PostgreSQL DB?
ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project myApplicationsonar-project: Failed to upload report - 500: An error has occurred. Please contact your administrator -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project myApplicationsonar-project: Failed to upload report - 500: An error has occurred. Please contact your administrator
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.jvnet.hudson.maven3.launcher.Maven33Launcher.main(Maven33Launcher.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven33Main.launch(Maven33Main.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
at hudson.remoting.UserRequest.perform(UserRequest.java:212)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:369)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to upload report - 500: An error has occurred. Please contact your administrator
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:67)
at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:104)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 31 more
Caused by: Failed to upload report - 500: An error has occurred. Please contact your administrator
Finally, we managed to resolve the issue.
We reset shared_buffers parameter on PostgreSQL side to higher value (8 GB). Despite of that there was an error and this time we had below error entry in web.log.
ERROR web[AWkvYxqZhvRO95YsAfgm][o.s.s.w.WebServiceEngine] Fail to process request http://mysonar/sonar/api/ce/submit?projectKey=myProject&projectName=myProject
java.lang.IllegalStateException: The "myProject" key matches multiple permission templates: "template1", "template2". A system administrator must update these templates so that only one of them matches the key.
Resolving conflict in permission template resolved the issue completely.

Scala Play Framework: Header doesn't exists

I am trying to run play application and it runs correctly. However, while serving to few APIs, I get following error:
[error] play - Cannot invoke the action, eventually got an error: java.lang.RuntimeException: Header doesn't exist
[error] application -
! #714mk098l - Internal server error, for (POST) [/ivi/customer/login/] ->
play.api.Application$$anon$1: Execution exception[[RuntimeException: Header doesn't exist]]
at play.api.Application$class.handleError(Application.scala:296) ~[play_2.10-2.3.9.jar:2.3.9]
at play.api.DefaultApplication.handleError(Application.scala:402) [play_2.10-2.3.9.jar:2.3.9]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [play_2.10-2.3.9.jar:2.3.9]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [play_2.10-2.3.9.jar:2.3.9]
at scala.Option.map(Option.scala:145) [scala-library-2.10.5.jar:na]
Caused by: java.lang.RuntimeException: Header doesn't exist
at scala.sys.package$.error(package.scala:27) ~[scala-library-2.10.5.jar:na]
at play.api.mvc.Headers$$anonfun$apply$10.apply(Http.scala:338) ~[play_2.10-2.3.9.jar:2.3.9]
at play.api.mvc.Headers$$anonfun$apply$10.apply(Http.scala:338) ~[play_2.10-2.3.9.jar:2.3.9]
at scala.Option.getOrElse(Option.scala:120) [scala-library-2.10.5.jar:na]
at play.api.mvc.Headers$class.apply(Http.scala:338) ~[play_2.10-2.3.9.jar:2.3.9]
I feel like this should related to configuration rather than code issue. Can someone please guide here?

Actor creation error in akka

trying to create an actor in akka and call its receive function. I keep getting this error.
[ERROR] [10/26/2013 18:53:29.313] [messagespreading-akka.actor.default-dispatcher-4] [akka://messagespreading/user/$a] error while processing Create(-1187846526)
70ec3d6a-184d-403c-8166-04aec76200c9akka.actor.ActorInitializationException: exception during creation
at akka.actor.ActorInitializationException$.apply(Actor.scala:169)
at akka.actor.ActorCell.create(ActorCell.scala:496)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:351)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:256)
at akka.dispatch.Mailbox.run(Mailbox.scala:211)
at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:502)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: java.lang.IllegalArgumentException: n must be positive
at java.util.Random.nextInt(Random.java:250)
at scala.util.Random.nextInt(Random.scala:65)
at NetworkBuilder.<init>(pastry.scala:431)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:357)
at java.lang.Class.newInstance(Class.java:310)
at akka.util.Reflect$.instantiate(Reflect.scala:39)
at akka.actor.FromClassCreator.apply(Props.scala:187)
at akka.actor.FromClassCreator.apply(Props.scala:186)
at akka.actor.ActorCell.newActor(ActorCell.scala:461)
at akka.actor.ActorCell.create(ActorCell.scala:479)
... 8 more
CODE TO CREATE AND CALL ACTOR RECEIVE.
val system = ActorSystem("messagespreading")
var NetworkBuilderObj:ActorRef= system.actorOf(Props[NetworkBuilder])
NetworkBuilderObj ! test
When you get an exception occurring in third-party code, you need to look to see if there is a Caused by. In this case it says
Caused by: java.lang.IllegalArgumentException: n must be positive
at java.util.Random.nextInt(Random.java:250)
at scala.util.Random.nextInt(Random.scala:65)
at NetworkBuilder.(pastry.scala:431)
so there is the error - it has nothing to do with the code you posted per se.