odpi / egeria

Egeria core
https://egeria-project.org
Apache License 2.0
795 stars 259 forks source link

[BUG] OMAG Server Start: Failed to parse configuration class #8338

Open ryanturnberry opened 2 weeks ago

ryanturnberry commented 2 weeks ago

Existing/related issue?

No response

Current Behavior

Using the getting started tutorial present on egeria's website https://egeria-project.org/education/tutorials/building-egeria-tutorial/overview/ running the OMAG Server platform fails with this issue `Application run failed

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class`

Expected Behavior

Following the tutorial should result in the OMAG platform running without errors

Steps To Reproduce

Follow the instructions present here: https://egeria-project.org/education/tutorials/building-egeria-tutorial/overview/ and then run the java -Dloader.path=platform/lib,platform/extras -jar platform/omag-server-platform*.jar command to start OMAG server in the /egeria/open-metadata-distribution/omag-server-platform/build/unpacked/egeria-platform-5.1-SNAPSHOT-distribution.tar.gz/assembly directory

You should get this error:

`java -Dloader.path=platform/lib,platform/extras -jar platform/omag-server-platform*.jar Project Egeria - Open Metadata and Governance


/ \ / |/ // | / __/ / / _ _ _ / \ / / _ / / / / _ / / / // /|/ // /| | / / \ \ / _ \ / /| | / // _ \ / / / // // // | / \ / / / | / // || | / // // / / // |/ /_/ / _/ // // / | |/ // // / / // // / \ / / / // / // / / / / / __/// //// ||__/ /__/ _//_/ |/ \/// // // _/\///// \/// // /_/

:: Powered by Spring Boot (v3.1.4) ::

2024-08-28T10:22:33.372-05:00 INFO 75152 --- [ main] o.o.o.p.springboot.OMAGServerPlatform : Starting OMAGServerPlatform using Java 17.0.12 with PID 75152 (/Users/ryantalbert/Desktop/Code/egeria/open-metadata-distribution/omag-server-platform/build/unpacked/egeria-platform-5.1-SNAPSHOT-distribution.tar.gz/assembly/platform/omag-server-platform-5.1-SNAPSHOT.jar started by ryantalbert in /Users/ryantalbert/Desktop/Code/egeria/open-metadata-distribution/omag-server-platform/build/unpacked/egeria-platform-5.1-SNAPSHOT-distribution.tar.gz/assembly) 2024-08-28T10:22:33.373-05:00 INFO 75152 --- [ main] o.o.o.p.springboot.OMAGServerPlatform : No active profile set, falling back to 1 default profile: "default" 2024-08-28T10:22:34.167-05:00 WARN 75152 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [org.odpi.openmetadata.platformchassis.springboot.OMAGServerPlatform] 2024-08-28T10:22:34.181-05:00 INFO 75152 --- [ main] .s.b.a.l.ConditionEvaluationReportLogger :

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled. 2024-08-28T10:22:34.216-05:00 ERROR 75152 --- [ main] o.s.boot.SpringApplication : Application run failed

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [org.odpi.openmetadata.platformchassis.springboot.OMAGServerPlatform] at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:178) ~[spring-context-6.0.12.jar!/:6.0.12] at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:415) ~[spring-context-6.0.12.jar!/:6.0.12] at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:287) ~[spring-context-6.0.12.jar!/:6.0.12] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:344) ~[spring-context-6.0.12.jar!/:6.0.12] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:115) ~[spring-context-6.0.12.jar!/:6.0.12] at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:771) ~[spring-context-6.0.12.jar!/:6.0.12] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:589) ~[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.odpi.openmetadata.platformchassis.springboot.OMAGServerPlatform.main(OMAGServerPlatform.java:135) ~[classes!/:na] 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) ~[omag-server-platform-5.1-SNAPSHOT.jar:na] at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) ~[omag-server-platform-5.1-SNAPSHOT.jar:na] at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[omag-server-platform-5.1-SNAPSHOT.jar:na] at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:467) ~[omag-server-platform-5.1-SNAPSHOT.jar:na] Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'securityConfig' for bean class [org.odpi.openmetadata.userauthn.auth.SecurityConfig] conflicts with existing, non-compatible bean definition of same name and class [org.odpi.openmetadata.userauthn.auth.ldap.LDAPSecurityConfig] at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.checkCandidate(ClassPathBeanDefinitionScanner.java:349) ~[spring-context-6.0.12.jar!/:6.0.12] at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:287) ~[spring-context-6.0.12.jar!/:6.0.12] at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:128) ~[spring-context-6.0.12.jar!/:6.0.12] at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:289) ~[spring-context-6.0.12.jar!/:6.0.12] at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:243) ~[spring-context-6.0.12.jar!/:6.0.12] at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:196) ~[spring-context-6.0.12.jar!/:6.0.12] at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:164) ~[spring-context-6.0.12.jar!/:6.0.12] ... 21 common frames omitted `

Environment

- Egeria: 5.0
- OS: MacOS Sonoma 14.4 (23E214)
- Java: java 17.0.12 2024-07-16 LTS
        Java(TM) SE Runtime Environment (build 17.0.12+8-LTS-286)
        Java HotSpot(TM) 64-Bit Server VM (build 17.0.12+8-LTS-286, mixed mode, sharing)
- Browser (for UI issues): N/A
- Additional connectors and integration:

Any Further Information?

No response

mandy-chessell commented 2 weeks ago

Hello @ryanturnberry, Thank you for raising this.

The error is caused because the platform can not find its application.properties file. If you try:

cd platform

and then run

java -Dloader.path=lib,extras -jar omag-server-platform*.jar

...the platform should start up. This is because the default location of the file is expected to be in the directory where the platform is started from.

There is information on explicitly specifying the application.properties location on the command line (-Dspring.config.location) on this page ...

https://egeria-project.org/guides/admin/configuring-the-omag-server-platform/#command-line-options

ryanturnberry commented 2 weeks ago

Hey @mandy-chessell, Thank you for the prompt reply! One last question. I have changed directory to platform and ran the command: java -Dloader.path=lib,extras -jar omag-server-platform*.jar

And it failed with this output:

`java -Dloader.path=lib,extras -jar omag-server-platform*.jar Project Egeria - Open Metadata and Governance


/ \ / |/ // | / __/ / / _ _ _ / \ / / _ / / / / _ / / / // /|/ // /| | / / \ \ / _ \ / /| | / // _ \ / / / // // // | / \ / / / | / // || | / // // / / // |/ /_/ / _/ // // / | |/ // // / / // // / \ / / / // / // / / / / / __/// //// ||__/ /__/ _//_/ |/ \/// // // _/\///// \/// // /_/

:: Powered by Spring Boot (v3.1.4) ::

2024-08-28T11:10:18.851-05:00 INFO 1448 --- [ main] o.o.o.p.springboot.OMAGServerPlatform : Starting OMAGServerPlatform using Java 17.0.12 with PID 1448 (/Users/ryantalbert/egeria-install/egeria-platform-5.1-SNAPSHOT-distribution.tar.gz/assembly/platform/omag-server-platform-5.1-SNAPSHOT.jar started by ryantalbert in /Users/ryantalbert/egeria-install/egeria-platform-5.1-SNAPSHOT-distribution.tar.gz/assembly/platform) 2024-08-28T11:10:18.852-05:00 INFO 1448 --- [ main] o.o.o.p.springboot.OMAGServerPlatform : No active profile set, falling back to 1 default profile: "default" 2024-08-28T11:10:21.094-05:00 INFO 1448 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 9443 (https) 2024-08-28T11:10:23.193-05:00 INFO 1448 --- [ main] o.o.o.p.springboot.OMAGServerPlatform : Working directory is: /Users/ryantalbert/egeria-install/egeria-platform-5.1-SNAPSHOT-distribution.tar.gz/assembly/platform 2024-08-28T11:10:23.193-05:00 WARN 1448 --- [ main] o.o.o.p.springboot.OMAGServerPlatform : Option strict.ssl is set to false! Invalid certificates will be accepted for connection! 2024-08-28T11:10:23.195-05:00 WARN 1448 --- [ main] o.o.o.p.springboot.OMAGServerPlatform : Java trust store 'javax.net.ssl.trustStore' is null - this is needed by Tomcat - using 'server.ssl.trust-store' 2024-08-28T11:10:24.730-05:00 INFO 1448 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 9443 (https) with context path '' 2024-08-28T11:10:24.739-05:00 INFO 1448 --- [ main] o.o.o.p.springboot.OMAGServerPlatform : Started OMAGServerPlatform in 6.275 seconds (process running for 6.641) Startup OPEN-METADATA-SECURITY-0001 The Open Metadata Security Service org.odpi.openmetadata.metadatasecurity.samples.CocoPharmaPlatformSecurityConnector for OMAG Server Platform Coco Pharmaceuticals Platform is initializing 2024-08-28T11:10:24.789-05:00 INFO 1448 --- [ main] o.o.o.p.springboot.OMAGServerPlatform : Startup detected for servers: active-metadata-store,engine-host,integration-daemon,view-server,simple-metadata-store Wed Aug 28 11:10:24 CDT 2024 active-metadata-store Startup OMRS-AUDIT-0064 The Open Metadata Repository Services (OMRS) has initialized the audit log for the Metadata Access Store called active-metadata-store Wed Aug 28 11:10:24 CDT 2024 active-metadata-store Startup SERVER-OPS-0001 The active-metadata-store server is configured with a max page size of 1000 Wed Aug 28 11:10:24 CDT 2024 active-metadata-store Startup OMRS-AUDIT-0001 The Open Metadata Repository Services (OMRS) is initializing the subsystems to support a new server Wed Aug 28 11:10:24 CDT 2024 active-metadata-store Startup OMRS-AUDIT-0002 Enterprise access through the Enterprise Repository Services is initializing Wed Aug 28 11:10:24 CDT 2024 active-metadata-store Startup OMRS-AUDIT-0003 The local repository is initializing the metadata collection named active-metadata-store with an id of c5409905-a9b6-4f30-85a2-9602b9b5b4b0 Wed Aug 28 11:10:24 CDT 2024 active-metadata-store Startup OMRS-AUDIT-0029 The local repository outbound event manager is initializing Wed Aug 28 11:10:24 CDT 2024 active-metadata-store Startup OMRS-AUDIT-0030 Registering the Local Repository to Local Enterprise event consumer with the local repository outbound event manager Wed Aug 28 11:10:24 CDT 2024 active-metadata-store Startup OMRS-AUDIT-0044 The connector for the local repository is being started in mode Open Metadata Native using connector provider org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.XTDBOMRSRepositoryConnectorProvider and configuration properties {xtdbConfig={xtdb.lucene/lucene-store={db-dir=data/servers/active-metadata-store/repository/xtdb-kv/lucene}, xtdb/tx-log={kv-store={db-dir=data/servers/active-metadata-store/repository/xtdb-kv/rdb-tx, xtdb/module=xtdb.rocksdb/->kv-store}}, xtdb/index-store={kv-store={db-dir=data/servers/active-metadata-store/repository/xtdb-kv/rdb-index, xtdb/module=xtdb.rocksdb/->kv-store}}, xtdb/document-store={kv-store={db-dir=data/servers/active-metadata-store/repository/xtdb-kv/rdb-docs, xtdb/module=xtdb.rocksdb/->kv-store}}}} Wed Aug 28 11:10:24 CDT 2024 active-metadata-store Startup OMRS-AUDIT-0045 The connector for the local repository has been initialized Wed Aug 28 11:10:24 CDT 2024 active-metadata-store Startup OMRS-AUDIT-0046 The connector for the local repository is about to be started Wed Aug 28 11:10:24 CDT 2024 active-metadata-store Startup OMRS-XTDB-REPOSITORY-0001 A request to start an XTDB repository node has been received Wed Aug 28 11:10:24 CDT 2024 active-metadata-store Startup OMRS-XTDB-REPOSITORY-0002 An XTDB repository node is starting with a persistent store WARNING: /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/bin/java is loading libcrypto in an unsafe way zsh: abort java -Dloader.path=lib,extras -jar omag-server-platform*.jar`

I have scanned the documentation and no mention of it. Would you know how to get this working?

Thanks again for the help!

dwolfson commented 2 weeks ago

There are also some getting started blogs/tutorials at https://getting-started-with-egeria.pdr-associates.com/introduction.html

ryanturnberry commented 2 weeks ago

@dwolfson Thanks for the suggestion. I have tried those instructions and they did not help. In fact the EGERIA DISTRIBUTION link provided in the instructions on that blog go to a parked domain with no relation to Egeria.

Screenshot 2024-08-28 at 11 14 31 AM
mandy-chessell commented 2 weeks ago

Hello @ryanturnberry - this error is something we only see on the Apple Macs. it is documented in the release notes:

https://egeria-project.org/release-notes/latest/

If you open up the section on XTDB you will see:

Screenshot 2024-08-28 at 17 15 39

We were hoping it is a temporary problem

dwolfson commented 2 weeks ago

@ryanturnberry - that's very weird - was seeing a size problem earlier but slimmed it down - I'll look. Thanks for letting me know!

dwolfson commented 2 weeks ago

@ryanturnberry - ok - I think that I fixed the link in the getting started. Though at this point you should have a working deployment and, if useful, you could continue with the "getting-started" blogs. Let me know if you need help...

I'll also soon be adding more blogs on using the new Egeria Workspaces - docker compose configuration that simplify using Egeria. Again, let me know if your interested and I can help get you started there...

ryanturnberry commented 2 weeks ago

Thank you for that. A coworker and I are absolutely lost. We got OMAG up and running locally using kafka and zookeeper. We are just trying to get a lab working. At the part where you must start 4 OMAG servers and I can get one running but the other 3 fail.

dwolfson commented 2 weeks ago

hmm - if you want we can jump on a zoom - each of the OMAG platforms needs a different port. But perhaps it's easier to chat.

To be clear, there are many ways to configure and use Egeria. The Coco Pharmaceuticals labs are more of an enterprise deployment running multiple platforms for different purposes and organizations. The getting started blogs use a much simpler, pre-canned deployment that is useful for getting started and getting a feel for how things are put together and used.

You can message me on Egeria's slack or send me email: dan.wolfson@pdr-associates.com