gustavoschewinski commented on issue #125:
URL: https://github.com/apache/plc4x-extras/issues/125#issuecomment-2416882348
Sounds good.
I just built the latest PLC4X for Kafka and got it running using the package
from `components/package/apache-kafka-connect-plc4x-plc4j-0.13.0-SNAPSHOT`. But
then I ran into this error:
```
[2024-10-16 12:00:30,250] INFO AbstractConfig values:
bufferSize = 1000
connection-name = machineA
connectionString =
opcua:tcp://Yoshi.lab.mtu-digilab.io:53530/OPCUA/SimulationServer?discovery=false&security-policy=NONE&message-security=NONE
pollReturnInterval = 500
queries = [jobA|plc-topic-plc4x|1000|counter#ns=3;i=1002]
(org.apache.kafka.common.config.AbstractConfig)
[2024-10-16 12:00:30,265] ERROR WorkerSourceTask{id=plc-1-source-13-0} Task
threw an uncaught and unrecoverable exception. Task is being killed and will
not recover until manually restarted
(org.apache.kafka.connect.runtime.WorkerTask)
java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
org/apache/plc4x/java/scraper/config/ScraperConfiguration.fromYaml(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;
@11: invokespecial
Reason:
Type 'com/fasterxml/jackson/dataformat/yaml/YAMLFactory' (current frame,
stack[2]) is not assignable to 'com/fasterxml/jackson/core/JsonFactory'
Current Frame:
bci: @11
flags: { }
locals: { 'java/lang/String', 'java/lang/Class' }
stack: { uninitialized 0, uninitialized 0,
'com/fasterxml/jackson/dataformat/yaml/YAMLFactory' }
Bytecode:
0000000: bb00 0a59 bb00 0c59 b700 0eb7 0012 4d2c
0000010: 2a2b b600 15b0 4ebb 0018 5912 1a2d b700
0000020: 1cbf
Exception Handler Table:
bci [15, 21] => handler: 22
Stackmap Table:
full_frame(@22,{Object[#46],Object[#48],Object[#10]},{Object[#31]})
at
org.apache.plc4x.java.scraper.config.triggeredscraper.ScraperConfigurationTriggeredImplBuilder.build(ScraperConfigurationTriggeredImplBuilder.java:43)
at
org.apache.plc4x.kafka.Plc4xSourceTask.start(Plc4xSourceTask.java:152)
at
org.apache.kafka.connect.runtime.AbstractWorkerSourceTask.initializeAndStart(AbstractWorkerSourceTask.java:283)
at
org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:227)
at
org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:284)
at
org.apache.kafka.connect.runtime.AbstractWorkerSourceTask.run(AbstractWorkerSourceTask.java:80)
at
org.apache.kafka.connect.runtime.isolation.Plugins.lambda$withClassLoader$1(Plugins.java:237)
at
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
[2024-10-16 12:00:30,269] WARN Failed to close source task with type
org.apache.kafka.connect.runtime.AbstractWorkerSourceTask$$Lambda$1324/0x0000000100ac8440
(org.apache.kafka.common.utils.Utils)
java.lang.NullPointerException
at
org.apache.plc4x.kafka.Plc4xSourceTask.stop(Plc4xSourceTask.java:243)
at org.apache.kafka.common.utils.Utils.closeQuietly(Utils.java:1263)
at
org.apache.kafka.connect.runtime.AbstractWorkerSourceTask.close(AbstractWorkerSourceTask.java:317)
at
org.apache.kafka.connect.runtime.WorkerTask.doClose(WorkerTask.java:208)
at
org.apache.kafka.connect.runtime.AbstractWorkerSourceTask.doClose(AbstractWorkerSourceTask.java:80)
at
org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:241)
at
org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:284)
at
org.apache.kafka.connect.runtime.AbstractWorkerSourceTask.run(AbstractWorkerSourceTask.java:80)
at
org.apache.kafka.connect.runtime.isolation.Plugins.lambda$withClassLoader$1(Plugins.java:237)
at
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
```
It’s weird because this issue didn’t happen with version 0.12.0. To fix it,
I added this dependency:
```xml
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>2.17.2</version>
</dependency>
```
After rebuilding and running Kafka again, I got another error:
```
[2024-10-16 13:35:58,609] DEBUG Job statistics (jobA, machineA) number of
requests: 31 (0 success, 100.0 % failed, NaN % too slow), min latency: NaN ms,
mean latency: NaN ms, median: NaN ms
(org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScraperImpl)
[2024-10-16 13:35:58,698] WARN Exception during scraping of Job jobA,
Connection-Alias machineA: Error-message: java.util.concurrent.TimeoutException
- for stack-trace change logging to DEBUG
(org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScraperTask)
[2024-10-16 13:35:58,698] DEBUG Detailed exception occurred at scraping
(org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScraperTask)
org.apache.plc4x.java.api.exceptions.PlcRuntimeException:
java.util.concurrent.ExecutionException: java.util.concurrent.TimeoutException
at
org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScraperImpl.getPlcConnection(TriggeredScraperImpl.java:334)
at
org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScraperTask.run(TriggeredScraperTask.java:112)
at
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at
java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at
java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.util.concurrent.ExecutionException:
java.util.concurrent.TimeoutException
at
java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
at
java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2005)
at
org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScraperImpl.getPlcConnection(TriggeredScraperImpl.java:330)
... 7 more
Caused by: java.util.concurrent.TimeoutException
at
java.base/java.util.concurrent.CompletableFuture$Timeout.run(CompletableFuture.java:2798)
at
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at
java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
... 3 more
Same error as I got before. In this thread while looking at how to fix this
problem, I found this way of getting away with it but it works just some time
and crashes
(https://github.com/apache/plc4x-extras/issues/125#issuecomment-2346601805).
```
This is the same error I saw earlier.
After digging into the issue, I also found a possible workaround, but it
only works for some time and then crashes again. You can check out this message
of the thread where I found the workaround:
[link](https://github.com/apache/plc4x-extras/issues/125#issuecomment-2346601805)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]