OpenLiberty / ci.maven

Maven plugins for managing Liberty profile servers #devops
Apache License 2.0
126 stars 90 forks source link

generate-features stuck #1598

Open inad9300 opened 2 years ago

inad9300 commented 2 years ago

After upgrading to 3.7, I gave a try to feature generation, as I was looking forward to it. When running:

./mvnw clean compile liberty:generate-features --debug

It gets quickly stuck, while fully utilizing one CPU core. This is the last bit of output I see (I waited for a little over 15 minutes, and no new messages were logged during that time):

[INFO] --- liberty-maven-plugin:3.7:generate-features (default-cli) @ app ---
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for snapshots (http://snapshots.repository.codehaus.org).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for codehaus.org (http://repository.codehaus.org).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for repository.jboss.org (http://repository.jboss.org/maven2).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for snapshots.jboss.org (http://snapshots.jboss.org/maven2).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for oss.sonatype.org/jboss-snapshots (http://oss.sonatype.org/content/repositories/jboss-snapshots).
[DEBUG] Dependency collection stats {ConflictMarker.analyzeTime=407085, ConflictMarker.markTime=122238, ConflictMarker.nodeCount=248, ConflictIdSorter.graphTime=92710, ConflictIdSorter.topsortTime=58106, ConflictIdSorter.conflictIdCount=66, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=1675835, ConflictResolver.conflictItemCount=115, DefaultDependencyCollector.collectTime=150302255, DefaultDependencyCollector.transformTime=2421748}
[DEBUG] io.openliberty.tools:liberty-maven-plugin:jar:3.7
[DEBUG]    io.openliberty.tools:liberty-ant-tasks:jar:1.9.10:compile
[DEBUG]       junit:junit:jar:4.13.1:compile
[DEBUG]          org.hamcrest:hamcrest-core:jar:1.3:compile
[DEBUG]       org.apache.ant:ant:jar:1.10.11:compile
[DEBUG]          org.apache.ant:ant-launcher:jar:1.10.11:compile
[DEBUG]       commons-io:commons-io:jar:2.8.0:compile
[DEBUG]       org.json:json:jar:20180813:compile
[DEBUG]    org.codehaus.mojo:plugin-support:jar:1.0-alpha-1:compile
[DEBUG]       ant:ant:jar:1.6.5:compile
[DEBUG]       commons-lang:commons-lang:jar:2.3:compile
[DEBUG]       commons-logging:commons-logging:jar:1.0.4:compile
[DEBUG]       commons-jexl:commons-jexl:jar:1.1:compile
[DEBUG]    org.apache.maven.shared:maven-mapping:jar:3.0.0:compile
[DEBUG]       org.codehaus.plexus:plexus-interpolation:jar:1.21:compile
[DEBUG]    org.apache.maven:maven-core:jar:3.8.6:compile
[DEBUG]       org.apache.maven:maven-model:jar:3.8.6:compile
[DEBUG]       org.apache.maven:maven-settings:jar:3.8.6:compile
[DEBUG]       org.apache.maven:maven-settings-builder:jar:3.8.6:compile
[DEBUG]          org.codehaus.plexus:plexus-sec-dispatcher:jar:2.0:compile
[DEBUG]             org.codehaus.plexus:plexus-cipher:jar:2.0:compile
[DEBUG]       org.apache.maven:maven-builder-support:jar:3.8.6:compile
[DEBUG]       org.apache.maven:maven-repository-metadata:jar:3.8.6:compile
[DEBUG]       org.apache.maven:maven-artifact:jar:3.8.6:compile
[DEBUG]       org.apache.maven:maven-plugin-api:jar:3.8.6:compile
[DEBUG]       org.apache.maven:maven-model-builder:jar:3.8.6:compile
[DEBUG]       org.apache.maven:maven-resolver-provider:jar:3.8.6:compile
[DEBUG]       org.apache.maven.resolver:maven-resolver-impl:jar:1.6.3:compile
[DEBUG]       org.apache.maven.resolver:maven-resolver-api:jar:1.6.3:compile
[DEBUG]       org.apache.maven.resolver:maven-resolver-spi:jar:1.6.3:compile
[DEBUG]       org.apache.maven.resolver:maven-resolver-util:jar:1.6.3:compile
[DEBUG]       org.apache.maven.shared:maven-shared-utils:jar:3.3.4:compile
[DEBUG]       org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.3.5:compile
[DEBUG]          javax.annotation:javax.annotation-api:jar:1.2:compile
[DEBUG]       org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.5:compile
[DEBUG]       com.google.inject:guice:jar:no_aop:4.2.2:compile
[DEBUG]          aopalliance:aopalliance:jar:1.0:compile
[DEBUG]          com.google.guava:guava:jar:25.1-android:compile
[DEBUG]             com.google.code.findbugs:jsr305:jar:3.0.2:compile
[DEBUG]             org.checkerframework:checker-compat-qual:jar:2.0.0:compile
[DEBUG]             com.google.errorprone:error_prone_annotations:jar:2.1.3:compile
[DEBUG]             com.google.j2objc:j2objc-annotations:jar:1.1:compile
[DEBUG]             org.codehaus.mojo:animal-sniffer-annotations:jar:1.14:compile
[DEBUG]       javax.inject:javax.inject:jar:1:compile
[DEBUG]       org.codehaus.plexus:plexus-classworlds:jar:2.6.0:compile
[DEBUG]       org.codehaus.plexus:plexus-component-annotations:jar:2.1.0:compile
[DEBUG]       org.apache.commons:commons-lang3:jar:3.8.1:compile
[DEBUG]       org.slf4j:slf4j-api:jar:1.7.36:compile
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:3.4.2:compile
[DEBUG]    org.sonatype.plexus:plexus-build-api:jar:0.0.7:compile
[DEBUG]    io.openliberty.tools:ci.common:jar:1.8.22:compile
[DEBUG]       javax.xml.bind:jaxb-api:jar:2.2.12:runtime
[DEBUG]    org.twdata.maven:mojo-executor:jar:2.3.2:compile
[DEBUG]    xmlunit:xmlunit:jar:1.6:compile
[DEBUG] Created new class realm plugin>io.openliberty.tools:liberty-maven-plugin:3.7
[DEBUG] Importing foreign packages into class realm plugin>io.openliberty.tools:liberty-maven-plugin:3.7
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>io.openliberty.tools:liberty-maven-plugin:3.7
[DEBUG]   Included: io.openliberty.tools:liberty-maven-plugin:jar:3.7
[DEBUG]   Included: io.openliberty.tools:liberty-ant-tasks:jar:1.9.10
[DEBUG]   Included: junit:junit:jar:4.13.1
[DEBUG]   Included: org.hamcrest:hamcrest-core:jar:1.3
[DEBUG]   Included: org.apache.ant:ant:jar:1.10.11
[DEBUG]   Included: org.apache.ant:ant-launcher:jar:1.10.11
[DEBUG]   Included: commons-io:commons-io:jar:2.8.0
[DEBUG]   Included: org.json:json:jar:20180813
[DEBUG]   Included: org.codehaus.mojo:plugin-support:jar:1.0-alpha-1
[DEBUG]   Included: ant:ant:jar:1.6.5
[DEBUG]   Included: commons-lang:commons-lang:jar:2.3
[DEBUG]   Included: commons-logging:commons-logging:jar:1.0.4
[DEBUG]   Included: commons-jexl:commons-jexl:jar:1.1
[DEBUG]   Included: org.apache.maven.shared:maven-mapping:jar:3.0.0
[DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.21
[DEBUG]   Included: org.codehaus.plexus:plexus-sec-dispatcher:jar:2.0
[DEBUG]   Included: org.codehaus.plexus:plexus-cipher:jar:2.0
[DEBUG]   Included: org.apache.maven:maven-builder-support:jar:3.8.6
[DEBUG]   Included: org.apache.maven.resolver:maven-resolver-util:jar:1.6.3
[DEBUG]   Included: org.apache.maven.shared:maven-shared-utils:jar:3.3.4
[DEBUG]   Included: org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.5
[DEBUG]   Included: com.google.inject:guice:jar:no_aop:4.2.2
[DEBUG]   Included: aopalliance:aopalliance:jar:1.0
[DEBUG]   Included: com.google.guava:guava:jar:25.1-android
[DEBUG]   Included: com.google.code.findbugs:jsr305:jar:3.0.2
[DEBUG]   Included: org.checkerframework:checker-compat-qual:jar:2.0.0
[DEBUG]   Included: com.google.errorprone:error_prone_annotations:jar:2.1.3
[DEBUG]   Included: com.google.j2objc:j2objc-annotations:jar:1.1
[DEBUG]   Included: org.codehaus.mojo:animal-sniffer-annotations:jar:1.14
[DEBUG]   Included: org.codehaus.plexus:plexus-component-annotations:jar:2.1.0
[DEBUG]   Included: org.apache.commons:commons-lang3:jar:3.8.1
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:3.4.2
[DEBUG]   Included: org.sonatype.plexus:plexus-build-api:jar:0.0.7
[DEBUG]   Included: io.openliberty.tools:ci.common:jar:1.8.22
[DEBUG]   Included: javax.xml.bind:jaxb-api:jar:2.2.12
[DEBUG]   Included: org.twdata.maven:mojo-executor:jar:2.3.2
[DEBUG]   Included: xmlunit:xmlunit:jar:1.6
[DEBUG] Configuring mojo io.openliberty.tools:liberty-maven-plugin:3.7:generate-features from plugin realm ClassRealm[plugin>io.openliberty.tools:liberty-maven-plugin:3.7, parent: java.net.URLClassLoader@16b98e56]
[DEBUG] Configuring mojo 'io.openliberty.tools:liberty-maven-plugin:3.7:generate-features' with basic configurator -->
[DEBUG]   (f) artifactRepository =       id: local
      url: file:///app/.mvn/repository/
   layout: default
snapshots: [enabled => true, update => always]
 releases: [enabled => true, update => always]
   blocked: false

[DEBUG]   (f) assemblyArtifact = null:null:null:null:jar
[DEBUG]   (f) assemblyInstallDirectory = /app/target/liberty
[DEBUG]   (f) classFiles = []
[DEBUG]   (f) configDirectory = /app/src/main/liberty/config
[DEBUG]   (f) isInstall = true
[DEBUG]   (f) mergeServerEnv = false
[DEBUG]   (f) multiModuleProjectDirectory = /app
[DEBUG]   (f) optimize = true
[DEBUG]   (f) project = MavenProject: org.example.app:app:1.0.0-SNAPSHOT @ /app/pom.xml
[DEBUG]   (f) reactorProjects = [MavenProject: org.example.app:app:1.0.0-SNAPSHOT @ /app/pom.xml]
[DEBUG]   (f) refresh = false
[DEBUG]   (f) repoSession = org.eclipse.aether.DefaultRepositorySystemSession@5de5e95
[DEBUG]   (f) repositories = [central (https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG]   (f) serverName = defaultServer
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@75e710b
[DEBUG]   (f) settings = org.apache.maven.execution.SettingsAdapter@365cdacf
[DEBUG]   (f) skip = false
[DEBUG] -- end configuration --
[DEBUG] Could not find metadata com.ibm.websphere.appmod.tools:binary-app-scanner/maven-metadata.xml in local (/app/.mvn/repository)
[DEBUG] Skipped remote request for com.ibm.websphere.appmod.tools:binary-app-scanner/maven-metadata.xml, locally cached metadata up-to-date
[DEBUG] Available versions: [22.0.0.1, 22.0.0.2, 22.0.0.4]
[DEBUG] com.ibm.websphere.appmod.tools:binary-app-scanner:22.0.0.4 is resolved from project repositories.
[DEBUG] --- Generate Features values ---
[DEBUG] Binary scanner jar: binary-app-scanner-22.0.0.4.jar
[DEBUG] optimize generate features: true
[DEBUG] Parsing the server file for features and includes: config/server.xml
[DEBUG] For binary scanner gathering Java build output directories for Maven projects, size=1
[DEBUG] Found dir:/app/target/classes
[DEBUG] Java and/or Jakarta EE umbrella dependency found in project: app
[DEBUG] MicroProfile umbrella dependency found in project: app
[DEBUG] Calling binary-app-scanner-22.0.0.4.jar with the following inputs...
  binaryInputs: [/app/target/classes]
  targetJavaEE: ee9
  targetMicroP: mp5.0
  currentFeatures: [microProfile-5.0, jakartaee-9.1]
  logLocation: /app/target
  logLevel: *=FINE
  locale: en_US

I don't know if this is relevant, but since my maven local repository directory is mentioned in the output, here is my .mvn/maven.config file:

--settings .mvn/settings.xml

And the .mvn/settings.xml file:

<settings
    xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
    <localRepository>.mvn/repository</localRepository>
</settings>
TrevCraw commented 1 year ago

@inad9300, thank you for reporting this issue and for trying out generate-features. To investigate further, we have a few things to ask of you:

1) How many class files do you have in /app/target/classes? 2) Could you re-run the generate-features goal with the --debug option as you did before and do the following: a) Let the goal run as long as you can and see if it finishes eventually – this will help us to understand if the goal is truly hung or is just taking a really long time (both scenarios are issues to resolve). b) Could you collect a javacore while the goal is hung? c) Once the goal is finished, or after you end it manually, could you collect and share the trace files from the /target/logs directory?

Something to note is that one of the advantages of using Liberty is you only need to install the Liberty features that your application requires. The generate-features goal aids in determining what Liberty features are needed by your application. Based on the debug output, it appears you have the microProfile-5.0 and jakartaee-9.1 Liberty features defined in the featureManager section of your server.xml. These features are “umbrella” or “parent” features in the sense that they bring in lots of “child” features to be installed for the runtime. Most likely, your application won’t require them all. You can try removing the microProfile-5.0 and jakartaee-9.1 feature definitions from your server.xml and then running the generate-features goal again. This could potentially help alleviate the problem you are facing, and will allow you to take advantage of the modularity of Liberty by only installing the Liberty features you need.

inad9300 commented 1 year ago

How many class files do you have in /app/target/classes?

I have 139 class files.

Could you re-run the generate-features goal with the --debug option as you did before and do the following: [...]

I will try to find the time for this test, though it might not even be necessary (see last answer).

Something to note is that one of the advantages of using Liberty is you only need to install the Liberty features that your application requires.

Yes, this is fantastic, and the reason why I'm excited to try this feature out! Until now, it was not feasible (or at least not worth it) to use features other than the umbrella ones, in my view, as mapping Jakarta classes/annotations to OpenLiberty features isn't trivial.

You can try removing the microProfile-5.0 and jakartaee-9.1 feature definitions from your server.xml and then running the generate-features goal again.

Oh, I see; I thought the utility would figure out the actual features in use regardless of what was stated in server.xml. I gave this a try, and quickly got this error message back:

[ERROR] A working set of features could not be generated due to conflicts in the application’s API usage: [restfulWS-3.0, jsonb-2.0, opentracing-2.0, jdbc-4.2, messaging-3.0, jsonp-2.0, cdi-3.0, persistence-3.0, xmlBinding-3.0, mpOpenAPI-3.0]. Review and update your application to ensure it is not using conflicting APIs from different levels of MicroProfile, Java EE, or Jakarta EE.

Which might explain why the tool was hanging in the first place? Now, regardless, a little help to find out which features conflict with which other features would be much appreciated :sweat_smile: Please, if something screams "wrong" to you, let me know.

inad9300 commented 1 year ago

Still hanging after about 45 minutes running (when leaving umbrella features on). Here is target/logs/trace_22.09.30_15.51.49.log:

2022-09-30 03:51:53.277 - INFO (com.ibm.ws.report.binary.reader.BinaryReportReader.handleIncludeExcludePackages) : CWMIG11001I: The following packages are excluded from the scan by default: ch.qos,com.cognos,com.fasterxml,com.ibatis,com.ibm,com.informix,com.lowagie,com.mchange,com.meterware,com.microsoft,com.mysql,com.sun,com.sybase,freemarker,groovy,jakarta,java,javax,net,oracle,org,sqlj,sun,twitter4j,_ibmjsp. Use the --includePackages or --excludePackages options to override the default scanned packages.
2022-09-30 03:51:54.042 - FINE (com.ibm.ws.report.binary.reader.BinaryReportReader.processXmlFile) : Processing xml file /backend/target/classes/META-INF/persistence.xml with size 2924 bytes.
2022-09-30 03:51:54.049 - FINE (com.ibm.ws.report.binary.cmdline.DriveScanGenerateConfig.processResults) : DriveScanGenerateConfig: The initial features detected in the application are [restfulWS-3.0, jsonb-2.0, persistence, jdbc, cdi-3.0, xmlBinding, jsonp-2.0, messaging]
2022-09-30 03:51:55.592 - FINE (com.ibm.ws.report.binary.cmdline.DriveScanGenerateConfig.checkForConflicts) : ConflictSet: 

2022-09-30 03:51:56.999 - FINE (com.ibm.ws.report.binary.cmdline.DriveScanGenerateConfig.resolvePackages) : featureMapLeft: 
connectors-2.0:
        jakarta.annotation
        jakarta.transaction
messagingServer-3.0:
        jakarta.annotation
        jakarta.transaction
mpFaultTolerance-4.0:
        jakarta.annotation
        jakarta.transaction
servlet-5.0:
        jakarta.annotation
beanValidation-3.0:
        jakarta.annotation
        jakarta.transaction
enterpriseBeansLite-4.0:
        jakarta.annotation
        jakarta.transaction
mpHealth-4.0:
        jakarta.annotation
        jakarta.transaction
enterpriseBeansHome-4.0:
        jakarta.annotation
        jakarta.transaction
appAuthentication-2.0:
        jakarta.annotation
        jakarta.transaction
appSecurity-4.0:
        jakarta.annotation
        jakarta.transaction
pages-3.0:
        jakarta.annotation
jaxrs-2.0:
        com.ibm.websphere.jaxrs20.multipart
persistence-3.0:
        jakarta.annotation
        jakarta.transaction
opentracing-1.2:
        com.ibm.websphere.jaxrs20.multipart
mpOpenTracing-1.1:
        com.ibm.websphere.jaxrs20.multipart
opentracing-1.1:
        com.ibm.websphere.jaxrs20.multipart
mpOpenTracing-1.2:
        com.ibm.websphere.jaxrs20.multipart
opentracing-1.0:
        com.ibm.websphere.jaxrs20.multipart
mpOpenTracing-1.0:
        com.ibm.websphere.jaxrs20.multipart
mpOpenAPI-1.0:
        com.ibm.websphere.jaxrs20.multipart
        org.eclipse.microprofile.openapi.annotations
        org.eclipse.microprofile.openapi.annotations.info
openapi-3.1:
        com.ibm.websphere.jaxrs20.multipart
        org.eclipse.microprofile.openapi.annotations
        org.eclipse.microprofile.openapi.annotations.info
mpOpenAPI-1.1:
        com.ibm.websphere.jaxrs20.multipart
        org.eclipse.microprofile.openapi.annotations
        org.eclipse.microprofile.openapi.annotations.info
mpOpenAPI-2.0:
        org.eclipse.microprofile.openapi.annotations
        org.eclipse.microprofile.openapi.annotations.info
mpOpenAPI-3.0:
        org.eclipse.microprofile.openapi.annotations
        org.eclipse.microprofile.openapi.annotations.info

2022-09-30 03:51:56.999 - FINE (com.ibm.ws.report.binary.cmdline.DriveScanGenerateConfig.resolvePackages) : featureMapLeft: 
mpOpenTracing-1.1:
        com.ibm.websphere.jaxrs20.multipart
opentracing-1.1:
        com.ibm.websphere.jaxrs20.multipart
mpOpenTracing-1.2:
        com.ibm.websphere.jaxrs20.multipart
opentracing-1.0:
        com.ibm.websphere.jaxrs20.multipart
mpOpenTracing-1.0:
        com.ibm.websphere.jaxrs20.multipart
mpOpenAPI-1.0:
        com.ibm.websphere.jaxrs20.multipart
        org.eclipse.microprofile.openapi.annotations
        org.eclipse.microprofile.openapi.annotations.info
jaxrs-2.0:
        com.ibm.websphere.jaxrs20.multipart
openapi-3.1:
        com.ibm.websphere.jaxrs20.multipart
        org.eclipse.microprofile.openapi.annotations
        org.eclipse.microprofile.openapi.annotations.info
opentracing-1.2:
        com.ibm.websphere.jaxrs20.multipart
mpOpenAPI-1.1:
        com.ibm.websphere.jaxrs20.multipart
        org.eclipse.microprofile.openapi.annotations
        org.eclipse.microprofile.openapi.annotations.info
mpOpenAPI-2.0:
        org.eclipse.microprofile.openapi.annotations
        org.eclipse.microprofile.openapi.annotations.info
mpOpenAPI-3.0:
        org.eclipse.microprofile.openapi.annotations
        org.eclipse.microprofile.openapi.annotations.info

Possibly related, I do have the following dependency in the POM:

        <dependency>
            <groupId>io.openliberty.api</groupId>
            <artifactId>io.openliberty.jaxrs30</artifactId>
            <version>1.0.69</version>
            <scope>provided</scope>
        </dependency>

From which I import com.ibm.websphere.jaxrs20.multipart.IAttachment in some places. And I see the following warning too during application start:

[INFO] [WARNING ] SROAP04005: Could not find schema class in index: com.ibm.websphere.jaxrs20.multipart.IAttachment
TrevCraw commented 1 year ago

@inad9300 Thank you for the information. Our investigation found that there is a bug in the binary scanner (the tool that the Liberty Maven Plugin depends on for feature generation) related to the com.ibm.websphere.jaxrs20.multipart API which led to the error message you reported:

[ERROR] A working set of features could not be generated due to conflicts in the application’s API usage: [restfulWS-3.0, jsonb-2.0, opentracing-2.0, jdbc-4.2, messaging-3.0, jsonp-2.0, cdi-3.0, persistence-3.0, xmlBinding-3.0, mpOpenAPI-3.0]. Review and update your application to ensure it is not using conflicting APIs from different levels of MicroProfile, Java EE, or Jakarta EE.

An internal issue has been opened to address this problem in the binary scanner. Another internal issue has been opened to address how the binary scanner handles “umbrella” or “parent” features, which may help to resolve the hanging issue.

In the meantime, to move forward with a minimal set of features for your application, you can use the list of suggested features that the binary scanner provided minus the opentracing-2.0 feature, as it is suspected your app does not require opentracing-2.0. Essentially, update the <featureManager> section of your server.xml to look like this:

<featureManager>
  <feature>restfulWS-3.0</feature>
  <feature>jsonb-2.0</feature>
  <feature>jdbc-4.2</feature>
  <feature>messaging-3.0</feature>
  <feature>jsonp-2.0</feature>
  <feature>cdi-3.0</feature>
  <feature>persistence-3.0</feature>
  <feature>xmlBinding-3.0</feature>
  <feature>mpOpenAPI-3.0</feature>
</featureManager>

Let us know how this works for your application.

inad9300 commented 1 year ago

Thanks, @TrevCraw. Today I finally had a moment to try this out -- my apologies, but I could not do it before.

When using the suggested group of features, the application stops working, while displaying the following error:

[INFO] [ERROR   ] CWWKG0058E: The element ssl with the unique identifier defaultSSLConfig is missing the required attribute keyStoreRef.

When adding keyStoreRef="defaultKeyStore" explicitly, the error goes away, but the application continues not working, and two new warnings are displayed:

[INFO] [WARNING ] CWWKG0033W: The value [defaultIiopEndpoint] specified for the reference attribute [iiopEndpoint] was not found in the configuration.
[INFO] [WARNING ] CWWKG0033W: The value [defaultNamingServiceAdapterActivator] specified for the reference attribute [adapterActivator] was not found in the configuration.

Looking forward to the fix for the binary scanner bug :slightly_smiling_face:

inad9300 commented 1 year ago

@TrevCraw Any luck on this front?

TrevCraw commented 1 year ago

Hi @inad9300 , thank you for following up on this issue and apologies for the long delay on updates. It seems there are three separate issues being discussed for this one GH issue. Let me address each.

  1. generate-features hanging when umbrella dependencies are specified in server.xml - This issue is a work in progress. The best course of action (as you have done) is to not specify umbrella features in server.xml when using generate-features.
  2. The bug with using generate-features and the com.ibm.websphere.jaxrs20.multipart API which results in an incorrect feature conflict error - This issue has been addressed and the fix will be available in an upcoming binary scanner release.
  3. When using the recommended feature set, the application stops working and results in config warnings/errors - Is there a project you can share with us so we can attempt to reproduce this issue?
inad9300 commented 1 year ago

Hi, @TrevCraw! Thanks for the summary. It's good to know that (1) and (2) are being addressed. It's been a long time since I experienced (3), so dependency versions and code have both changed in possibly significant ways. I have since managed to successfully start the application with the following set of features (although I don't know if it is minimal):

<featureManager>
    <feature>cdi-3.0</feature>
    <feature>persistence-3.0</feature>
    <feature>messaging-3.0</feature>
    <feature>jsonb-2.0</feature>
    <feature>mpJwt-2.0</feature>
    <feature>mpOpenAPI-3.0</feature>
</featureManager>

So I am unable to reproduce the problem anymore. I still see these warnings on startup, though, which is probably a fourth issue:

[INFO] [2023-03-31T13:19:16.838+0000] 00000031 id=         io.smallrye.openapi.runtime.scanner.OpenApiDataObjectScanner W process SROAP04005: Could not find schema class in index: java.lang.Object
[INFO] [2023-03-31T13:19:16.901+0000] 00000031 id=         io.smallrye.openapi.runtime.scanner.OpenApiDataObjectScanner W process SROAP04005: Could not find schema class in index: com.ibm.websphere.jaxrs20.multipart.IAttachment
[INFO] [2023-03-31T13:19:16.967+0000] 00000031 id=         io.smallrye.openapi.runtime.scanner.OpenApiDataObjectScanner W process SROAP04005: Could not find schema class in index: com.ibm.websphere.jaxrs20.multipart.IAttachment
TrevCraw commented 1 year ago

@inad9300 Glad to hear that your app is up and running! Regarding the warnings you are seeing on startup, they look to be an application issue, which our team is unable to help with. You can post the warnings on the Open Liberty development Gitter channel and hopefully someone can help you out there!

Regarding issues (1) and (2), I will update you when those fixes are available.

Azquelt commented 1 year ago

The OpenAPI warnings relate to https://github.com/OpenLiberty/open-liberty/issues/17069

When OpenAPI scans your classes to to create OpenAPI schema, it only considers classes which are in your application, plus a predefined list of classes from the standard libraries. This means that if your application references a class which isn't part of your application, OpenAPI outputs this warning to tell you it couldn't autogenerate a schema based on the class.