eclipse-basyx / basyx-java-sdk Goto Github PK
View Code? Open in Web Editor NEWjava-sdk
License: MIT License
java-sdk
License: MIT License
Hi - we're looking into Basyx to use it in a research project. Can you make a statement about the current version of the AAS-Meta-Model and (if necessary) plans to update it to V3RC01?
I came accross this error when trying to use the Submodel Client from BaSyx .NET.
When an AAS contains a property of type "AnyURI", the json representation of this property is "anyuri" instead of "anyURI". On the client side the deserialization will fail.
From the outside perspective it looks like this line of code seems to be the problem:
Apparently, the Basyx SDK depends on Apache Tika (tika-core) only for these classes.
Used by VABSubmodelAPI
. Maybe there is a way of getting rid of this dependency?
That Jar file has roughly 700kb https://repo1.maven.org/maven2/org/apache/tika/tika-core/2.7.0/
import org.apache.tika.mime.MimeType;
import org.apache.tika.mime.MimeTypeException;
import org.apache.tika.mime.MimeTypes;
I have the following example assets in xml formal:
<?xml version="1.0"?>
<aas:aasenv xmlns:IEC="http://www.admin-shell.io/IEC61360/2/0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:abac="http://www.admin-shell.io/aas/abac/2/0" xsi:schemaLocation="http://www.admin-shell.io/aas/2/0 AAS.xsd http://www.admin-shell.io/IEC61360/2/0 IEC61360.xsd" xmlns:aas="http://www.admin-shell.io/aas/2/0">
<aas:assetAdministrationShells>
<aas:assetAdministrationShell>
<aas:idShort>CA_AAS</aas:idShort>
<aas:identification idType="IRI">1220_8141_0112_0875</aas:identification>
<aas:derivedFrom>
<aas:keys>
<aas:key type="AssetAdministrationShell" local="true" idType="IdShort">6455_1111_0112_4769</aas:key>
</aas:keys>
</aas:derivedFrom>
<aas:assetRef>
<aas:keys>
<aas:key type="Asset" local="true" idType="IRI">1030_8141_0112_5510</aas:key>
</aas:keys>
</aas:assetRef>
<aas:submodelRefs />
<aas:conceptDictionaries />
</aas:assetAdministrationShell>
</aas:assetAdministrationShells>
<aas:assets>
<aas:asset>
<aas:idShort>CA</aas:idShort>
<aas:identification idType="IRI">1030_8141_0112_5510</aas:identification>
<aas:kind>Instance</aas:kind>
</aas:asset>
</aas:assets>
<aas:submodels />
<aas:conceptDescriptions />
</aas:aasenv>
and a call to endpoint /shells
returns
[
{
"conceptDictionary": [],
"assetRef": {
"keys": [
{
"idType": "IRI",
"type": "Asset",
"value": "1030_8141_0112_5510",
"local": true
}
]
},
"identification": {
"idType": "IRI",
"id": "1220_8141_0112_0875"
},
"idShort": "CA_AAS",
"dataSpecification": [],
"derivedFrom": {
"keys": [
{
"idType": "IdShort",
"type": "AssetAdministrationShell",
"value": "6455_1111_0112_4769",
"local": true
}
]
},
"modelType": {
"name": "AssetAdministrationShell"
},
"asset": {
"identification": {
"idType": "IRI",
"id": "1030_8141_0112_5510"
},
"idShort": "CA",
"kind": "Instance",
"dataSpecification": [],
"modelType": {
"name": "Asset"
},
"embeddedDataSpecifications": []
},
"embeddedDataSpecifications": [],
"views": [],
"submodels": []
}
]
However, the fields in asset
must be Referables, ie.
"asset": {
"keys": [
{
"type": "Asset",
"idType": "IRI",
"value": "1030_8141_0112_5510",
"local": true
}
]
}
Hello, I am referring to this wiki-page: https://wiki.eclipse.org/BaSyx_/_Download_/_Java_Setup
In the beginning it was necessary to clone three Github repositories (basyx-java-sdk, basyx-components, basyx-examples) to get the same selection as on the screenshot "Import Maven Projects". This doesn't get very clear from the instructions. :)
Second I had some issues during installing the basyx-java-sdk:
On the following page about the components setup (https://wiki.eclipse.org/BaSyx_/_Download_/_Components_Setup) it says Save the following commands to an arbitrary text file. Next, import the database through psql -U postgres -f "your-file".
Is meant by "your-file" the setup_postgres.sql in the bin folder of Postgres?
Third installing the Maven project basyx-components works properly (step 4 under Project Installation), but installing basyx-examples leads to the following error:
Do you have an idea how to fix this?
"date" valueType is missing from current implementation. Thus, it needs to be added to the enum as well as serializations.
Hi,
I'm trying to push AASs to a remote AAS server that is hosted on a cloud platform. The server is the default version from docker hub (eclipsebasyx/aas-server:1.2.0). I created AASs with lambda properties and operations based on the provided BaSyx examples (https://wiki.eclipse.org/BaSyx_/_Examples) and use the example code snippts to push the AASs and associated submodels to the server. So far, the push is working correctly and the AASs are on the remote server. However, when I want to request the submodelelements, the dynamic behavior is not working. E.g. the result of a get request to a lambda property returns the following:
{"modelType":{"name":"Property"},"kind":"Instance","value":{"get":"_basyxInvocable"},"idShort":"dummy","valueType":"boolean","parent":{"keys":[{"type":"Submodel","local":true,"value":"","idType":"IRDI"}]}}
Is there another way to add operations and lambda properties to a remote server without any operation delegation?
Thank you very much.
Yours sincerely,
Sebastian Behrendt
Suggest to remove obsolete (?) package org.eclipse.basyx.vab.protocol.opcua.server
and dependency to Milo "sdk-server".
In fact, the only class used from Milo "sdk-server" is org.eclipse.milo.opcua.sdk.server.util.HostnameUtil
and that would be a lot of dependency just for this class.
See https://github.com/eclipse-basyx/basyx-java-sdk/blob/main/src/main/java/org/eclipse/basyx/vab/protocol/opcua/server/KeyStoreLoaderClient.java
Es gibt bei ReferenceElements keine Methode wie getQualifier() der Klasse SubmodelElement.
Sollte das nicht möglich sein, da die Klasse ReferenceElement von SubmodelElement erbt?
While working with the sdk I figured out a problem (and probably the solution) in the ConnectedSubmodel class. I instantiate the class:
AASRegistryProxy registry = new AASRegistryProxy(urlRegistryLocal);
ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(registry);
ConnectedSubmodel aimcSm = (ConnectedSubmodel) manager.retrieveSubmodel(
new Identifier(IdentifierType.IRI, "th-koeln.de-GART-Labor-BACnetDevices-1678804990"),
new Identifier(IdentifierType.IRI, "SMAssetInterfaceMappingConfiguration")
);
This works perfectly fine. As soon as I want to retrieve a submodel element via getSubmodelElement() (here the SubmodelElementCollection "Configurations") the following error is thrown:
Exception in thread "main" org.eclipse.basyx.vab.exception.provider.MalformedRequestException: [6 | 400 - MalformedRequestException: Unknown path Configurations was requested, 6 | [HTTP GET] Failed to request http://<ip>:<port>/shells/th-koeln.de-GART-Labor-BACnetDevices-1678804990/aas/submodels/AssetInterfaceMappingConfiguration with mediatype application/json;charset=UTF-8. "MalformedRequestException: Unknown path Configurations was requested"]
at org.eclipse.basyx.vab.protocol.http.server.ExceptionToHTTPCodeMapper.mapToException(ExceptionToHTTPCodeMapper.java:100)
at org.eclipse.basyx.vab.protocol.http.connector.HTTPConnector.handleProcessingException(HTTPConnector.java:325)
at org.eclipse.basyx.vab.protocol.http.connector.HTTPConnector.httpGet(HTTPConnector.java:211)
at org.eclipse.basyx.vab.protocol.http.connector.HTTPConnector.getValue(HTTPConnector.java:78)
at org.eclipse.basyx.vab.coder.json.connector.JSONConnector.getValue(JSONConnector.java:105)
at org.eclipse.basyx.vab.modelprovider.VABElementProxy.getValue(VABElementProxy.java:78)
at org.eclipse.basyx.submodel.metamodel.connected.ConnectedSubmodel.getSubmodelElement(ConnectedSubmodel.java:210)
at <myClass>
The Submodel contains this element and it can be requested via direct approach in a browser. Doing some testing I could reproduce the error in the browser. The url to request a SubmodelElement is supposed to look like:
/shells/{aasId}/aas/submodels/{submodelIdShort}/submodel/submodelElements/{seIdShortPath}
Leaving out the "submodel"-part behind the {submodelIdShort} produces the error.
I checked the code of ConnectedSubmodel-class. The concrete function does:
public ISubmodelElement getSubmodelElement(String id) {
Map<String, Object> node = (Map<String, Object>) getProxy().getValue(VABPathTools.concatenatePaths(MultiSubmodelElementProvider.ELEMENTS, id));
ISubmodelElement element = ConnectedSubmodelElementFactory.getConnectedSubmodelElement(getProxy(), MultiSubmodelElementProvider.ELEMENTS, id, node);
return element;
}
The path to request is build here. Indeed it is only build from MultiSubmodelElementProvider.ELEMENTS, which equals to "submodelElements" and the idShort of the submodelElement. Due to the missing "submodel"-part it is not possible to request SubmodelElements with this function.
Additional:
It seems like the error was already in version 1.3.1, as trying it out produces the same error. Here the code was:
Map<String, Object> node = (Map)this.getProxy().getValue(VABPathTools.concatenatePaths(new String[]{"submodelElements", id}));
ISubmodelElement element = ConnectedSubmodelElementFactory.getConnectedSubmodelElement(this.getProxy(), "submodelElements", id, node);
Dear team,
I had a problem when changing AAS Property values with the PUT request. And here's my example :
I started with a GET value of the property. (ParkStatus = 0)
Now I want to change the status from 0 to 1, I tired PUT 1 to the previous URL where I got the value but it is not working with a 500 error.
Then I tried to GET something from xxxxx/ParkStatus instead of xxxxx/ParkStatus/value. And here it shows the value=0, we are sure the value wasn't changed.
I copied all the results to the request body and changed here value=1. It worked.
I redo a GET to see if the value is changed successfully. (ParkStatus = 1)
After that I try to PUT a value (0) to directly from URL xxxxx/ParkStatus/value again, this time it worked.
The value has been changed from 1 to 0
For each time I lanch the AAS server I have to pass these steps above to finally PUT value to /value URL directly. I'm really looking forward to your reply. Thank you ;)
Hi, I am facing the following issues
Trying to access the following AAS data using the id aasServer/shells/www.company.com/ids/aas/8003_4110_1102_9521** even though I encode the assId that is in the URL format aasServer/shells/www.company.com%2Fids%2Faas%2F8003_4110_1102_9521 I am getting error
The submodel information could not be retrieved. Getting the following error
Dear all,
I am having troubles to compile the project after I installed Tomcat 10.1.
I followed instructions here How to build the BaSyx Java SDK.
I use:
Errors during the maven -install starts here:
[INFO] �[1;32mTests run: �[0;1;32m16�[m, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.492 s - in org.eclipse.basyx.testsuite.regression.vab.protocol.opcua.�[1mBrowsePathHelperTest�[m
[INFO] Running org.eclipse.basyx.testsuite.regression.vab.support.�[1mTestTypeDestroyer�[m
[INFO] �[1;32mTests run: �[0;1;32m1�[m, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in org.eclipse.basyx.testsuite.regression.vab.support.�[1mTestTypeDestroyer�[m
[INFO]
[INFO] Results:
[INFO]
[ERROR] �[1;31mErrors: �[m
[ERROR] �[1;31morg.eclipse.basyx.testsuite.regression.aas.registration.restapi.TestDirectoryModelProviderServlet.testDeleteByAssetIdCall�[m
[ERROR] �[1;31m Run 1: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.setUp:102 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[ERROR] �[1;31m Run 2: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.tearDown:112 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[INFO]
[ERROR] �[1;31morg.eclipse.basyx.testsuite.regression.aas.registration.restapi.TestDirectoryModelProviderServlet.testDeleteCall�[m
[ERROR] �[1;31m Run 1: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.setUp:102 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[ERROR] �[1;31m Run 2: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.tearDown:112 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[INFO]
[ERROR] �[1;31morg.eclipse.basyx.testsuite.regression.aas.registration.restapi.TestDirectoryModelProviderServlet.testDeleteNotExistingAAS�[m
[ERROR] �[1;31m Run 1: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.setUp:102 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[ERROR] �[1;31m Run 2: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.tearDown:112 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[INFO]
[ERROR] �[1;31morg.eclipse.basyx.testsuite.regression.aas.registration.restapi.TestDirectoryModelProviderServlet.testDeleteNotExistingSubmodel�[m
[ERROR] �[1;31m Run 1: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.setUp:102 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[ERROR] �[1;31m Run 2: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.tearDown:112 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[INFO]
[ERROR] �[1;31morg.eclipse.basyx.testsuite.regression.aas.registration.restapi.TestDirectoryModelProviderServlet.testDeleteNotExistingSubmodelFromNotExistingAAS�[m
[ERROR] �[1;31m Run 1: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.setUp:102 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[ERROR] �[1;31m Run 2: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.tearDown:112 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[INFO]
[ERROR] �[1;31morg.eclipse.basyx.testsuite.regression.aas.registration.restapi.TestDirectoryModelProviderServlet.testDeleteWithAssetExtension�[m
[ERROR] �[1;31m Run 1: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.setUp:102 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[ERROR] �[1;31m Run 2: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.tearDown:112 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[INFO]
[ERROR] �[1;31morg.eclipse.basyx.testsuite.regression.aas.registration.restapi.TestDirectoryModelProviderServlet.testGetMultiAAS�[m
[ERROR] �[1;31m Run 1: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.setUp:102 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[ERROR] �[1;31m Run 2: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.tearDown:112 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[INFO]
[ERROR] �[1;31morg.eclipse.basyx.testsuite.regression.aas.registration.restapi.TestDirectoryModelProviderServlet.testGetSingleAAS�[m
[ERROR] �[1;31m Run 1: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.setUp:102 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[ERROR] �[1;31m Run 2: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.tearDown:112 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[INFO]
[ERROR] �[1;31morg.eclipse.basyx.testsuite.regression.aas.registration.restapi.TestDirectoryModelProviderServlet.testOverwritingAASDescriptor�[m
[ERROR] �[1;31m Run 1: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.setUp:102 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[ERROR] �[1;31m Run 2: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.tearDown:112 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[INFO]
[ERROR] �[1;31morg.eclipse.basyx.testsuite.regression.aas.registration.restapi.TestDirectoryModelProviderServlet.testRegisterSubmodelToNotExistingAAS�[m
[ERROR] �[1;31m Run 1: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.setUp:102 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[ERROR] �[1;31m Run 2: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.tearDown:112 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[INFO]
[ERROR] �[1;31morg.eclipse.basyx.testsuite.regression.aas.registration.restapi.TestDirectoryModelProviderServlet.testRetrieveSpecificSubmodelDescriptor�[m
[ERROR] �[1;31m Run 1: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.setUp:102 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[ERROR] �[1;31m Run 2: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.tearDown:112 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[INFO]
[ERROR] �[1;31morg.eclipse.basyx.testsuite.regression.aas.registration.restapi.TestDirectoryModelProviderServlet.testRetrieveSubmodelDescriptors�[m
[ERROR] �[1;31m Run 1: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.setUp:102 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[ERROR] �[1;31m Run 2: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.tearDown:112 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[INFO]
[ERROR] �[1;31morg.eclipse.basyx.testsuite.regression.aas.registration.restapi.TestDirectoryModelProviderServlet.testSubmodelCalls�[m
[ERROR] �[1;31m Run 1: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.setUp:102 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[ERROR] �[1;31m Run 2: TestDirectoryModelProviderServlet>TestRegistryProviderSuite.tearDown:112 » Provider com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $�[m
[INFO]
[INFO]
[ERROR] �[1;31mTests run: 1287, Failures: 0, Errors: 13, Skipped: 0�[m
[INFO]
[INFO] �[1m------------------------------------------------------------------------�[m
[INFO] �[1;31mBUILD FAILURE�[m
[INFO] �[1m------------------------------------------------------------------------�[m
[INFO] Total time: 03:40 min
[INFO] Finished at: 2023-07-07T21:04:05+02:00
[INFO] �[1m------------------------------------------------------------------------�[m
[ERROR] Failed to execute goal �[32morg.apache.maven.plugins:maven-surefire-plugin:3.0.0:test�[m �[1m(default-test)�[m on project �[36mbasyx.sdk�[m: �[1;31m�[m
[ERROR] �[1;31m�[m
[ERROR] �[1;31mPlease refer to C:\Users\adm2pribis\eclipse-workspace\basyx\basyx-java-sdk\target\surefire-reports for the individual test results.�[m
[ERROR] �[1;31mPlease refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
Do you have any suggestion for me?
Thank you, Rudo
Dear Team,
We have started exploring the BasyX server and various other components of it but kindly provide information regarding UI for BasyX server. Is there any UI available from BasyX for viewing and editing an asset administration shell integrated with BasyX SDK?
I installed the AAS Server Component using the docker as specified in the tutorials. It is run using
docker run --name=aas -p 8081:4001 eclipsebasyx/aas-server:1.3.1
Trying to perform a basic REST PUT command according to the swagger API is not successfull and fails with MetamodelConstructionException
.
The complete response is
{
"success": false,
"isException": true,
"messages": [
{
"messageType": 6,
"code": "500",
"text": "MetamodelConstructionException: Could not construct meta model element org.eclipse.basyx.aas.metamodel.map.AssetAdministrationShell. Passed argument was {idShort=ExampleAAS, modelType={name=AssetAdministrationShell}, identification={id=https://acplt.org/Simple_AAS, idType=IRI}, asset={keys=[{type=Asset, idType=IRI, value=https://acplt.org/Simple_Asset, local=true}]}}"
}
]
}
The data was constructed following the PythonSDK example and results in
{
'idShort': 'ExampleAAS',
'modelType':{
'name': 'AssetAdministrationShell'
},
'identification': {
'id': 'https://acplt.org/Simple_AAS',
'idType': 'IRI'
},
'asset': {
'keys': [
{
'type': 'Asset',
'idType': 'IRI',
'value': 'https://acplt.org/Simple_Asset',
'local': True
}
]
}
}
Is there another specification for the AAS creation this example is not following correctly or what is the reason for this failed PUT action?
Regarding Basyx 1.4
In _org.eclipse.basyx.vab.coder.json.provider/JSONProvider /rocessBaSysInvoke these lines probably cause this error:
if (!(parameter instanceof Object[])) { Object[] parameterArray = new Object[1]; Object tmp = parameter; parameterArray[0] = tmp; parameter = parameterArray; }
When I now invoke an operation that takes in no arguments it runs into an WrongNumberOfParametersException because it expects 1 and gets 0.
How can we achieve a invokeOperation call without any parameters?
The Submodel looks like this:
{
"modelType": {
"name": "Operation"
},
"dataSpecification": [],
"embeddedDataSpecifications": [],
"kind": "Instance",
"inputVariables": [],
"outputVariables": [],
"inoutputVariables": [],
"invokable": "_basyxInvocable",
"isWrappedInvokable": false,
"idShort": "activateOven",
"parent": {
"keys": [
{
"type": "Submodel",
"local": true,
"value": "ovensubmodel1",
"idType": "IRI"
}
]
}
},
When trying to invoke the function you will get an answer, that it is not possible for that path, because Qualifiable.getQualifiers
always returns an empty LinkedHashSet
The BaSyx backend checks, if the operation is a delegated one (undelegated operations are not yet supported AFAIK).
To check that, the OperationProvider.invokeOperation
calls DelegatedInvocationManager.isDelegatingOperation
.
Here it gets all qualifiers from the operation and tries to find one that has the above mentioned qualifier in it.
Problem is, that when calling operation.getQualifiers
it tries to retrieve the field with the name "qualifiers
" (Qualifiable.QUALIFIERS
). But when looking at the json (and thus the internal representation), there is no field "qualifiers
" as it is called "constraints
"
A quick fix would be to set Qualifiable.QUALIFIERS
to "constraints"
and possibly renaming Qualifiable.QUALIFIERS
to Qualifiable.CONSTRAINTS
It could also be an error coming from the AASX Package Explorer, if so I will post my issue there.
Hi there,
so after updating the java sdk, I've noticed, that AASXPackageManager
and AASBundleHelper
were missing, which I used to load .aasx files.
To be precise, I was using this code snippet to load in .aasx files:
AASXPackageManager aasx_packman = new AASXPackageManager("C:/blub/demo_aas.aasx");
Set<AASBundle> bundles = aasx_packman.retrieveAASBundles();
AASBundleHelper.integrate(new AASAggregatorProxy(AASSERVERPATH), bundles);
AASRegistryProxy proxy = new AASRegistryProxy(REGISTRYPATH);
AASBundleHelper.register(proxy, bundles, AASSERVERPATH);
Is there a new way to load .aasx files? Thanks.
Best,
Samed
I found that BaSyx supports JWT. But the architecture you propose is too complex (RS256 algo + JWKS server). I don't know if you have a plan to proposes a simple option: HS256 + the AAS Server proposes directly JWTs instead of using a JWKS server ?
Hi, In /,there is a dependency org.apache.commons:commons-compress:1.19 that calls the risk method.
The scope of this CVE affected version is [1.0,1.21)
After further analysis, in this project, the main Api called is org.apache.commons.compress.archivers.zip.AsiExtraField: parseFromLocalFileData(byte[],int,int)V
Risk method repair link : GitHub
CVE Bug Invocation Path--
Path Length : 10
org.eclipse.basyx.aas.factory.aasx.AASXToMetamodelConverter: retrieveThumbnail()Ljava.io.InputStream; /download/apache-maven-3.6.3/repository_mount/org/glassfish/hk2/osgi-resource-locator/1.0.3/osgi-resource-locator-1.0.3.jar
org.eclipse.basyx.aas.factory.aasx.AASXToMetamodelConverter: loadAASX()V /download/apache-maven-3.6.3/repository_mount/org/glassfish/hk2/osgi-resource-locator/1.0.3/osgi-resource-locator-1.0.3.jar
org.apache.poi.openxml4j.opc.OPCPackage: open(java.io.InputStream)Lorg.apache.poi.openxml4j.opc.OPCPackage; /download/apache-maven-3.6.3/repository_mount/com/fasterxml/jackson/core/jackson-annotations/2.14.2/jackson-annotations-2.14.2.jar
org.apache.poi.openxml4j.opc.ZipPackage: init(java.io.InputStream,org.apache.poi.openxml4j.opc.PackageAccess)V /download/apache-maven-3.6.3/repository_mount/com/fasterxml/jackson/core/jackson-annotations/2.14.2/jackson-annotations-2.14.2.jar
org.apache.poi.openxml4j.util.ZipInputStreamZipEntrySource: init(org.apache.poi.openxml4j.util.ZipArchiveThresholdInputStream)V /download/apache-maven-3.6.3/repository_mount/com/fasterxml/jackson/core/jackson-annotations/2.14.2/jackson-annotations-2.14.2.jar
org.apache.poi.openxml4j.util.ZipArchiveThresholdInputStream: getNextEntry()Lorg.apache.commons.compress.archivers.zip.ZipArchiveEntry; /download/apache-maven-3.6.3/repository_mount/com/fasterxml/jackson/core/jackson-annotations/2.14.2/jackson-annotations-2.14.2.jar
org.apache.commons.compress.archivers.zip.ZipArchiveInputStream: getNextZipEntry()Lorg.apache.commons.compress.archivers.zip.ZipArchiveEntry; /download/apache-maven-3.6.3/repository_mount/com/fasterxml/jackson/core/jackson-annotations/2.14.2/jackson-annotations-2.14.2.jar
org.apache.commons.compress.archivers.zip.ZipArchiveEntry: setExtra(byte[])V /download/apache-maven-3.6.3/repository_mount/com/fasterxml/jackson/core/jackson-annotations/2.14.2/jackson-annotations-2.14.2.jar
org.apache.commons.compress.archivers.zip.ZipArchiveEntry: mergeExtraFields(org.apache.commons.compress.archivers.zip.ZipExtraField[],boolean)V /download/apache-maven-3.6.3/repository_mount/com/fasterxml/jackson/core/jackson-annotations/2.14.2/jackson-annotations-2.14.2.jar
org.apache.commons.compress.archivers.zip.AsiExtraField: parseFromLocalFileData(byte[],int,int)V
Dependency tree--
[INFO] org.eclipse.basyx:basyx.sdk:jar:1.4.0
[INFO] +- ch.qos.logback:logback-classic:jar:1.4.6:compile
[INFO] | +- ch.qos.logback:logback-core:jar:1.4.6:compile
[INFO] | \- org.slf4j:slf4j-api:jar:2.0.4:compile
[INFO] +- junit:junit:jar:4.13.2:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.mockito:mockito-core:jar:5.2.0:test
[INFO] | +- net.bytebuddy:byte-buddy:jar:1.14.1:test
[INFO] | +- net.bytebuddy:byte-buddy-agent:jar:1.14.1:test
[INFO] | \- org.objenesis:objenesis:jar:3.3:test
[INFO] +- io.moquette:moquette-broker:jar:0.16:test
[INFO] | +- org.slf4j:slf4j-reload4j:jar:1.7.36:test
[INFO] | | \- ch.qos.reload4j:reload4j:jar:1.2.19:test
[INFO] | +- io.netty:netty-common:jar:4.1.77.Final:compile
[INFO] | +- io.netty:netty-buffer:jar:4.1.77.Final:compile
[INFO] | +- io.netty:netty-transport:jar:4.1.77.Final:compile
[INFO] | | \- io.netty:netty-resolver:jar:4.1.77.Final:compile
[INFO] | +- io.netty:netty-handler:jar:4.1.77.Final:compile
[INFO] | +- io.netty:netty-codec:jar:4.1.77.Final:compile
[INFO] | +- io.netty:netty-codec-http:jar:4.1.77.Final:compile
[INFO] | +- io.netty:netty-codec-mqtt:jar:4.1.77.Final:test
[INFO] | +- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.77.Final:test
[INFO] | | +- io.netty:netty-transport-native-unix-common:jar:4.1.77.Final:test
[INFO] | | \- io.netty:netty-transport-classes-epoll:jar:4.1.77.Final:test
[INFO] | +- com.h2database:h2-mvstore:jar:2.1.212:test
[INFO] | +- com.zaxxer:HikariCP:jar:2.4.7:test
[INFO] | +- io.dropwizard.metrics:metrics-core:jar:3.2.2:test
[INFO] | +- io.dropwizard.metrics:metrics-jvm:jar:3.2.2:test
[INFO] | +- com.librato.metrics:metrics-librato:jar:5.1.0:test
[INFO] | +- com.librato.metrics:librato-java:jar:2.1.0:test
[INFO] | +- com.bugsnag:bugsnag:jar:3.6.4:test (version selected from constraint [3.0,4.0))
[INFO] | \- commons-codec:commons-codec:jar:1.15:compile
[INFO] +- org.eclipse.milo:sdk-client:jar:0.6.8:compile
[INFO] | +- org.eclipse.milo:stack-client:jar:0.6.8:compile
[INFO] | | \- com.digitalpetri.netty:netty-channel-fsm:jar:0.8:compile
[INFO] | | \- com.digitalpetri.fsm:strict-machine:jar:0.6:compile
[INFO] | \- org.eclipse.milo:sdk-core:jar:0.6.8:compile
[INFO] +- org.eclipse.milo:sdk-server:jar:0.6.8:compile
[INFO] | +- org.eclipse.milo:stack-core:jar:0.6.8:compile
[INFO] | | +- org.bouncycastle:bcprov-jdk15on:jar:1.69:compile
[INFO] | | +- org.bouncycastle:bcpkix-jdk15on:jar:1.69:compile
[INFO] | | | \- org.bouncycastle:bcutil-jdk15on:jar:1.69:compile
[INFO] | | \- org.glassfish.jaxb:jaxb-runtime:jar:2.3.6:compile
[INFO] | | +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:compile
[INFO] | | +- org.glassfish.jaxb:txw2:jar:2.3.6:compile
[INFO] | | +- com.sun.istack:istack-commons-runtime:jar:3.0.12:compile
[INFO] | | \- com.sun.activation:jakarta.activation:jar:1.2.2:compile
[INFO] | +- org.eclipse.milo:stack-server:jar:0.6.8:compile
[INFO] | \- org.eclipse.milo:bsd-generator:jar:0.6.8:compile
[INFO] | \- org.eclipse.milo:bsd-core:jar:0.6.8:compile
[INFO] +- javax.servlet:javax.servlet-api:jar:4.0.1:compile
[INFO] +- javax.ws.rs:javax.ws.rs-api:jar:2.1.1:compile
[INFO] +- org.glassfish.jersey.core:jersey-client:jar:2.39.1:compile
[INFO] | +- jakarta.ws.rs:jakarta.ws.rs-api:jar:2.1.6:compile
[INFO] | +- org.glassfish.jersey.core:jersey-common:jar:2.39.1:compile
[INFO] | | +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] | | \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.3:compile
[INFO] | \- org.glassfish.hk2.external:jakarta.inject:jar:2.6.1:compile
[INFO] +- org.glassfish.jersey.inject:jersey-hk2:jar:2.39.1:compile
[INFO] | +- org.glassfish.hk2:hk2-locator:jar:2.6.1:compile
[INFO] | | +- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.6.1:compile
[INFO] | | +- org.glassfish.hk2:hk2-api:jar:2.6.1:compile
[INFO] | | \- org.glassfish.hk2:hk2-utils:jar:2.6.1:compile
[INFO] | \- org.javassist:javassist:jar:3.29.0-GA:compile
[INFO] +- org.apache.tomcat:tomcat-catalina:jar:9.0.73:compile
[INFO] | +- org.apache.tomcat:tomcat-servlet-api:jar:9.0.73:compile
[INFO] | +- org.apache.tomcat:tomcat-jsp-api:jar:9.0.73:compile
[INFO] | | \- org.apache.tomcat:tomcat-el-api:jar:9.0.73:compile
[INFO] | +- org.apache.tomcat:tomcat-juli:jar:9.0.73:compile
[INFO] | +- org.apache.tomcat:tomcat-annotations-api:jar:9.0.73:compile
[INFO] | +- org.apache.tomcat:tomcat-api:jar:9.0.73:compile
[INFO] | +- org.apache.tomcat:tomcat-jni:jar:9.0.73:compile
[INFO] | +- org.apache.tomcat:tomcat-coyote:jar:9.0.73:compile
[INFO] | +- org.apache.tomcat:tomcat-util:jar:9.0.73:compile
[INFO] | +- org.apache.tomcat:tomcat-util-scan:jar:9.0.73:compile
[INFO] | \- org.apache.tomcat:tomcat-jaspic-api:jar:9.0.73:compile
[INFO] +- org.apache.poi:poi-ooxml:jar:4.1.2:compile
[INFO] | +- org.apache.poi:poi:jar:4.1.2:compile
[INFO] | | +- org.apache.commons:commons-collections4:jar:4.4:compile
[INFO] | | +- org.apache.commons:commons-math3:jar:3.6.1:compile
[INFO] | | \- com.zaxxer:SparseBitSet:jar:1.2:compile
[INFO] | +- org.apache.poi:poi-ooxml-schemas:jar:4.1.2:compile
[INFO] | | \- org.apache.xmlbeans:xmlbeans:jar:3.1.0:compile
[INFO] | +- org.apache.commons:commons-compress:jar:1.19:compile
[INFO] | \- com.github.virtuald:curvesapi:jar:1.06:compile
[INFO] +- org.codehaus.janino:janino:jar:3.1.9:compile
[INFO] | \- org.codehaus.janino:commons-compiler:jar:3.1.9:compile
[INFO] +- org.eclipse.paho:org.eclipse.paho.client.mqttv3:jar:1.2.5:compile
[INFO] +- com.google.code.gson:gson:jar:2.10.1:compile
[INFO] +- commons-io:commons-io:jar:2.11.0:compile
[INFO] +- commons-fileupload:commons-fileupload:jar:1.5:compile
[INFO] +- org.apache.httpcomponents:httpmime:jar:4.5.14:compile
[INFO] +- org.apache.httpcomponents:httpclient:jar:4.5.14:compile
[INFO] | +- org.apache.httpcomponents:httpcore:jar:4.4.16:compile
[INFO] | \- commons-logging:commons-logging:jar:1.2:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.12.0:compile
[INFO] +- org.springframework.security:spring-security-oauth2-resource-server:jar:5.8.2:compile
[INFO] | +- org.springframework.security:spring-security-core:jar:5.8.2:compile
[INFO] | | +- org.springframework.security:spring-security-crypto:jar:5.8.2:compile
[INFO] | | +- org.springframework:spring-aop:jar:5.3.25:compile
[INFO] | | +- org.springframework:spring-beans:jar:5.3.25:compile
[INFO] | | +- org.springframework:spring-context:jar:5.3.25:compile
[INFO] | | \- org.springframework:spring-expression:jar:5.3.25:compile
[INFO] | +- org.springframework.security:spring-security-oauth2-core:jar:5.8.2:compile
[INFO] | | \- org.springframework:spring-web:jar:5.3.25:compile
[INFO] | +- org.springframework.security:spring-security-web:jar:5.8.2:compile
[INFO] | \- org.springframework:spring-core:jar:5.3.25:compile
[INFO] | \- org.springframework:spring-jcl:jar:5.3.25:compile
[INFO] +- org.springframework.security:spring-security-oauth2-jose:jar:5.8.2:compile
[INFO] | \- com.nimbusds:nimbus-jose-jwt:jar:9.24.4:compile
[INFO] | \- com.github.stephenc.jcip:jcip-annotations:jar:1.0-1:compile
[INFO] +- org.keycloak:keycloak-admin-client:jar:19.0.3:compile
[INFO] | +- org.keycloak:keycloak-core:jar:19.0.3:compile
[INFO] | +- org.keycloak:keycloak-common:jar:19.0.3:compile
[INFO] | +- org.jboss.resteasy:resteasy-client:jar:3.13.2.Final:compile
[INFO] | | +- org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_2.1_spec:jar:2.0.1.Final:compile
[INFO] | | +- org.jboss.resteasy:resteasy-jaxrs:jar:3.13.2.Final:compile
[INFO] | | | +- org.reactivestreams:reactive-streams:jar:1.0.3:compile
[INFO] | | | +- jakarta.validation:jakarta.validation-api:jar:2.0.2:compile
[INFO] | | | \- org.jboss.spec.javax.annotation:jboss-annotations-api_1.3_spec:jar:2.0.1.Final:compile
[INFO] | | \- org.jboss.logging:jboss-logging:jar:3.3.2.Final:compile
[INFO] | +- org.jboss.resteasy:resteasy-multipart-provider:jar:3.13.2.Final:compile
[INFO] | | +- com.sun.mail:jakarta.mail:jar:1.6.5:compile
[INFO] | | \- org.apache.james:apache-mime4j:jar:0.6:compile
[INFO] | +- org.jboss.resteasy:resteasy-jackson2-provider:jar:3.13.2.Final:compile
[INFO] | | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.10.5:compile
[INFO] | | | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.10.5:compile
[INFO] | | | \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.10.5:compile
[INFO] | | | \- jakarta.activation:jakarta.activation-api:jar:1.2.1:compile
[INFO] | | \- com.github.fge:json-patch:jar:1.9:compile
[INFO] | | \- com.github.fge:jackson-coreutils:jar:1.6:compile
[INFO] | | \- com.github.fge:msg-simple:jar:1.1:compile
[INFO] | | \- com.github.fge:btf:jar:1.2:compile
[INFO] | \- org.jboss.resteasy:resteasy-jaxb-provider:jar:3.13.2.Final:compile
[INFO] | \- org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.3_spec:jar:2.0.0.Final:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.14.2:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.14.2:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.14.2:compile
[INFO] +- org.mock-server:mockserver-netty:jar:5.9.0:test
[INFO] | +- org.mock-server:mockserver-core:jar:5.9.0:test
[INFO] | | +- com.lmax:disruptor:jar:3.4.2:test
[INFO] | | +- io.netty:netty-codec-socks:jar:4.1.44.Final:test
[INFO] | | +- io.netty:netty-handler-proxy:jar:4.1.44.Final:test
[INFO] | | +- com.jcraft:jzlib:jar:1.1.3:test
[INFO] | | +- org.apache.velocity:velocity-engine-scripting:jar:2.1:test
[INFO] | | +- org.apache.velocity:velocity-engine-core:jar:2.1:test
[INFO] | | +- org.skyscreamer:jsonassert:jar:1.5.0:test
[INFO] | | | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] | | +- com.github.java-json-tools:json-schema-validator:jar:2.2.11:test
[INFO] | | | +- com.github.java-json-tools:json-schema-core:jar:1.2.10:test
[INFO] | | | | +- com.github.java-json-tools:jackson-coreutils:jar:1.9:test
[INFO] | | | | +- com.github.fge:uri-template:jar:0.9:test
[INFO] | | | | \- org.mozilla:rhino:jar:1.7.7.1:test
[INFO] | | | +- com.sun.mail:mailapi:jar:1.6.1:test
[INFO] | | | | \- javax.activation:activation:jar:1.1:test
[INFO] | | | +- joda-time:joda-time:jar:2.9.7:test
[INFO] | | | +- com.googlecode.libphonenumber:libphonenumber:jar:8.0.0:test
[INFO] | | | \- net.sf.jopt-simple:jopt-simple:jar:5.0.3:test
[INFO] | | +- com.jayway.jsonpath:json-path:jar:2.4.0:test
[INFO] | | | \- net.minidev:json-smart:jar:2.3:test
[INFO] | | | \- net.minidev:accessors-smart:jar:1.2:test
[INFO] | | | \- org.ow2.asm:asm:jar:5.0.4:test
[INFO] | | +- javax.xml.bind:jaxb-api:jar:2.4.0-b180830.0359:test
[INFO] | | | \- javax.activation:javax.activation-api:jar:1.2.0:test
[INFO] | | +- org.xmlunit:xmlunit-core:jar:2.6.3:test
[INFO] | | \- org.apache.commons:commons-text:jar:1.8:test
[INFO] | \- com.google.guava:guava:jar:28.2-jre:compile
[INFO] | +- com.google.guava:failureaccess:jar:1.0.1:compile
[INFO] | +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
[INFO] | +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] | +- org.checkerframework:checker-qual:jar:2.10.0:compile
[INFO] | +- com.google.errorprone:error_prone_annotations:jar:2.3.4:compile
[INFO] | \- com.google.j2objc:j2objc-annotations:jar:1.3:compile
[INFO] +- org.mock-server:mockserver-client-java:jar:5.9.0:test
[INFO] +- org.apache.httpcomponents.client5:httpclient5:jar:5.2.1:test
[INFO] | +- org.apache.httpcomponents.core5:httpcore5:jar:5.2:test
[INFO] | \- org.apache.httpcomponents.core5:httpcore5-h2:jar:5.2:test
[INFO] \- org.apache.tika:tika-core:jar:2.7.0:compile
Suggested solutions:
Update dependency version
Thank you very much.
Dependency to "keycloak-admin-client" introduces a ton of dependencies, and it's only for implementing org.eclipse.basyx.extensions.shared.authorization.internal.KeycloakService
which again is only used by org.eclipse.basyx.components.security.authorization.internal.KeycloakJwtBearerTokenAuthenticationConfigurationProvider
I may be wrong, but:
[INFO] +- org.keycloak:keycloak-admin-client:jar:19.0.3:compile
[INFO] | +- org.keycloak:keycloak-core:jar:19.0.3:compile
[INFO] | +- org.keycloak:keycloak-common:jar:19.0.3:compile
[INFO] | +- org.jboss.resteasy:resteasy-client:jar:3.13.2.Final:compile
[INFO] | | +- org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_2.1_spec:jar:2.0.1.Final:compile
[INFO] | | +- org.jboss.resteasy:resteasy-jaxrs:jar:3.13.2.Final:compile
[INFO] | | | +- org.reactivestreams:reactive-streams:jar:1.0.3:compile
[INFO] | | | +- jakarta.validation:jakarta.validation-api:jar:2.0.2:compile
[INFO] | | | \- org.jboss.spec.javax.annotation:jboss-annotations-api_1.3_spec:jar:2.0.1.Final:compile
[INFO] | | \- org.jboss.logging:jboss-logging:jar:3.3.2.Final:compile
[INFO] | +- org.jboss.resteasy:resteasy-multipart-provider:jar:3.13.2.Final:compile
[INFO] | | +- com.sun.mail:jakarta.mail:jar:1.6.5:compile
[INFO] | | \- org.apache.james:apache-mime4j:jar:0.6:compile
[INFO] | +- org.jboss.resteasy:resteasy-jackson2-provider:jar:3.13.2.Final:compile
[INFO] | | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.10.5:compile
[INFO] | | | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.10.5:compile
[INFO] | | | \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.10.5:compile
[INFO] | | | \- jakarta.activation:jakarta.activation-api:jar:1.2.1:compile
[INFO] | | \- com.github.fge:json-patch:jar:1.9:compile
[INFO] | | \- com.github.fge:jackson-coreutils:jar:1.6:compile
[INFO] | | \- com.github.fge:msg-simple:jar:1.1:compile
[INFO] | | \- com.github.fge:btf:jar:1.2:compile
[INFO] | \- org.jboss.resteasy:resteasy-jaxb-provider:jar:3.13.2.Final:compile
[INFO] | \- org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.3_spec:jar:2.0.0.Final:compile
as for now, I will probably manually exclude the transitve dependency to "keycloak-admin-client".
I cannot find SubmodelElementList in the code and the Wiki's Basyx. I guess that you have not implemented it yet.
Do you plan to add SubmodelElementList to Basyx in the near future?
I have an application where I am making calls to BaSyx servers. There is some discrepancy with responses that contain the SubmodelElementCollection object, which is requiring a not-so-neat workaround.
Making a GET request to a SubmodelElementCollection would return an array as its value [ {submodel element collection data}, ... ]. However, if an operation has a SubmodelElementCollection as return type, the outputarguments would contain a SubmodelElementCollection, which value is an object of the format: { (idShort): {submodel element collection data}, ...}.
I think the issue lies with how submodelElementCollectionProvider converts the map to a collection, while the invocationResponse does not. Or maybe it is another thing all together?
Thanks for the help!
Can you enable swagger access?
According to the API docs, the path for invoking an operation is
/shells/{aasId}/aas/submodels/{submodelIdShort}/submodel/submodelElements/{idShortPathToOperation}/invoke
or for the async-variant
/shells/{aasId}/aas/submodels/{submodelIdShort}/submodel/submodelElements/{idShortPathToOperation}/invoke?async=true
In the oven example imagine it instanced like
/shells/eclipse.basyx.aas.oven/aas/submodels/Oven/submodel/submodelElements/activateOven/invoke
Expected: Here, the idShortPath should be activateOven
.
Problem: The org.eclipse.basyx.submodel.restapi.SubmodelProvider class forwards incorrect idShortPaths of the submodel element to the enclosed ISubmodelAPI. In the example, instead of activateOven
, it forwards /activateOven/invoke
, not having removed the trailing /invoke
.
In the async invoke case, it forwards /activateOven/
, having removed the trailing invoke
but not the trailing slash.
For other methods, those don't have a trailing path segment to be removed, but more precisely, for all methods, imho the leading slash should also be removed for consistency with the URL pattern, so it should be activateOven
instead of /activateOven
.
See
It can be seen that in the async-branch, there is an instruction to remove the trailing part, which is missing in the else-branch for non-async invocations.
Hi,
as I am implementing an application in Spring Boot that relies on the BaSyx java SDK I came upon a problem with the Apache Tomcat dependency used by the BaSyx SDK. Calling RegistryComponent.startComponent()
or AASServerComponent.startComponent()
produces an exception preventing the user from starting an AAS server or registry.
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[d2e61a47-5324-4448-8c8f-a0cca4e2fb72]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440) ~[tomcat-embed-core-9.0.62.jar:9.0.62]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198) ~[tomcat-embed-core-9.0.62.jar:9.0.62]
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432) ~[tomcat-embed-core-9.0.62.jar:9.0.62]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.62.jar:9.0.62]
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927) ~[tomcat-embed-core-9.0.62.jar:9.0.62]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.62.jar:9.0.62]
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486) ~[tomcat-embed-core-9.0.62.jar:9.0.62]
at org.eclipse.basyx.vab.protocol.http.server.BaSyxHTTPServer.lambda$start$0(BaSyxHTTPServer.java:161) ~[basyx.sdk-1.0.2.jar:na]
at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.concurrent.ScheduledExecutorService.scheduleWithFixedDelay(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit)" because the return value of "org.apache.catalina.Server.getUtilityExecutor()" is null
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:951) ~[tomcat-embed-core-9.0.62.jar:9.0.62]
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263) ~[tomcat-embed-core-9.0.62.jar:9.0.62]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.62.jar:9.0.62]
... 7 common frames omitted
I created a minimal example to demonstrate the problem:
@Controller
public class ServerController {
@PostConstruct
void init() {
// assemble paths of AAS Server and Registry
int registryPort = 4000;
String registryContextPath = "registry";
//create RegistryComponent
BaSyxContextConfiguration registryContextConfig = new BaSyxContextConfiguration(registryPort, registryContextPath);
BaSyxRegistryConfiguration registryConfig = new BaSyxRegistryConfiguration(RegistryBackend.INMEMORY);
RegistryComponent registry = new RegistryComponent(registryContextConfig, registryConfig);
registry.startComponent();
}
}
I also created a project that contains the code to demonstrate the problem: https://github.com/Marrrrtthias/basyx-dependency-problem
To me it seems like the problem comes up because a dependency mismatch between Spring-web which uses tomcat-embed-core 9.0.62 and basyx.sdk which uses tomcat-catalina 8.5.41, both of which provide the classes Tomcat.java, LifecycleBase.java and others. Because Maven can not handle different versions of the same library in ine project the BaSyx SDK uses the classes from tomcat-embed-core 9.0.62 which are apparenly incompatible.
I am not sure if this is really a BaSyx problem or if you can really do anything about it, but because Spring is a very widely used library i wanted to report the problem nonetheless.
Instead of looking for the "statements" entry (cf. DotAAS Part 1 V2.0.1, page 247), the "statement" entry is used. See eclipse-basyx/basyx-java-components#158 (comment) for an example JSON triggering this issue.
See eclipse-basyx/basyx-java-components#158 (comment) for an example JSON triggering the issue.
Currently, the following is returned:
{
"Machine": {
"statements": [
{
"semanticId": {
"keys": []
},
"idShort": "Motor",
"entityType": "CoManagedEntity",
"hasDataSpecification": [],
"kind": "Instance",
"statements": [],
"modelType": {
"name": "Entity"
},
"asset": {
"keys": []
},
"constraints": []
}
],
"asset": {
"keys": [
{
"idType": "IRI",
"index": 0,
"type": "Asset",
"value": "asset_test2",
"local": false
}
]
}
}
}
Instead, the following should be returned:
{
"Machine": {
"statements":
{
"Motor" : {
"statements": {},
"asset": {
"keys": []
}
},
"asset": {
"keys": [
{
"idType": "IRI",
"index": 0,
"type": "Asset",
"value": "asset_test2",
"local": false
}
]
}
}
}
Currently files unzipped by public void unzipRelatedFiles()
in AASXToMetamodelConverter.java are stored in the rootFolder.
Wouldn't it be better to store the files in a temporary directory? The rootFolder ends up being the local maven repository.
Basyx SDK should not declare logback and janina as "compile" scope dependencies, since only runtime would depend on it, or tests.
Instead it should declare slf4j-api explicitly as compile-time dependency ("logback" and "janina" rather for test).
Using unzipRelatedFiles
on "01_Festo.aasx" produces 30 lines of INFO log.
These should rather be DEBUG
.
logger.info("Unzipping " + filePath);
logger.info("Unzipping to " + destDir);
This may seem picky, but in my opinion "regular" operations should not produce as much log output in order to keep log output more readable.
I can make PRs for such things - but let's get to know each other first ;)
I tried to convert an aasx bundles to metamodel using this util class in basyx-sdk vresion 1.2.0-RC1.
there is an issue with commons-io method IOUtils.copy
AASXToMetamodelConverter aasxConverter = new AASXToMetamodelConverter(new ByteArrayInputStream(fileContents));
aasxConverter.retrieveAASBundles()
method -> IOUtils.copy(stream, writer, StandardCharsets.UTF_8);
the exception is as follows :
threw exception [Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/io/IOUtils] with root cause
java.lang.ClassNotFoundException: org.apache.commons.io.IOUtils
An AAS Server is able to serve multiple shells. Each shell can have multiple submodels.
As the Submodel Aggregator
is currenlty holding the Submodel APIs
in a Map with idShort
as key, all Submodel Apis based on same idShort will overwrite each other and only one will be left serving for all other. The AAS Server will serve the wrong Submodel in this case for all but one of these Submodels.
It is very likely on larger AAS Server instances, that there are equal idShorts used, so it would be better to use the identifier.id instead.
How to reproduce:
Possible solution:
Refactor SubmodelAggregator
to use Identifier instead of idShort e.g. here ...
smApiMap.put(submodelAPI.getSubmodel().getIdShort(), submodelAPI);
use identifier ...
smApiMap.put(submodelAPI.getSubmodel().getIdentification().getId(), submodelAPI);
as it is already done on the AAS Aggregators level e.g. in MongoDbAASAggregator
for the aasProviderMap:
aasProviderMap.put(aas.getIdentification().getId(), provider);
Basyx Version: 1.1.0-SNAPSHOT
BR Matthias
Hi,
I am using Version 1.3.1 of the Registry and the SDK and trying to achieve the following:
I want to connect to a OTS Registry that is running in Docker eclipsebasyx/aas-registry:1.3.1
When I try to connect to it via
var registry = new AASRegistryProxy("http://localhost:8082/registry/api/v1/registry");
registry.addMapping("Elem", ELEM_MAPPING);
it returns:
Exception in thread "main" org.eclipse.basyx.vab.exception.provider.MalformedRequestException: [6 | 400 - MalformedRequestException: Create (POST) on a registry is not supported. Please, use put, 6 | [HTTP POST] Failed to request http://localhost:8082/registry with mediatype application/json;charset=UTF-8. "MalformedRequestException: Create (POST) on a registry is not supported. Please, use put"]
at org.eclipse.basyx.vab.protocol.http.server.ExceptionToHTTPCodeMapper.mapToException(ExceptionToHTTPCodeMapper.java:100)
at org.eclipse.basyx.vab.protocol.http.connector.HTTPConnector.handleProcessingException(HTTPConnector.java:325)
at org.eclipse.basyx.vab.protocol.http.connector.HTTPConnector.httpPost(HTTPConnector.java:269)
at org.eclipse.basyx.vab.protocol.http.connector.HTTPConnector.createValue(HTTPConnector.java:142)
at org.eclipse.basyx.vab.coder.json.connector.JSONConnector.createValue(JSONConnector.java:141)
at org.eclipse.basyx.vab.modelprovider.VABElementProxy.createValue(VABElementProxy.java:114)
at org.eclipse.basyx.vab.registry.proxy.VABRegistryProxy.addMapping(VABRegistryProxy.java:77)
at de.xyz.basyx.experiments.localserverwithgateway.Main.main(Main.java:37)
However when I create the Registry in Memory directly in my program it works with using the AASRegistryProxy.
Hi, I am trying to reproduce the steps of the basic example, so that I can execute all 8 steps.
At step 3 I do not know what to do, it doesn't get that clear in the wiki. Do I have to copy the code or is it somewhere in the repo? If I have to copy, what imports do I need and how does the directory structure must look like at the end? I appreciate any help. Cheers
Hi,
this question is related to Basyx 1.4
when registering a submodel via
// AASRegistryProxy
register(IIdentifier aas, SubmodelDescriptor smDescriptor)
and then use it:
registry.register(
aas.getIdentification(),
new SubmodelDescriptor(
ovenSubmodel,
endpoint_on_another_server));
I am able to add an endpoint when creating the SubmodelDescriptor that potentially points to a completely different server.
GET on the Registry submodel "ovensubmodel1"
{
"modelType": {
"name": "SubmodelDescriptor"
},
"idShort": "Oven",
"identification": {
"idType": "IRI",
"id": "ovensubmodel1"
},
"endpoints": [
{
"type": "http",
"address": "http://endpoint_on_another_server:4001/aasServer/shells/urn%3Aorg.eclipse.basyx%3AOvenAAS/aas/submodels/Oven/submodel"
}
]
}
The provided endpoint is ignored and the registry always outputs the adress of the server where the AAS is also running.
GET on the Registry submodel "ovensubmodel1"
{
"modelType": {
"name": "SubmodelDescriptor"
},
"idShort": "Oven",
"identification": {
"idType": "IRI",
"id": "ovensubmodel1"
},
"endpoints": [
{
"type": "http",
"address": "http://endpoint_of_aas_server:8081/aasServer/shells/urn%3Aorg.eclipse.basyx%3AOvenAAS/aas/submodels/Oven/submodel"
}
]
}
How do I register a submodeldescriptor that that points to another server e.g. when I have a AAS which has submodels with interactive functionality (e.g. invokeoperations) running on multiple servers
I've set up a AAS server and request all submodels. I generate it like this using https://github.com/eclipse-basyx/basyx-python-sdk
submodel = model.Submodel(
identification=model.Identifier(
"https://acplt.org/Simple_Submodel", model.IdentifierType.IRI
),
submodel_element={
model.Property(
id_short="ExampleProperty",
value_type=basyx.aas.model.datatypes.String,
value="exampleValue",
)
},
)
submodel_json_string = json.dumps(submodel, cls=basyx.aas.adapter.json.AASToJsonEncoder)
and then simply upload it via a PUT
request to the aasServer.
Afterwards I GET
the submodel again and the payload from AAS server 1.0.2 looks like this
{
"idShort": "",
"modelType": {
"name": "Submodel"
},
"identification": {
"id": "https://acplt.org/Simple_Submodel",
"idType": "IRI"
},
"submodelElements": {
"ExampleProperty": {
"idShort": "ExampleProperty",
"modelType": {
"name": "Property"
},
"semanticId": {
"keys": [
{
"type": "GlobalReference",
"idType": "IRI",
"value": "http://acplt.org/Properties/SimpleProperty",
"local": false
}
]
},
"value": "exampleValue",
"valueType": "string"
}
}
}
this is a bit different from what the json serialization from python returns:
{
"idShort": "",
"modelType": {
"name": "Submodel"
},
"identification": {
"id": "https://acplt.org/Simple_Submodel",
"idType": "IRI"
},
"submodelElements": [
{
"idShort": "ExampleProperty",
"modelType": {
"name": "Property"
},
"semanticId": {
"keys": [
{
"type": "GlobalReference",
"idType": "IRI",
"value": "http://acplt.org/Properties/SimpleProperty",
"local": false
}
]
},
"value": "exampleValue",
"valueType": "string"
}
]
}
And according to my bug report in eclipse-basyx/basyx-python-sdk#7 the AASServer is violating the spec and returning an incorrect payload. Could you verfy that?
Given this test, the Property p1111 inside SubmodelElementCollection sec111 is rendered in json within a map instead of within a list...
Applies to development branch.
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.eclipse.basyx.aas.factory.json.MetamodelToJSONConverter;
import org.eclipse.basyx.aas.metamodel.map.AasEnv;
import org.eclipse.basyx.submodel.metamodel.api.identifier.IdentifierType;
import org.eclipse.basyx.submodel.metamodel.api.submodelelement.ISubmodelElement;
import org.eclipse.basyx.submodel.metamodel.api.submodelelement.entity.EntityType;
import org.eclipse.basyx.submodel.metamodel.map.Submodel;
import org.eclipse.basyx.submodel.metamodel.map.identifier.Identifier;
import org.eclipse.basyx.submodel.metamodel.map.submodelelement.SubmodelElementCollection;
import org.eclipse.basyx.submodel.metamodel.map.submodelelement.dataelement.property.Property;
import org.eclipse.basyx.submodel.metamodel.map.submodelelement.dataelement.property.valuetype.ValueType;
import org.eclipse.basyx.submodel.metamodel.map.submodelelement.entity.Entity;
import org.eclipse.basyx.vab.coder.json.serialization.DefaultTypeFactory;
import org.eclipse.basyx.vab.coder.json.serialization.GSONTools;
import org.junit.Test;
public class BaSyxEntitySerializationTests {
@Test
public void testBaSyxSerialization() {
GSONTools gsonTools = new GSONTools(new DefaultTypeFactory(), true, false);
Submodel submodel = new Submodel("TestBaSyxSerialization", new Identifier(IdentifierType.CUSTOM, "blub"));
SubmodelElementCollection sec1 = new SubmodelElementCollection("sec1");
submodel.addSubmodelElement(sec1);
Entity e11 = new Entity("e11", EntityType.COMANAGEDENTITY);
sec1.addSubmodelElement(e11);
SubmodelElementCollection sec111 = new SubmodelElementCollection("sec111");
List<ISubmodelElement> statements = new ArrayList<>();
statements.add(sec111);
e11.setStatements(statements);
Property p1111 = new Property("p1111", ValueType.String);
sec111.addSubmodelElement(p1111);
AasEnv aasEnv = new AasEnv(Arrays.asList(), Arrays.asList(), Arrays.asList(), Arrays.asList(submodel));
String serialized = MetamodelToJSONConverter.convertToJSON(aasEnv);
System.out.println(serialized);
}
}
Broken:
{
"assetAdministrationShells": [],
"submodels": [
{
"idShort": "TestBaSyxSerialization",
"identification": {"idType": "Custom", "id": "blub"},
"dataSpecification": [],
"embeddedDataSpecifications": [],
"modelType": {"name": "Submodel"},
"kind": "Instance",
"submodelElements": [
{
"modelType": {"name": "SubmodelElementCollection"},
"kind": "Instance",
"idShort": "sec1",
"value": [
{
"modelType": {"name": "Entity"},
"kind": "Instance",
"idShort": "e11",
"entityType": "CoManagedEntity",
"parent": {
"keys": [
{"type": "Submodel", "local": true, "value": "blub", "idType": "Custom"},
{"type": "SubmodelElementCollection", "local": true, "value": "sec1", "idType": "IdShort"}
]
},
"statement": [
{
"modelType": {"name": "SubmodelElementCollection"},
"kind": "Instance",
"idShort": "sec111",
"value": {
"p1111": {
"modelType": {"name": "Property"},
"kind": "Instance",
"idShort": "p1111",
"valueType": "string",
"parent": {"keys": [{"type": "SubmodelElementCollection", "local": true, "value": "sec111", "idType": "IdShort"}]}
}
},
"ordered": true,
"allowDuplicates": true
}
]
}
],
"ordered": true,
"allowDuplicates": true,
"parent": {"keys": [{"type": "Submodel", "local": true, "value": "blub", "idType": "Custom"}]}
}
]
}
],
"assets": [],
"conceptDescriptions": []
}
Should be:
{
"assetAdministrationShells": [],
"submodels": [
{
"idShort": "TestBaSyxSerialization",
"identification": {"idType": "Custom", "id": "blub"},
"dataSpecification": [],
"embeddedDataSpecifications": [],
"modelType": {"name": "Submodel"},
"kind": "Instance",
"submodelElements": [
{
"modelType": {"name": "SubmodelElementCollection"},
"kind": "Instance",
"idShort": "sec1",
"value": [
{
"modelType": {"name": "Entity"},
"kind": "Instance",
"idShort": "e11",
"entityType": "CoManagedEntity",
"parent": {
"keys": [
{"type": "Submodel", "local": true, "value": "blub", "idType": "Custom"},
{"type": "SubmodelElementCollection", "local": true, "value": "sec1", "idType": "IdShort"}
]
},
"statement": [
{
"modelType": {"name": "SubmodelElementCollection"},
"kind": "Instance",
"idShort": "sec111",
"value": [
{
"modelType": {"name": "Property"},
"kind": "Instance",
"idShort": "p1111",
"valueType": "string",
"parent": {"keys": [{"type": "SubmodelElementCollection", "local": true, "value": "sec111", "idType": "IdShort"}]}
}
],
"ordered": true,
"allowDuplicates": true
}
]
}
],
"ordered": true,
"allowDuplicates": true,
"parent": {"keys": [{"type": "Submodel", "local": true, "value": "blub", "idType": "Custom"}]}
}
]
}
],
"assets": [],
"conceptDescriptions": []
}
refers to 1.4.0
do a mvn dependency:tree
[INFO] +- javax.ws.rs:javax.ws.rs-api:jar:2.1.1:compile
[INFO] +- org.glassfish.jersey.core:jersey-client:jar:2.39.1:compile
[INFO] | +- jakarta.ws.rs:jakarta.ws.rs-api:jar:2.1.6:compile
Should be the second only (in favor of the first).
After removing the "old" dependency, you could also enforce it in mvn
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-banned-dependencies</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<bannedDependencies>
<excludes>
<!-- in favor of jakarta.ws.rs:jakarta.ws.rs-api -->
<exclude>javax.ws.rs:javax.ws.rs-api</exclude>
</excludes>
</bannedDependencies>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
(I probably will be opening some more tickets in the near future - just about to start integrating Basyx SDK 1.4.0 ...)
I have extracted the JSON Schema from SPECIFICATION Details of the Asset Administration Shell (p.232 ff).
How compatible is this implementation with the JSON Schema?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.