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

[BUG] Cannot load AASX files with JSON payload #479

Closed
StenGruener opened this issue Oct 2, 2024 · 4 comments · Fixed by #565
Closed

[BUG] Cannot load AASX files with JSON payload #479

StenGruener opened this issue Oct 2, 2024 · 4 comments · Fixed by #565
Assignees
Labels
bug Something isn't working

Comments

@StenGruener
Copy link
Contributor

StenGruener commented Oct 2, 2024

Hi all

i fail to load aasx files with json payload into the server.

2024-10-02T14:05:56.462Z INFO 1 --- [ main] a.p.AasEnvironmentPreconfigurationLoader : Loading AAS Environment (1/3) from file 'jsonAO2000.aasx' 2024-10-02T14:05:56.697Z WARN 1 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'preconfigurationLoaderInitializer' defined in URL [jar:file:/application/basyxExecutable.jar!/BOOT-INF/lib/basyx.aasenvironment-core-2.0.0-SNAPSHOT.jar!/org/eclipse/digitaltwin/basyx/aasenvironment/preconfiguration/PreconfigurationLoaderInitializer.class]: deserialization failed 2024-10-02T14:05:56.705Z WARN 1 --- [ main] o.s.b.f.support.DisposableBeanAdapter : Invocation of close method failed on bean with name 'mqttClient': Client is connected (32100) 2024-10-02T14:05:56.725Z INFO 1 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2024-10-02T14:05:56.770Z INFO 1 --- [ main] .s.b.a.l.ConditionEvaluationReportLogger : Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled. 2024-10-02T14:05:56.819Z ERROR 1 --- [ main] o.s.boot.SpringApplication : Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'preconfigurationLoaderInitializer' defined in URL [jar:file:/application/basyxExecutable.jar!/BOOT-INF/lib/basyx.aasenvironment-core-2.0.0-SNAPSHOT.jar!/org/eclipse/digitaltwin/basyx/aasenvironment/preconfiguration/PreconfigurationLoaderInitializer.class]: deserialization failed at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1770) ~[spring-beans-6.0.12.jar!/:6.0.12] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:598) ~[spring-beans-6.0.12.jar!/:6.0.12] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[spring-beans-6.0.12.jar!/:6.0.12] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.0.12.jar!/:6.0.12] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.12.jar!/:6.0.12] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.0.12.jar!/:6.0.12] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.0.12.jar!/:6.0.12] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:973) ~[spring-beans-6.0.12.jar!/:6.0.12] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:942) ~[spring-context-6.0.12.jar!/:6.0.12] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:608) ~[spring-context-6.0.12.jar!/:6.0.12] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.1.4.jar!/:3.1.4] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) ~[spring-boot-3.1.4.jar!/:3.1.4] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:439) ~[spring-boot-3.1.4.jar!/:3.1.4] at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-3.1.4.jar!/:3.1.4] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1309) ~[spring-boot-3.1.4.jar!/:3.1.4] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1298) ~[spring-boot-3.1.4.jar!/:3.1.4] at org.eclipse.digitaltwin.basyx.aasenvironment.component.AasEnvironmentComponent.main(AasEnvironmentComponent.java:42) ~[classes!/:2.0.0-SNAPSHOT] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na] at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[basyxExecutable.jar:2.0.0-SNAPSHOT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:95) ~[basyxExecutable.jar:2.0.0-SNAPSHOT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[basyxExecutable.jar:2.0.0-SNAPSHOT] at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65) ~[basyxExecutable.jar:2.0.0-SNAPSHOT] Caused by: org.eclipse.digitaltwin.aas4j.v3.dataformat.core.DeserializationException: deserialization failed at org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlDeserializer.read(XmlDeserializer.java:120) ~[aas4j-dataformat-xml-1.0.2.jar!/:na] at org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXDeserializer.read(AASXDeserializer.java:99) ~[aas4j-dataformat-aasx-1.0.2.jar!/:na] at org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXDeserializer.parseReferencedFilePathsFromAASX(AASXDeserializer.java:201) ~[aas4j-dataformat-aasx-1.0.2.jar!/:na] at org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXDeserializer.getRelatedFiles(AASXDeserializer.java:125) ~[aas4j-dataformat-aasx-1.0.2.jar!/:na] at org.eclipse.digitaltwin.basyx.aasenvironment.environmentloader.CompleteEnvironment.fromInputStream(CompleteEnvironment.java:113) ~[basyx.aasenvironment-core-2.0.0-SNAPSHOT.jar!/:2.0.0-SNAPSHOT] at org.eclipse.digitaltwin.basyx.aasenvironment.environmentloader.CompleteEnvironment.fromFile(CompleteEnvironment.java:96) ~[basyx.aasenvironment-core-2.0.0-SNAPSHOT.jar!/:2.0.0-SNAPSHOT] at org.eclipse.digitaltwin.basyx.aasenvironment.preconfiguration.AasEnvironmentPreconfigurationLoader.loadPreconfiguredEnvironments(AasEnvironmentPreconfigurationLoader.java:85) ~[basyx.aasenvironment-core-2.0.0-SNAPSHOT.jar!/:2.0.0-SNAPSHOT] at org.eclipse.digitaltwin.basyx.aasenvironment.preconfiguration.PreconfigurationLoaderInitializer.loadPreconfiguredEnvironment(PreconfigurationLoaderInitializer.java:68) ~[basyx.aasenvironment-core-2.0.0-SNAPSHOT.jar!/:2.0.0-SNAPSHOT] at org.eclipse.digitaltwin.basyx.aasenvironment.preconfiguration.PreconfigurationLoaderInitializer.afterPropertiesSet(PreconfigurationLoaderInitializer.java:60) ~[basyx.aasenvironment-core-2.0.0-SNAPSHOT.jar!/:2.0.0-SNAPSHOT] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1817) ~[spring-beans-6.0.12.jar!/:6.0.12] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1766) ~[spring-beans-6.0.12.jar!/:6.0.12] ... 24 common frames omitted Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character '{' (code 123) in prolog; expected '<' at [row,col {unknown-source}]: [1,1] at com.fasterxml.jackson.dataformat.xml.XmlFactory._initializeXmlReader(XmlFactory.java:734) ~[jackson-dataformat-xml-2.15.2.jar!/:2.15.2] at com.fasterxml.jackson.dataformat.xml.XmlFactory._createParser(XmlFactory.java:618) ~[jackson-dataformat-xml-2.15.2.jar!/:2.15.2] at com.fasterxml.jackson.dataformat.xml.XmlFactory.createParser(XmlFactory.java:496) ~[jackson-dataformat-xml-2.15.2.jar!/:2.15.2] at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3772) ~[jackson-databind-2.15.2.jar!/:2.15.2] at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3740) ~[jackson-databind-2.15.2.jar!/:2.15.2] at org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlDeserializer.read(XmlDeserializer.java:118) ~[aas4j-dataformat-xml-1.0.2.jar!/:na] ... 34 common frames omitted Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '{' (code 123) in prolog; expected '<' at [row,col {unknown-source}]: [1,1] at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:666) ~[woodstox-core-6.5.1.jar!/:6.5.1] at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2148) ~[woodstox-core-6.5.1.jar!/:6.5.1] at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1180) ~[woodstox-core-6.5.1.jar!/:6.5.1] at com.fasterxml.jackson.dataformat.xml.XmlFactory._initializeXmlReader(XmlFactory.java:729) ~[jackson-dataformat-xml-2.15.2.jar!/:2.15.2]
Aas4j should support this eclipse-aas4j/aas4j#287 feature.

I also attach a demo AASX file (please rename to aasx) jsonAO2000docs.zip

Thanks!

@StenGruener StenGruener added the bug Something isn't working label Oct 2, 2024
@github-project-automation github-project-automation bot moved this to To triage in Support Requests Oct 2, 2024
@StenGruener
Copy link
Contributor Author

bump

@aaronzi
Copy link
Member

aaronzi commented Oct 23, 2024

Hi Sten,

we found the problem in the AAS Environment (when using the preconfiguration and the /serialization endpoint. Both currently don't support serializing/deserializing aasx files with json content. Since this is already implemented in aas4j it should be an easy fix.

For reference here is the link to aas4j with the method to be used: aas4j AASXSerializer

Changes need to be made here:

I will put this ticket in our backlog so that it can be implemented in the next weeks.

@aaronzi aaronzi moved this to BaSyx Java V2 in BaSyx Backlog Oct 23, 2024
@mateusmolina-iese mateusmolina-iese self-assigned this Oct 25, 2024
@aaronzi aaronzi removed this from BaSyx Backlog Oct 25, 2024
@mateusmolina-iese mateusmolina-iese removed their assignment Oct 29, 2024
@mdanish98
Copy link
Contributor

We are waiting for a new release from AAS4J, because we need the aas4j AASXSerializer methods.

@mateusmolina-iese mateusmolina-iese self-assigned this Dec 9, 2024
@mateusmolina-iese
Copy link
Member

This issue should be fixed once PR #565 is merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants