OpenLiberty / open-liberty

Open Liberty is a highly composable, fast to start, dynamic application server runtime environment
https://openliberty.io
Eclipse Public License 2.0
1.15k stars 592 forks source link

Versionless features not working with maven-gradle plugin #29473

Closed sreich closed 2 weeks ago

sreich commented 2 months ago

Describe the bug

Hi, trying to use the latest feature from 24.0.0.8, using liberty-gradle plugin 3.8.3.

If I remove the jdbc version qualifier as below, it fails in this way. Similarly if I remove versions from some of the other feature sets. Am i using this correctly? I cleaned everything

I've followed docs from https://openliberty.io/docs/latest/reference/feature/versionless-features.html#platform

logs:

CWWKM2001I: Invoke command is ["C:\example-rest-service\build\wlp\bin\server.bat", debug, openLibertyServer1]. Listening for transport dt_socket at address: 7777 Launching openLibertyServer1 (Open Liberty 24.0.0.8/wlp-1.0.92.cl240820240729-1903) on OpenJDK 64-Bit Server VM, version 11.0.18+10-LTS (en_US) [AUDIT ] CWWKE0001I: The server openLibertyServer1 has been launched.

Task :libertyDev CWWKM2010I: Searching for CWWKF0011I: in C:\example-rest-service\build\wlp\usr\servers\openLibertyServer1\logs\messages.log. This search will timeout after 90 seconds.

[ERROR ] CWWKF0001E: A feature definition could not be found for transportsecurity-1.0 [ERROR ] CWWKF0001E: A feature definition could not be found for servlet-4.0 [ERROR ] CWWKF0001E: A feature definition could not be found for jpa [ERROR ] CWWKF0001E: A feature definition could not be found for beanvalidation [AUDIT ] CWWKF0012I: The server installed the following features: []. [AUDIT ] CWWKF0011I: The openLibertyServer1 server is ready to run a smarter planet. The openLibertyServer1 server started in 5.436 seconds.

Task :libertyDev CWWKM2015I: Match number: 1 is [8/23/24, 8:49:00:755 EDT] 0000002f com.ibm.ws.kernel.feature.internal.FeatureManager A CWWKF0011I: The openLibertyServer1 server is ready to run a smarter planet. The openLibertyServer1 server started in 5.436 seconds..


  • Liberty is running in dev mode.
  • Automatic generation of features: [ Off ]
  • h - see the help menu for available actions, type 'h' and press Enter.
  • q - stop the server and quit dev mode, press Ctrl-C or type 'q' and press Enter.
  • Liberty server port information:
  • Liberty debug port: [ 7777 ]

Task :libertyDev Source compilation was successful.

Task :libertyDev Tests compilation was successful.

--

messages:


product = Open Liberty 24.0.0.8 (wlp-1.0.92.cl240820240729-1903) wlp.install.dir = C:/example-rest-service/build/wlp/ java.home = C:\Program Files\RedHat\java-11-openjdk-11.0.18-1 java.version = 11.0.18 java.runtime = OpenJDK Runtime Environment (11.0.18+10-LTS) os = Windows 11 (10.0; amd64) (en_US) process = 25216@BN412445 Classpath = C:\example-rest-service\build\wlp\bin\tools\ws-server.jar Java Library path = C:\Program Files\RedHat\java-11-openjdk-11.0.18-1\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\RedHat\java-11-openjdk-11.0.18-1\bin;


[8/23/24, 8:48:55:759 EDT] 00000001 com.ibm.ws.kernel.launch.internal.FrameworkManager A CWWKE0001I: The server openLibertyServer1 has been launched. [8/23/24, 8:49:00:694 EDT] 00000001 com.ibm.ws.kernel.launch.internal.FrameworkManager I CWWKE0002I: The kernel started after 5.373 seconds [8/23/24, 8:49:00:695 EDT] 0000002f com.ibm.ws.kernel.feature.internal.FeatureManager I CWWKF0007I: Feature update started. [8/23/24, 8:49:00:720 EDT] 0000002f com.ibm.ws.kernel.feature.internal.FeatureManager E CWWKF0001E: A feature definition could not be found for transportsecurity-1.0 [8/23/24, 8:49:00:721 EDT] 0000002f com.ibm.ws.kernel.feature.internal.FeatureManager E CWWKF0001E: A feature definition could not be found for servlet-4.0 [8/23/24, 8:49:00:722 EDT] 0000002f com.ibm.ws.kernel.feature.internal.FeatureManager E CWWKF0001E: A feature definition could not be found for jpa [8/23/24, 8:49:00:723 EDT] 0000002f com.ibm.ws.kernel.feature.internal.FeatureManager E CWWKF0001E: A feature definition could not be found for beanvalidation [8/23/24, 8:49:00:755 EDT] 0000002f com.ibm.ws.kernel.feature.internal.FeatureManager A CWWKF0012I: The server installed the following features: []. [8/23/24, 8:49:00:755 EDT] 0000002f com.ibm.ws.kernel.feature.internal.FeatureManager I CWWKF0008I: Feature update completed in 0.063 seconds. [8/23/24, 8:49:00:755 EDT] 0000002f com.ibm.ws.kernel.feature.internal.FeatureManager A CWWKF0011I: The openLibertyServer1 server is ready to run a smarter planet. The openLibertyServer1 server started in 5.436 seconds.

If there is a stack trace, please include the FULL stack trace (without any [internal classes] lines in it). To find the full stack trace, you may need to check in $WLP_OUTPUT_DIR/messages.log

Steps to Reproduce

Expected behavior

Diagnostic information:

24.0.0.8

server.xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<server>
    <featureManager>
        <platform>javaee-8.0</platform>
        <feature>beanValidation</feature>
        <feature>servlet-4.0</feature>
        <feature>transportSecurity-1.0</feature>
        <feature>jpa</feature>
    </featureManager>

    <webApplication contextRoot="${example.servlet.context.root}" location="${example.servlet.artifact}"/>

    <library id="jdbcLibOracle">
        <fileset dir="jdbc" includes="*.jar"/>
    </library>

    <authData id="AuthDataRef" password="${Example_password}" user="${Example_user}"/>

    <dataSource jndiName="jdbc/examplerestdb" type="javax.sql.ConnectionPoolDataSource"
                containerAuthDataRef="AuthDataRef">
    <connectionManager enableContainerAuthForDirectLookups="true"/>
        <jdbcDriver libraryRef="jdbcLibOracle"/>
        <properties.oracle URL="${ExampleRest_URL}"/>
    </dataSource>

    <ssl id="defaultSSLConfig" trustDefaultCerts="true"/>
    <applicationManager autoExpand="true"/>
    <httpEndpoint host="${default.endpoint.host}" httpPort="${default.http.port}"
                  httpsPort="${default.https.port}" id="defaultHttpEndpoint"/>

    <variable name="default.endpoint.host" defaultValue="*"/>
    <variable name="default.http.port" defaultValue="9080"/>
    <variable name="default.https.port" defaultValue="9443"/>
    <variable name="example.servlet.artifact" defaultValue="OPENLIBERTY_INVALID_SERVLET_ARTIFACT"/>
    <variable name="example.servlet.context.root" defaultValue="OPENLIBERTY_INVALID_CONTEXT_ROOT"/>

</server>
jimblye commented 2 months ago

I updated the original comment so that the featureManager portion of the server.xml is displayed.

cbridgha commented 2 months ago

The maven/gradle build plugins do not as of yet support versionless features. - It is currently in development: https://github.com/OpenLiberty/ci.maven/issues/1826

featureUtility installServerFeatures does support this scenario - I added the example above to the defaultServer from a kernel image and saw the following results:

$ ./featureUtility installServerFeatures defaultServer
Initializing ...
Resolving remote features. This process might take several minutes to complete.
Preparing assets for installation. This process might take several minutes to complete.
Using 8 threads to download artifacts.
Establishing a connection to the configured Maven repository ...
This process might take several minutes to complete.
Successfully connected to the configured repository.
Downloading required features ...
Verifying signatures ...
All features were successfully verified.
Starting installation ...
Successfully installed feature servlet-4.0.
Successfully installed feature ssl-1.0.
Successfully installed feature transportSecurity-1.0.
Successfully installed feature jdbc-4.2.
Successfully installed feature jndi-1.0.
Successfully installed feature jpaContainer-2.2.
Successfully installed feature jpa-2.2.
Successfully installed feature jpa.
Successfully installed feature el-3.0.
Successfully installed feature beanValidation-2.0.
Successfully installed feature beanValidation.
All features were successfully installed.
Start product validation...
Product validation completed successfully.
cbridgha commented 2 months ago

We'll add a line to the release blog clarifying the maven/gradle build plugins do not currently support versionless scenarios

sreich commented 2 months ago

Okay, we'll have to wait for the toolchain integration feature before we can use this, then

Thanks for the updates, Chuck

cbridgha commented 2 weeks ago

Closing this as Maven and Gradle support for versionless has just been released in these versions: Maven: version 3.11.1 Gradle: version 3.9.1

sreich commented 2 weeks ago

@cbridgha or @cherylking thanks, but are there release notes for those versions? i see ci.gradle github releases did for past releases, but the most recent ones do not have notes, just tag

cherylking commented 2 weeks ago

@sreich Next on my list of todos is to create the release notes.