Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AAS Polling Consumer with DotAAS-V3 #337

Open
iamaccosta opened this issue Feb 6, 2025 · 3 comments
Open

AAS Polling Consumer with DotAAS-V3 #337

iamaccosta opened this issue Feb 6, 2025 · 3 comments

Comments

@iamaccosta
Copy link

Hello team,

I am having some troubles with AAS Polling Consummer with DotAAS-V3. There are some closed issues (#307 and #303) regarding this problem. Is it resolved but not deployed yet?

Kind Regards,
André Costa

@aaronzi
Copy link
Member

aaronzi commented Feb 10, 2025

Hi @iamaccosta,

yes, the PR you mentioned is part of the 1.0.0-milestone-08 image on docker hub.

What problems are you having exactly?

@iamaccosta
Copy link
Author

Hi @aaronzi,
The error is very similar to the one presented in the closed issue #303.

Initially, I had the trigger for the route as an event, and nothing happened, even when I changed the value on the AAS Web UI.
So in the following example, I am using a timer to force messaging, and this is the error:

2025-02-11 09:48:35 [Camel (camel-1) thread #1 - timer://foo] INFO org.eclipse.digitaltwin.basyx.databridge.aas.AASEndpoint - SubmodelEndpoint //http://localhost:8081/submodels/aHR0cHM6Ly9leGFtcGxlLmNvbS9pZHMvU3VibW9kZWxzL3Rlc3RWYWx1ZQ
2025-02-11 09:48:35 [Camel (camel-1) thread #1 - timer://foo] INFO org.eclipse.digitaltwin.basyx.databridge.aas.AASEndpoint - Proxy URL: //http://localhost:8081/submodels/aHR0cHM6Ly9leGFtcGxlLmNvbS9pZHMvU3VibW9kZWxzL3Rlc3RWYWx1ZQ/submodel-elements/TestProperty
2025-02-11 09:48:36 [Camel (camel-1) thread #1 - timer://foo] INFO org.eclipse.digitaltwin.basyx.databridge.aas.AASPollingConsumer - Time out after waiting
2025-02-11 09:48:36 [Camel (camel-1) thread #1 - timer://foo] WARN org.eclipse.digitaltwin.basyx.databridge.aas.AASPollingConsumer - Caused by: [java.util.concurrent.ExecutionException - org.eclipse.basyx.vab.exception.provider.ProviderException: java.lang.NullPointerException]
2025-02-11 09:48:36 java.util.concurrent.ExecutionException: org.eclipse.basyx.vab.exception.provider.ProviderException: java.lang.NullPointerException
2025-02-11 09:48:36     at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
2025-02-11 09:48:36     at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:205)
2025-02-11 09:48:36     at org.eclipse.digitaltwin.basyx.databridge.aas.AASPollingConsumer.doReceive(AASPollingConsumer.java:102)
2025-02-11 09:48:36     at org.eclipse.digitaltwin.basyx.databridge.aas.AASPollingConsumer.receive(AASPollingConsumer.java:89)
2025-02-11 09:48:36     at org.apache.camel.processor.PollEnricher.process(PollEnricher.java:266)
2025-02-11 09:48:36     at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:477)
2025-02-11 09:48:36     at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:181)
2025-02-11 09:48:36     at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:59)
2025-02-11 09:48:36     at org.apache.camel.processor.Pipeline.process(Pipeline.java:165)
2025-02-11 09:48:36     at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:392)
2025-02-11 09:48:36     at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:210)
2025-02-11 09:48:36     at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:76)
2025-02-11 09:48:36     at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
2025-02-11 09:48:36     at java.base/java.util.TimerThread.run(Timer.java:506)
2025-02-11 09:48:36 Caused by: org.eclipse.basyx.vab.exception.provider.ProviderException: java.lang.NullPointerException
2025-02-11 09:48:36     at org.eclipse.basyx.vab.modelprovider.VABElementProxy.getValue(VABElementProxy.java:83)
2025-02-11 09:48:36     at org.eclipse.basyx.submodel.metamodel.connected.ConnectedElement.getElemLive(ConnectedElement.java:63)
2025-02-11 09:48:36     at org.eclipse.basyx.submodel.metamodel.connected.ConnectedElement.getElem(ConnectedElement.java:78)
2025-02-11 09:48:36     at org.eclipse.basyx.submodel.metamodel.connected.submodelelement.dataelement.ConnectedProperty.getLocalCopy(ConnectedProperty.java:84)
2025-02-11 09:48:36     at org.eclipse.digitaltwin.basyx.databridge.aas.AASPollingConsumer.getSerializedMetamodel(AASPollingConsumer.java:150)
2025-02-11 09:48:36     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
2025-02-11 09:48:36     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
2025-02-11 09:48:36     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
2025-02-11 09:48:36     at java.base/java.lang.Thread.run(Thread.java:829)
2025-02-11 09:48:36 Caused by: java.lang.NullPointerException
2025-02-11 09:48:36     at org.eclipse.basyx.vab.coder.json.metaprotocol.Result.createAsFacade(Result.java:100)
2025-02-11 09:48:36     at org.eclipse.basyx.vab.protocol.http.connector.HTTPConnector.buildResultFromJSON(HTTPConnector.java:377)
2025-02-11 09:48:36     at org.eclipse.basyx.vab.protocol.http.connector.HTTPConnector.handleProcessingException(HTTPConnector.java:325)
2025-02-11 09:48:36     at org.eclipse.basyx.vab.protocol.http.connector.HTTPConnector.httpGet(HTTPConnector.java:216)
2025-02-11 09:48:36     at org.eclipse.basyx.vab.protocol.http.connector.HTTPConnector.getValue(HTTPConnector.java:82)
2025-02-11 09:48:36     at org.eclipse.basyx.vab.coder.json.connector.JSONConnector.getValue(JSONConnector.java:105)
2025-02-11 09:48:36     at org.eclipse.basyx.vab.modelprovider.VABElementProxy.getValue(VABElementProxy.java:78)
2025-02-11 09:48:36     ... 8 more
2025-02-11 09:48:36 [Camel (camel-1) thread #1 - timer://foo] INFO route_sink_1 - Exchange[ExchangePattern: InOnly, BodyType: String, Body: ]
2025-02-11 09:48:36 [Camel (camel-1) thread #1 - timer://foo] ERROR org.apache.camel.processor.errorhandler.DefaultErrorHandler - Failed delivery for (MessageId: 0AAB3FCE1F6ABEC-0000000000000000 on ExchangeId: 0AAB3FCE1F6ABEC-0000000000000000). Exhausted after delivery attempt: 1 caught: java.lang.IllegalArgumentException: Cannot find a ResourceResolver in classpath supporting the scheme: /tmp/dataBridge/classpath
2025-02-11 09:48:36 
2025-02-11 09:48:36 Message History (source location and message history is disabled)
2025-02-11 09:48:36 ---------------------------------------------------------------------------------------------------------------------------------------
2025-02-11 09:48:36 Source                                   ID                             Processor                                          Elapsed (ms)
2025-02-11 09:48:36                                          route_sink_1/route_sink_1      from[timer://foo?delay=0&fixedRate=true&period=500      -567191
2025-02-11 09:48:36     ...
2025-02-11 09:48:36                                          route_sink_1/to2               jsonata:/tmp/dataBridge/classpath:jsonataExtractVa            0
2025-02-11 09:48:36 
2025-02-11 09:48:36 Stacktrace
2025-02-11 09:48:36 ---------------------------------------------------------------------------------------------------------------------------------------
2025-02-11 09:48:36 java.lang.IllegalArgumentException: Cannot find a ResourceResolver in classpath supporting the scheme: /tmp/dataBridge/classpath
2025-02-11 09:48:36     at org.apache.camel.impl.engine.DefaultResourceLoader.resolveResource(DefaultResourceLoader.java:117)
2025-02-11 09:48:36     at org.apache.camel.support.ResourceHelper.resolveResource(ResourceHelper.java:197)
2025-02-11 09:48:36     at org.apache.camel.support.ResourceHelper.resolveResourceAsInputStream(ResourceHelper.java:133)
2025-02-11 09:48:36     at org.apache.camel.support.ResourceHelper.resolveMandatoryResourceAsInputStream(ResourceHelper.java:112)
2025-02-11 09:48:36     at org.apache.camel.component.ResourceEndpoint.loadResource(ResourceEndpoint.java:111)
2025-02-11 09:48:36     at org.apache.camel.component.ResourceEndpoint.getResourceAsInputStreamWithoutCache(ResourceEndpoint.java:100)
2025-02-11 09:48:36     at org.apache.camel.component.ResourceEndpoint.getResourceAsInputStream(ResourceEndpoint.java:85)
2025-02-11 09:48:36     at org.apache.camel.component.jsonata.JsonataEndpoint.onExchange(JsonataEndpoint.java:107)
2025-02-11 09:48:36     at org.apache.camel.support.ProcessorEndpoint$1.process(ProcessorEndpoint.java:61)
2025-02-11 09:48:36     at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66)
2025-02-11 09:48:36     at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:172)
2025-02-11 09:48:36     at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:477)
2025-02-11 09:48:36     at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:181)
2025-02-11 09:48:36     at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:59)
2025-02-11 09:48:36     at org.apache.camel.processor.Pipeline.process(Pipeline.java:165)
2025-02-11 09:48:36     at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:392)
2025-02-11 09:48:36     at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:210)
2025-02-11 09:48:36     at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:76)
2025-02-11 09:48:36     at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
2025-02-11 09:48:36     at java.base/java.util.TimerThread.run(Timer.java:506)
2025-02-11 09:48:36 [Camel (camel-1) thread #1 - timer://foo] WARN org.apache.camel.component.timer.TimerConsumer - Error processing exchange. Exchange[0AAB3FCE1F6ABEC-0000000000000000]. Caused by: [java.lang.IllegalArgumentException - Cannot find a ResourceResolver in classpath supporting the scheme: /tmp/dataBridge/classpath]
2025-02-11 09:48:36 java.lang.IllegalArgumentException: Cannot find a ResourceResolver in classpath supporting the scheme: /tmp/dataBridge/classpath
2025-02-11 09:48:36     at org.apache.camel.impl.engine.DefaultResourceLoader.resolveResource(DefaultResourceLoader.java:117)
2025-02-11 09:48:36     at org.apache.camel.support.ResourceHelper.resolveResource(ResourceHelper.java:197)
2025-02-11 09:48:36     at org.apache.camel.support.ResourceHelper.resolveResourceAsInputStream(ResourceHelper.java:133)
2025-02-11 09:48:36     at org.apache.camel.support.ResourceHelper.resolveMandatoryResourceAsInputStream(ResourceHelper.java:112)
2025-02-11 09:48:36     at org.apache.camel.component.ResourceEndpoint.loadResource(ResourceEndpoint.java:111)
2025-02-11 09:48:36     at org.apache.camel.component.ResourceEndpoint.getResourceAsInputStreamWithoutCache(ResourceEndpoint.java:100)
2025-02-11 09:48:36     at org.apache.camel.component.ResourceEndpoint.getResourceAsInputStream(ResourceEndpoint.java:85)
2025-02-11 09:48:36     at org.apache.camel.component.jsonata.JsonataEndpoint.onExchange(JsonataEndpoint.java:107)
2025-02-11 09:48:36     at org.apache.camel.support.ProcessorEndpoint$1.process(ProcessorEndpoint.java:61)
2025-02-11 09:48:36     at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66)
2025-02-11 09:48:36     at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:172)
2025-02-11 09:48:36     at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:477)
2025-02-11 09:48:36     at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:181)
2025-02-11 09:48:36     at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:59)
2025-02-11 09:48:36     at org.apache.camel.processor.Pipeline.process(Pipeline.java:165)
2025-02-11 09:48:36     at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:392)
2025-02-11 09:48:36     at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:210)
2025-02-11 09:48:36     at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:76)
2025-02-11 09:48:36     at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
2025-02-11 09:48:36     at java.base/java.util.TimerThread.run(Timer.java:506)

The URL of the property http://localhost:8081/submodels/aHR0cHM6Ly9leGFtcGxlLmNvbS9pZHMvU3VibW9kZWxzL3Rlc3RWYWx1ZQ/submodel-elements/TestProperty presents the following content:

{
  "modelType": "Property",
  "value": "7",
  "valueType": "xs:int",
  "idShort": "TestProperty"
}

This is my configuration:
config.zip

My guess is that the problem relies on the AAS Polling Consumer getting the value from the Property.

@aaronzi
Copy link
Member

aaronzi commented Feb 11, 2025

Ok, thanks for sharing the details.
We will investigate once the more urgent BaSyx tickets got resolved.

Also disclaimer: We plan to develop a version 2 of the Databridge where the architecture will be refactored and an upgrade to the current version of Apache Camel will take place. We will probably not fix this bug in version 1 of the Databridge anymore but rather focus on version 2.

If your support request is urgent, please consider
a) Fixing it yourself or
b) inform us so that we can discuss this together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants