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

Deviceintegration example on linux fails #76

Closed
sureshmoon opened this issue Feb 9, 2023 · 4 comments
Closed

Deviceintegration example on linux fails #76

sureshmoon opened this issue Feb 9, 2023 · 4 comments

Comments

@sureshmoon
Copy link

Dear Team,
Thank you, Nice Work.
The basyx.examples.deviceintegration example throws blow error while running(on ubuntu 22.04 ) "docker compose up", any help please. Thank You.

ubuntu@ubuntu-ros:~/Desktop/basyx-java-examples/basyx.examples.deviceintegration/src/main/resources$ docker compose up
[+] Running 5/0
⠿ Container registry-device-integration Running 0.0s
⠿ Container aasGui-device-integration Running 0.0s
⠿ Container resources-mqtt-1 Running 0.0s
⠿ Container asset-device-integration Running 0.0s
⠿ Container aas-device-integration Created 0.0s
Attaching to aas-device-integration, aasGui-device-integration, asset-device-integration, databridge-device-integration, registry-device-integration, resources-mqtt-1
resources-mqtt-1 | 1675955916: New connection from 127.0.0.1:47640 on port 1884.
resources-mqtt-1 | 1675955916: New client connected from 127.0.0.1:47640 as probe (p2, c1, k60).
resources-mqtt-1 | 1675955916: Client probe disconnected.
aas-device-integration | wait-for-it.sh: waiting for registry:4000 without a timeout
aas-device-integration | wait-for-it.sh: registry:4000 is available after 0 seconds
aas-device-integration | 15:18:37.091 [main] INFO org.eclipse.basyx.components.aas.executable.AASServerExecutable - Starting BaSyx AASServer component...
aas-device-integration | 15:18:37.107 [main] ERROR org.eclipse.basyx.components.configuration.BaSyxConfiguration - Configuration file not found: '/usr/share/config/context.properties'
aas-device-integration | java.io.FileNotFoundException: /usr/share/config/context.properties (No such file or directory)
aas-device-integration | at java.base/java.io.FileInputStream.open0(Native Method)
aas-device-integration | at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
aas-device-integration | at java.base/java.io.FileInputStream.(FileInputStream.java:157)
aas-device-integration | at java.base/java.io.FileInputStream.(FileInputStream.java:112)
aas-device-integration | at org.eclipse.basyx.components.configuration.BaSyxConfiguration.loadFromFile(BaSyxConfiguration.java:73)
aas-device-integration | at org.eclipse.basyx.components.configuration.BaSyxConfiguration.loadFileOrDefaultResource(BaSyxConfiguration.java:101)
aas-device-integration | at org.eclipse.basyx.components.configuration.BaSyxContextConfiguration.loadFromDefaultSource(BaSyxContextConfiguration.java:140)
aas-device-integration | at org.eclipse.basyx.components.aas.executable.AASServerExecutable.main(AASServerExecutable.java:54)
aas-device-integration | 15:18:37.142 [main] INFO org.eclipse.basyx.components.configuration.BaSyxConfiguration - Environment - contextPath: /aasServer
aas-device-integration | 15:18:37.142 [main] INFO org.eclipse.basyx.components.configuration.BaSyxConfiguration - Environment - contextPort: 4001
aas-device-integration | 15:18:37.142 [main] INFO org.eclipse.basyx.components.configuration.BaSyxConfiguration - Environment - accessControlAllowOrigin: *
aas-device-integration | 15:18:37.151 [main] ERROR org.eclipse.basyx.components.configuration.BaSyxConfiguration - Configuration file not found: '/usr/share/config/aas.properties'
aas-device-integration | java.io.FileNotFoundException: /usr/share/config/aas.properties (No such file or directory)
aas-device-integration | at java.base/java.io.FileInputStream.open0(Native Method)
aas-device-integration | at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
aas-device-integration | at java.base/java.io.FileInputStream.(FileInputStream.java:157)
aas-device-integration | at java.base/java.io.FileInputStream.(FileInputStream.java:112)
aas-device-integration | at org.eclipse.basyx.components.configuration.BaSyxConfiguration.loadFromFile(BaSyxConfiguration.java:73)
aas-device-integration | at org.eclipse.basyx.components.configuration.BaSyxConfiguration.loadFileOrDefaultResource(BaSyxConfiguration.java:101)
aas-device-integration | at org.eclipse.basyx.components.aas.configuration.BaSyxAASServerConfiguration.loadFromDefaultSource(BaSyxAASServerConfiguration.java:186)
aas-device-integration | at org.eclipse.basyx.components.aas.executable.AASServerExecutable.main(AASServerExecutable.java:58)
aas-device-integration | 15:18:37.152 [main] INFO org.eclipse.basyx.components.configuration.BaSyxConfiguration - Environment - registry.path: http://registry:4000/registry/
aas-device-integration | 15:18:37.153 [main] INFO org.eclipse.basyx.components.configuration.BaSyxConfiguration - Environment - aas.backend: InMemory
aas-device-integration | 15:18:37.154 [main] INFO org.eclipse.basyx.components.configuration.BaSyxConfiguration - Environment - aas.source: /usr/share/config/Heater_AAS.aasx
aas-device-integration | 15:18:37.212 [main] INFO org.eclipse.basyx.components.aas.AASServerComponent - Create the server...
aas-device-integration | 15:18:37.213 [main] INFO org.eclipse.basyx.components.aas.AASServerComponent - Registry loaded at "http://registry:4000/registry/"
aas-device-integration | 15:18:37.460 [main] INFO org.eclipse.basyx.components.aas.AASServerComponent - Loading aas from aasx "/usr/share/config/Heater_AAS.aasx"
aas-device-integration | 15:18:38.162 [main] WARN org.eclipse.basyx.submodel.factory.xml.converters.qualifier.qualifiable.QualifiableXMLConverter - Creating element {aas:type=delegatedTo , aas:valueType={}, aas:value=http://host.docker.internal:8082/heater/targetTemperature/last} without mandatory valueType!
aas-device-integration | 15:18:38.174 [main] WARN org.eclipse.basyx.submodel.factory.xml.converters.qualifier.qualifiable.QualifiableXMLConverter - Creating element {aas:type=invocationDelegation, aas:valueType={}, aas:value=http://host.docker.internal:8082/heater/setTargetTemperature/invoke} without mandatory valueType!
aas-device-integration | 15:18:38.187 [main] DEBUG org.eclipse.basyx.aas.bundle.AASBundleFactory - Found Submodel temperatureSensor for AAS heater
aas-device-integration | 15:18:38.189 [main] DEBUG org.eclipse.basyx.aas.bundle.AASBundleFactory - Found Submodel heaterControl for AAS heater
registry-device-integration | 15:18:39.934 [http-nio-4000-exec-5] DEBUG org.eclipse.basyx.vab.protocol.http.server.VABHTTPInterface - Exception in HTTP-GET. Response-code: 404
registry-device-integration | org.eclipse.basyx.vab.exception.provider.ResourceNotFoundException: Could not look up descriptor for AAS heaterAAS since it does not exist
registry-device-integration | at org.eclipse.basyx.aas.registration.memory.AASRegistry.lookupAAS(AASRegistry.java:76)
registry-device-integration | at org.eclipse.basyx.aas.registration.restapi.AASRegistryModelProvider.getAASDescriptor(AASRegistryModelProvider.java:243)
registry-device-integration | at org.eclipse.basyx.aas.registration.restapi.AASRegistryModelProvider.getValue(AASRegistryModelProvider.java:202)
registry-device-integration | at org.eclipse.basyx.vab.coder.json.provider.JSONProvider.processBaSysGet(JSONProvider.java:191)
registry-device-integration | at org.eclipse.basyx.vab.protocol.http.server.VABHTTPInterface.doGet(VABHTTPInterface.java:130)
registry-device-integration | at javax.servlet.http.HttpServlet.service(HttpServlet.java:645)
registry-device-integration | at org.eclipse.basyx.vab.protocol.http.server.BasysHTTPServlet.service(BasysHTTPServlet.java:75)
registry-device-integration | at javax.servlet.http.HttpServlet.service(HttpServlet.java:750)
registry-device-integration | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
registry-device-integration | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
registry-device-integration | at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177)
registry-device-integration | at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
registry-device-integration | at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
registry-device-integration | at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
registry-device-integration | at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
registry-device-integration | at org.apache.catalina.valves.HealthCheckValve.invoke(HealthCheckValve.java:102)
registry-device-integration | at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
registry-device-integration | at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
registry-device-integration | at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
registry-device-integration | at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
registry-device-integration | at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891)
registry-device-integration | at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784)
registry-device-integration | at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
registry-device-integration | at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
registry-device-integration | at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
registry-device-integration | at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
registry-device-integration | at java.base/java.lang.Thread.run(Thread.java:829)
aas-device-integration | 15:18:40.076 [main] DEBUG io.netty.util.internal.logging.InternalLoggerFactory - Using SLF4J as the default logging framework
aas-device-integration | 15:18:40.083 [main] DEBUG io.netty.util.internal.PlatformDependent0 - -Dio.netty.noUnsafe: false
aas-device-integration | 15:18:40.084 [main] DEBUG io.netty.util.internal.PlatformDependent0 - Java version: 11
aas-device-integration | 15:18:40.090 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.theUnsafe: available
aas-device-integration | 15:18:40.091 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.copyMemory: available
aas-device-integration | 15:18:40.093 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.storeFence: available
aas-device-integration | 15:18:40.094 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Buffer.address: available
aas-device-integration | 15:18:40.096 [main] DEBUG io.netty.util.internal.PlatformDependent0 - direct buffer constructor: unavailable: Reflective setAccessible(true) disabled
aas-device-integration | 15:18:40.098 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Bits.unaligned: available, true
aas-device-integration | 15:18:40.101 [main] DEBUG io.netty.util.internal.PlatformDependent0 - jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable: class io.netty.util.internal.PlatformDependent0$7 cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @7c7a06ec
aas-device-integration | 15:18:40.103 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.DirectByteBuffer.(long, int): unavailable
aas-device-integration | 15:18:40.104 [main] DEBUG io.netty.util.internal.PlatformDependent - sun.misc.Unsafe: available
aas-device-integration | 15:18:40.134 [main] DEBUG io.netty.util.internal.PlatformDependent - maxDirectMemory: 1946157056 bytes (maybe)
aas-device-integration | 15:18:40.135 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.tmpdir: /tmp (java.io.tmpdir)
aas-device-integration | 15:18:40.135 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.bitMode: 64 (sun.arch.data.model)
aas-device-integration | 15:18:40.138 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.maxDirectMemory: -1 bytes
aas-device-integration | 15:18:40.139 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.uninitializedArrayAllocationThreshold: -1
aas-device-integration | 15:18:40.142 [main] DEBUG io.netty.util.internal.CleanerJava9 - java.nio.ByteBuffer.cleaner(): available
aas-device-integration | 15:18:40.142 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.noPreferDirect: false
aas-device-integration | Exception in thread "main" org.eclipse.basyx.vab.exception.provider.ResourceNotFoundException: [HTTP GET] Failed to request http://host.docker.internal:8082 with mediatype application/json;charset=UTF-8
aas-device-integration | at org.eclipse.basyx.vab.protocol.http.server.ExceptionToHTTPCodeMapper.mapToException(ExceptionToHTTPCodeMapper.java:82)
aas-device-integration | at org.eclipse.basyx.vab.protocol.http.connector.HTTPConnector.handleProcessingException(HTTPConnector.java:314)
aas-device-integration | at org.eclipse.basyx.vab.protocol.http.connector.HTTPConnector.httpGet(HTTPConnector.java:211)
aas-device-integration | at org.eclipse.basyx.vab.protocol.http.connector.HTTPConnector.getValue(HTTPConnector.java:78)
aas-device-integration | at org.eclipse.basyx.vab.coder.json.connector.JSONConnector.getValue(JSONConnector.java:105)
aas-device-integration | at org.eclipse.basyx.extensions.submodel.delegation.PropertyDelegationManager.getPropertyValue(PropertyDelegationManager.java:139)
aas-device-integration | at org.eclipse.basyx.extensions.submodel.delegation.PropertyDelegationManager.lambda$5(PropertyDelegationManager.java:131)
aas-device-integration | at org.eclipse.basyx.submodel.metamodel.map.submodelelement.dataelement.property.AASLambdaPropertyHelper.setLambdaValue(AASLambdaPropertyHelper.java:52)
aas-device-integration | at org.eclipse.basyx.extensions.submodel.delegation.PropertyDelegationManager.configureDelegationProperty(PropertyDelegationManager.java:131)
aas-device-integration | at org.eclipse.basyx.extensions.submodel.delegation.PropertyDelegationManager.handleProperty(PropertyDelegationManager.java:125)
aas-device-integration | at org.eclipse.basyx.extensions.submodel.delegation.PropertyDelegationManager.handleSubmodelElement(PropertyDelegationManager.java:83)
aas-device-integration | at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
aas-device-integration | at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
aas-device-integration | at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
aas-device-integration | at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
aas-device-integration | at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
aas-device-integration | at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
aas-device-integration | at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
aas-device-integration | at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
aas-device-integration | at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
aas-device-integration | at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
aas-device-integration | at org.eclipse.basyx.extensions.submodel.delegation.PropertyDelegationManager.handleSubmodel(PropertyDelegationManager.java:72)
aas-device-integration | at org.eclipse.basyx.extensions.submodel.delegation.DelegatingSubmodelAPI.handleSubmodel(DelegatingSubmodelAPI.java:122)
aas-device-integration | at org.eclipse.basyx.extensions.submodel.delegation.DelegatingSubmodelAPI.(DelegatingSubmodelAPI.java:54)
aas-device-integration | at org.eclipse.basyx.extensions.submodel.delegation.DelegatingDecoratingSubmodelAPIFactory.getSubmodelAPI(DelegatingDecoratingSubmodelAPIFactory.java:47)
aas-device-integration | at org.eclipse.basyx.submodel.restapi.api.ISubmodelAPIFactory.create(ISubmodelAPIFactory.java:47)
aas-device-integration | at org.eclipse.basyx.submodel.aggregator.SubmodelAggregator.updateSubmodel(SubmodelAggregator.java:104)
aas-device-integration | at org.eclipse.basyx.submodel.aggregator.SubmodelAggregator.createSubmodel(SubmodelAggregator.java:99)
aas-device-integration | at org.eclipse.basyx.aas.restapi.MultiSubmodelProvider.createSubmodel(MultiSubmodelProvider.java:239)
aas-device-integration | at org.eclipse.basyx.aas.restapi.MultiSubmodelProvider.setValue(MultiSubmodelProvider.java:366)
aas-device-integration | at org.eclipse.basyx.aas.bundle.AASBundleHelper.integrate(AASBundleHelper.java:102)
aas-device-integration | at org.eclipse.basyx.components.aas.AASServerComponent.createAggregatorServlet(AASServerComponent.java:530)
aas-device-integration | at org.eclipse.basyx.components.aas.AASServerComponent.startComponent(AASServerComponent.java:248)
aas-device-integration | at org.eclipse.basyx.components.aas.executable.AASServerExecutable.main(AASServerExecutable.java:67)
dependency failed to start: container for service "aas" exited (1)

@FrankSchnicke
Copy link
Contributor

Hi,

it looks like this is an issue with docker on linux. According to stack overflow, adding

extra_hosts:
  - "host.docker.internal:host-gateway"

to the docker compose file should help.

@FrankSchnicke
Copy link
Contributor

Did this solve your issue?

@sureshmoon
Copy link
Author

Thank you so much FrankSchnicke , The issue is solved, extra_hosts idea works for me.

@FrankSchnicke
Copy link
Contributor

I'm happy hear that 👍

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