I have a problem of deserailisation with a complex class case (see log),
Ps => despite the warning, I noticed nothing as a malfunction,
I use in my project:
akka 2.6.11 ( akka cluster , akka streams , akka pubsub )
scala 2.12,
play 2.6
log server:
[warn] 2020-11-30 19:09:31,504 - akka.remote.artery.Deserializer - Failed to deserialize message from [akka://application#127.0.0.1:2551] with serializer id [123454323] and manifest []. com.esotericsoftware.kryo.KryoException: java.lang.NullPointerException
I use in my Kamon project and I think this is the cause of the excpetion,
Link project in github https://github.com/ykhilaji/play-jobs-example/
the documantion is not up to date, to launch two instances, you must launch:
node 1: ./conf/script/runNode1.sh
node 2: ./conf/script/runNode1.sh
to simulate a stress test : ab -m POST -k -c 250 -n 2000 http://localhost/yk/jobs/10000
Related
I am trying to write a program that enables me to run predefined KSQL operations on Kafka topics in Scala, but I don't want to open the KSQL Cli everytime. Therefore I want to start the KSQL "Server" from within my Scala program. If I understand the KSQL source code right, I have to build and start a KsqlRestApplication:
def restServer = KsqlRestApplication.buildApplication(new
KsqlRestConfig(defaultServerProperties), true, new VersionCheckerAgent
{override def start(ksqlModuleType: KsqlModuleType, properties:
Properties): Unit = ???})
But when I try doing that, I get the following error:
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.kafka.streams.StreamsConfig.getConsumerConfigs(Ljava/lang/String;Ljava/lang/String;)Ljava/util/Map;
at io.confluent.ksql.rest.server.BrokerCompatibilityCheck.create(BrokerCompatibilityCheck.java:62)
at io.confluent.ksql.rest.server.KsqlRestApplication.buildApplication(KsqlRestApplication.java:241)
I looked into the function call in BrokerCompatibilityCheck and in the create function it calls the StreamsConfig.getConsumerConfigs() with 2 Strings as parameters instead of the parameters defined in
https://kafka.apache.org/0102/javadoc/org/apache/kafka/streams/StreamsConfig.html#getConsumerConfigs(StreamThread,%20java.lang.String,%20java.lang.String).
Are my KSQL and Kafka version simply not compatible or am I doing something wrong?
I am using KSQL version 4.1.0-SNAPSHOT and Kafka version 1.0.0.
Yes, NoSuchMethodError typically indicates a version incompatibility between libraries.
The link you posted is to javadoc for kafka 0.10.2. The method hasn't changed in 1.0 but indeed in the upcoming 1.1 it only takes 2 Strings:
https://kafka.apache.org/11/javadoc/org/apache/kafka/streams/StreamsConfig.html#getConsumerConfigs(java.lang.String,%20java.lang.String)
. That suggests the version of KSQL you're using (4.1.0-SNAPSHOT) depends on version 1.1 of kafka streams, which is currently in the release candidate phase and I believe and should be out soon:
https://lists.apache.org/thread.html/780c4458b16590e99261b69d7b41b9ec374a3226d72c8d38885a008a#%3Cusers.kafka.apache.org%3E
As per that email you can find the latest (1.1.0-rc2) artifacts in the apache staging repo:
https://repository.apache.org/content/groups/staging/
I've played around with lagom-scala-word-count Activator template and I was forced to kill the application process. Since then embedded kafka doesn't work - this project and every new I create became unusable. I've tried:
running sbt clean, to delete embedded Kafka data
creating brand new project (from other activator templates)
restarting my machine.
Despite this I can't get Lagom to work. During first launch I get following lines in log:
[warn] o.a.k.c.NetworkClient - Error while fetching metadata with correlation id 1 : {wordCount=LEADER_NOT_AVAILABLE}
[warn] o.a.k.c.NetworkClient - Error while fetching metadata with correlation id 2 : {wordCount=LEADER_NOT_AVAILABLE}
[warn] o.a.k.c.NetworkClient - Error while fetching metadata with correlation id 4 : {wordCount=LEADER_NOT_AVAILABLE}
[warn] a.k.KafkaConsumerActor - Consumer interrupted with WakeupException after timeout. Message: null. Current value of akka.kafka.consumer.wakeup-timeout is 3000 milliseconds
[warn] a.k.KafkaConsumerActor - Consumer interrupted with WakeupException after timeout. Message: null. Current value of akka.kafka.consumer.wakeup-timeout is 3000 milliseconds
Next launches result in:
[info] Starting Kafka
[info] Starting Cassandra
....Kafka Server closed unexpectedly.
....
[info] Cassandra server running at 127.0.0.1:4000
I've posted full server.log from lagom-internal-meta-project-kafka at https://gist.github.com/szymonbaranczyk/a93273537b42aafa45bf67446dd41adb.
Is it possible that some corrupted Embedded Kafka's data is stored globally on my pc and causes this?
For future reference, as James mentioned in comments, you have to delete the folder lagom-internal-meta-project-kafka in target/lagom-dynamic-projects. I don't know why it's not get deleted automatically.
I've developed a spark-based application that gets data from kafka and saves it in cassandra DB, using intellij.
connection code in scala:
val cluster = Cluster.builder().addContactPoint("192.168.0.253").withPort(9042).build();
val session = cluster.connect()
the code work fine when I run it from intellij, but I get this error when I try to run it from jar using command line:
Exception in thread "main" java.io.IOException:
Failed to open native connection to Cassandra at {192.168.0.253}:9042 at .... ....
Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException:
All host(s) tried for query failed
(tried: /192.168.0.253:9042 (com.datastax.driver.core.exceptions.TransportException:
[/192.168.0.253] Error writing)) at
com.datastax.driver.core.ControlConnection.reconnectInternal(
ControlConnection.java:233) at
com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:79)
at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1424)
at com.datastax.driver.core.Cluster.getMetadata(Cluster.java:403)
at com.datastax.spark.connector.cql.CassandraConnector$.
com$datastax$spark$connector$cql$CassandraConnector$$createSession(
CassandraConnector.scala:155) ... 13 more
I've produced a jar file from intellij, and I built the jar with dependencies, using [ copy to the output directory and link via manifist ] option.
cassandra.yaml file:
#Whether to start the native transport server.
start_native_transport: true
#port for the CQL native transport to listen for clients on
native_transport_port: 9042
Why is this error raised & and how can I fix it?
Thanks in advance
During generic save action of morphia model using CRUD interface I recieve following error:
Oops: NullPointerException An unexpected error occured caused by
exception NullPointerException: null
play.exceptions.UnexpectedException: Unexpected Error at
play.modules.morphia.Model.edit(Model.java:219) at
play.modules.morphia.MorphiaPlugin.bind(MorphiaPlugin.java:607)
...
I've found that similiar error was in version 1.2.4a and was fixed in 1.2.4b.
I downoladed the latest version of morphia. On app start I recieve followind log:
12:18:59,036 INFO ~ Module morphia is available (C:\play-1.2.4\samples-and-tests\test1\modules\ morphia-1.2.4b )
12:18:59,037 INFO ~ Module secure is available (C:\play-1.2.4\modules\secure)
12:18:59,978 WARN ~ You're running Play! in DEV mode
12:19:00,110 INFO ~ Listening for HTTP on port 9000 (Waiting a first request to start) ...
12:19:11,680 INFO ~ Connected to jdbc:mysql://localhost/test1?useUnicode=yes&characterEncoding=UTF-8&connectionCollation=utf8_general_ci
12:19:14,869 INFO ~ MorphiaPlugin-1.2.4a> initialized
So, now I can't understad what version of morphia I actually use and can't understand how to fix the error.
Please, advice me something about my issue.
I got the problem, in this day morphia doesn't work with play 1.2.4 crud module. You have to rollback to 1.2.3.
I'm working my way through the Scala blog engine tutorial (yabe) for Play! Framework, and I encountered a template execution error that refers to GenericSignatureFormatError : null when accessing comments. Specifically, the error page says:
Template execution error
Execution error occured in template /app/views/tags/display.html.
Exception raised was GenericSignatureFormatError : null.
In /app/views/tags/display.html (around line 14)
(14) | ${_arg?.comments.size() ?: 'no'}
This exception has been logged with id 666i6ifgg
The stack trace from the console is below. I can reproduce the problem within samples-and-tests/ from the github master (43b195), as follows:
% git clone https://github.com/playframework/play-scala.git
% cd play-scala/samples-and-tests/yabe
% play dependencies
~ play! 1.2, http://www.playframework.org
~ Resolving dependencies using /home/league/tmp/play-scala/samples-and-tests/yabe/conf/dependencies.yml,
~ play->scala 0.9 (from playLocalModules)
~ Installing resolved dependencies,
~ modules/scala-0.9 -> /usr/local/stow/play-1.2/share/play-1.2/modules/scala-0.9
~ lib/joda-time-1.6.jar
~ Done!
% play run
~ play! 1.2, http://www.playframework.org
~ Warning: conflict on command scala:console
~ Ctrl+C to stop
Listening for transport dt_socket at address: 8000
10:32:01,076 INFO ~ Starting /home/league/tmp/play-scala/samples-and-tests/yabe
10:32:01,079 WARN ~ Declaring modules in application.conf is deprecated. Use dependencies.yml instead (module.scala)
10:32:01,080 INFO ~ Module scala is available (/home/league/tmp/play-scala/samples-and-tests/yabe/../..)
10:32:01,080 INFO ~ Module scala is available (/usr/local/stow/play-1.2/share/play-1.2/modules/scala-0.9)
10:32:02,515 WARN ~ You're running Play! in DEV mode
10:32:02,591 INFO ~ Listening for HTTP on port 9000 (Waiting a first request to start) ...
Then, loading http://localhost:9000/ produces the error stated above, with this console output:
#666i6ifgg
Internal Server Error (500) for request GET /
Template execution error (In /app/views/tags/display.html around line 14)
Execution error occured in template /app/views/tags/display.html. Exception raised was GenericSignatureFormatError : null.
play.exceptions.TemplateExecutionException
at play.templates.BaseTemplate.throwException(BaseTemplate.java:84)
at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:236)
at play.templates.GroovyTemplate$ExecutableTemplate.invokeTag(GroovyTemplate.java:346)
at /app/views/Application/index.html.(line:6)
at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:213)
at play.templates.Template.render(Template.java:26)
at play.mvc.results.RenderTemplate.<init>(RenderTemplate.java:24)
at play.mvc.Controller.renderTemplate(Controller.java:657)
at play.mvc.ControllerDelegate.renderTemplateForScala(ControllerDelegate.java:46)
at play.mvc.results.Template.<init>(Template.scala:12)
at play.mvc.ScalaController.Template(ScalaController.scala:77)
at controllers.Application$.index(app/controllers.scala:27)
at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:540)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:498)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:492)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:469)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:157)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.reflect.GenericSignatureFormatError
at java.beans.FeatureDescriptor.getParameterTypes(FeatureDescriptor.java:385)
at java.beans.MethodDescriptor.setMethod(MethodDescriptor.java:116)
at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:74)
at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:58)
at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1196)
at java.beans.Introspector.getBeanInfo(Introspector.java:423)
at java.beans.Introspector.getBeanInfo(Introspector.java:189)
at java.beans.Introspector.getBeanInfo(Introspector.java:250)
at java.beans.Introspector.<init>(Introspector.java:404)
at java.beans.Introspector.getBeanInfo(Introspector.java:189)
at java.security.AccessController.doPrivileged(Native Method)
at /app/views/tags/display.html.(line:14)
at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:213)
... 16 more
I was able to work around this problem by switching to the Sun JDK. I didn't realize that my Ubuntu was set to use OpenJDK instead. The installation guide claims that either one should work. Perhaps that is untrue, or perhaps I got unlucky with a particular bug related to this version of OpenJDK.
For anyone else having this problem, update-java-alternatives -l shows the available JDKs; I see:
java-6-openjdk 1061 /usr/lib/jvm/java-6-openjdk
java-6-sun 63 /usr/lib/jvm/java-6-sun
These come from the Ubuntu packages
sun-java6-bin 6.24-1build0.10.10.1
openjdk-6-jre-headless 6b20-1.9.7-0ubuntu1
Use this to select:
update-java-alternatives -s java-6-sun
Try changing this:
${_arg?.comments.size() ?: 'no'}
to
${(_arg?.comments.size() > 0) ? '': 'no'}
This should work.