gustavoschewinski commented on issue #125:
URL: https://github.com/apache/plc4x-extras/issues/125#issuecomment-2315101173
Hello @chrisdutz,
I discovered something interesting. I'm currently running the connector code
locally to test it, and the error remains the same.
The issue is triggered when executing:
- `scraperConfig = builder.build()` in **Plc4xSourceTask**
- Which triggers `public ScraperConfigurationTriggeredImpl build() { return
new ScraperConfigurationTriggeredImpl(sources, jobConfigurations); }`
- And then triggers `@JsonCreator public
ScraperConfigurationTriggeredImpl(@JsonProperty(value = "sources", required =
true) Map<String, String> sources, @JsonProperty(value = "jobs", required =
true) List<JobConfigurationImpl> jobConfigurations) {
checkNoUnreferencedSources(sources, jobConfigurations); this.sources = sources;
this.jobConfigurations = jobConfigurations; }`
Somehow, this trigger is not functioning correctly, and it always produces
the error: "Exception in thread 'main' java.lang.NoClassDefFoundError:
com/fasterxml/jackson/dataformat/yaml/YAMLFactory." I suspect this might be
related to the use of the `@JsonCreator` annotation, which relies on
FasterXML's Jackson library.
Interestingly, if I remove all test scopes when running the code, the
previous FasterXML error disappears (because jackson-dataformat is just in test
scope), the scraping starts, it attempts to poll but then the buffer is empty,
not pooling anything.
```
24-08-28 10:44:53 INFO o.a.p.java.DefaultPlcDriverManager - Registering
driver for Protocol simulated (Simulated PLC4X Datasource)
2024-08-28 10:44:53 INFO o.a.p.j.s.c.t.ScraperConfigurationTriggeredImpl -
Assuming job as triggered job because triggerConfig has been set
2024-08-28 10:44:53 DEBUG o.a.p.j.s.t.t.TriggerConfiguration - Strategy:
SCHEDULED, scheduled ms: 1000
Starting scraper...
2024-08-28 10:44:53 INFO o.a.p.j.s.t.TriggeredScraperImpl - Starting jobs...
2024-08-28 10:44:53 DEBUG o.a.p.j.s.t.TriggeredScraperImpl - Register task
for job simulated-dashboard for conn machineA
(opcua:tcp://Yoshi.lab.mtu-digilab.io:53530/OPCUA/SimulationServer?discovery=false)
at rate 1000 ms
2024-08-28 10:44:53 DEBUG o.a.p.j.s.t.t.TriggerConfiguration - Strategy:
SCHEDULED, scheduled ms: 1000
2024-08-28 10:44:53 INFO o.a.p.j.s.t.TriggeredScraperImpl - Task
TriggeredScraperTask{connectionManager=org.apache.plc4x.java.utils.cache.CachedPlcConnectionManager@672872e1,
jobName='simulated-dashboard', connectionAlias='machineA',
connectionString='opcua:tcp://Yoshi.lab.mtu-digilab.io:53530/OPCUA/SimulationServer?discovery=false',
requestTimeoutMs=2000,
executorService=java.util.concurrent.ThreadPoolExecutor@32910148[Running, pool
size = 0, active threads = 0, queued tasks = 0, completed tasks = 0],
resultHandler=org.apache.plc4x.kafka.Plc4xSourceTask$$Lambda$115/0x00000008400dcc40@3f56875e,
triggerHandler=org.apache.plc4x.java.scraper.triggeredscraper.triggerhandler.TriggerHandlerImpl@2b4bac49}
added to scheduling
2024-08-28 10:44:53 DEBUG o.a.p.j.s.t.TriggeredScraperTask - Trigger for job
simulated-dashboard and device machineA is met ... scraping desired data
Scraper started.
Polling...
2024-08-28 10:44:53 DEBUG o.a.p.j.u.c.CachedPlcConnectionManager - Creating
new connection
Buffer empty. Waiting...500[]
2024-08-28 10:44:54 DEBUG o.a.p.j.s.t.TriggeredScraperImpl -
Job=org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScrapeJobImpl@fd07cbb
Task=TriggeredScraperTask{connectionManager=org.apache.plc4x.java.utils.cache.CachedPlcConnectionManager@672872e1,
jobName='simulated-dashboard', connectionAlias='machineA',
connectionString='opcua:tcp://Yoshi.lab.mtu-digilab.io:53530/OPCUA/SimulationServer?discovery=false',
requestTimeoutMs=2000,
executorService=java.util.concurrent.ThreadPoolExecutor@32910148[Running, pool
size = 1, active threads = 1, queued tasks = 0, completed tasks = 0],
resultHandler=org.apache.plc4x.kafka.Plc4xSourceTask$$Lambda$115/0x00000008400dcc40@3f56875e,
triggerHandler=org.apache.plc4x.java.scraper.triggeredscraper.triggerhandler.TriggerHandlerImpl@2b4bac49}
2024-08-28 10:44:54 DEBUG o.a.p.j.s.t.TriggeredScraperImpl - Task=Trigg
```
After some time, the scraper just stops:
```
2024-08-28 10:44:54 INFO o.a.p.j.s.t.TriggeredScraperImpl - Stopping
scraper...
2024-08-28 10:44:54 DEBUG o.a.p.j.s.t.TriggeredScraperImpl - Stopping task
TriggeredScraperTask{connectionManager=org.apache.plc4x.java.utils.cache.CachedPlcConnectionManager@672872e1,
jobName='simulated-dashboard', connectionAlias='machineA',
connectionString='opcua:tcp://Yoshi.lab.mtu-digilab.io:53530/OPCUA/SimulationServer?discovery=false',
requestTimeoutMs=2000,
executorService=java.util.concurrent.ThreadPoolExecutor@32910148[Running, pool
size = 1, active threads = 1, queued tasks = 0, completed tasks = 0],
resultHandler=org.apache.plc4x.kafka.Plc4xSourceTask$$Lambda$115/0x00000008400dcc40@3f56875e,
triggerHandler=org.apache.plc4x.java.scraper.triggeredscraper.triggerhandler.TriggerHandlerImpl@2b4bac49}...
2024-08-28 10:44:54 WARN o.a.p.j.s.t.TriggeredScraperTask - Exception
during scraping of Job simulated-dashboard, Connection-Alias machineA:
Error-message: null - for stack-trace change logging to DEBUG
```
Do you have any ideas on what might be causing this issue? :)
Thanks a lot in advance.
Best,
Gustavo.
--
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]