Coder Social home page Coder Social logo

openliberty / sample-getting-started Goto Github PK

View Code? Open in Web Editor NEW
12.0 7.0 77.0 503 KB

Getting started sample

Home Page: https://openliberty.io/start/

License: Other

Java 25.61% HTML 14.79% CSS 16.67% JavaScript 15.09% Dockerfile 1.51% Shell 25.49% Makefile 0.85%

sample-getting-started's Introduction

Open Liberty logo

Open Liberty Getting Started sample

Overview

The sample application provides a simple example of how to get started with Open Liberty. It provides a REST API that retrieves the system properties in the JVM and a web based UI for viewing them. It also uses MicroProfile Config, MicroProfile Health and MicroProfile Metrics to demonstrate how to use these specifications in an application that maybe deployed to kubernetes.

Project structure

  • src/main/java - the Java code for the Project
    • io/openliberty/sample
      • config
        • ConfigResource.java - A REST Resource that exposes MicroProfile Config via a /rest/config GET request
        • CustomConfigSource.java - A MicroProfile Config ConfigSource that reads a json file.
      • system
        • SystemConfig.java - A CDI bean that will report if the application is in maintenance. This supports the config variable changing dynamically via an update to a json file.
        • SystemHealth.java - A MicroProfile Health check that reports DOWN if the application is in maintenance and UP otherwise.
        • SystemResource.java - A REST Resource that exposes the System properties via a /rest/properties GET request. Calls to this GET method have MicroProfile Timer and Count metrics applied.
        • SystemRuntime.java - A REST Resource that exposes the version of the Open Liberty runtime via a /rest/runtime GET request.
      • SystemApplication.java - The Jakarta RESTful Web Services Application class
    • liberty/config/server.xml - The server configuration for the liberty runtime
    • META-INF - Contains the metadata files for MicroProfile Config including how to load CustomConfigSource.java
    • webapp - Contains the Web UI for the application.
    • test/java/it/io/openliberty/sample/health
      • HealthIT.java - Test cases for a sample application running on localhost
      • HealthUtilIT.java - Utility methods for functional tests
  • resources/CustomConfigSource.json - Contains the data that is read by the MicroProfile Config ConfigSource.
  • Dockerfile - The Dockerfile for building the sample
  • pom.xml - The Maven POM file

Build and Run the Sample locally

Clone the project

git clone https://github.com/OpenLiberty/sample-getting-started.git

then build and run it using Liberty dev mode:

mvnw liberty:dev

if you just want to build it run:

mvnw package

Run the Sample in a container

To run the sample using docker run:

docker run -p 9080:9080 icr.io/appcafe/open-liberty/samples/getting-started

To run the sample using podman run:

podman run -p 9080:9080 icr.io/appcafe/open-liberty/samples/getting-started

Access the application

Open a browser to http://localhost:9080

image

Run the functional tests

The test cases uses JUnit 5 and Maven Failsafe Plugin defined in pom.xml.

Note: Sample appplication must be running on http://localhost before running the test cases.
See HealthUtilIT.java to change the change the sample application target URL.

To run the test cases against a running sample application, use the following command

mvnw failsafe:integration-test

To view the test results, look at the console output or look under directory target/failsafe-reports

sample-getting-started's People

Contributors

arturdzm avatar cbridgha avatar colvinco avatar dmorgant avatar emily-jiang avatar erica-banda-03 avatar evie-lau avatar gcharters avatar halim-lee avatar kinueng avatar lavenal avatar mbroz2 avatar natalie-bernhard avatar nottycode avatar stevesamjacob19 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sample-getting-started's Issues

Getting started sample is broken - fails tests

I did:
git clone ....
mvn clean install

Got the following failures.

Results :

Failed tests:
HealthTest.testIfServicesAreDown:49->checkServicesStates:56->lambda$checkServicesStates$0:57 The state of SystemResource service is not matching the expected:<[UP]> but was:<[]>
HealthTest.testIfServicesAreUp:43->checkServicesStates:56->lambda$checkServicesStates$0:57 The state of SystemResource service is not matching the expected:<[UP]> but was:<[]>

Tests run: 2, Failures: 2, Errors: 0, Skipped: 0

An API incompatibility was encountered while executing org.apache.maven.plugins:maven-war-plugin:2.6:war: java.lang.ExceptionInInitializerError: null

Command:
mvn clean package liberty:run-server

Exception stacktrace:

java.lang.ExceptionInInitializerError
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:86)
	at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:108)
	at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32)
	at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:91)
	at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
	at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
	at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:89)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:259)
	at com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1018)
	at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
	at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1000)
	at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:45)
	at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:84)
	at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:52)
	at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
	at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
	at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
	at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
	at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
	at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
	at com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1018)
	at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
	at com.google.inject.Scopes$1$1.get(Scopes.java:59)
	at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:83)
	at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:49)
	at org.sonatype.guice.plexus.binders.PlexusRequirements$RequirementProvider.get(PlexusRequirements.java:217)
	at org.sonatype.guice.plexus.binders.ProvidedPropertyBinding.injectProperty(ProvidedPropertyBinding.java:45)
	at org.sonatype.guice.bean.inject.BeanInjector.injectMembers(BeanInjector.java:53)
	at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:128)
	at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:117)
	at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32)
	at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:91)
	at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
	at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
	at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:89)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:259)
	at com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1018)
	at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
	at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1000)
	at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:45)
	at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:84)
	at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:52)
	at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
	at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
	at org.sonatype.guice.plexus.lifecycles.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:138)
	at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:108)
	at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
	at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
	at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
	at com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1011)
	at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
	at com.google.inject.Scopes$1$1.get(Scopes.java:59)
	at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:83)
	at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:49)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:253)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:245)
	at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:455)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:92)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
	at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.<clinit>(AbstractZipArchiver.java:116)
	... 88 more

Java version:

openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.3)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.3, mixed mode)```

Failed to run integration tests

Running the downloded code get the following. Other than that the web page looks correct.
[ERROR] it.io.openliberty.sample.health.HealthIT.testIfServicesAreDown() Time elapsed: 0.002 s <<< FAILURE!
java.lang.NoClassDefFoundError: javax/ws/rs/client/ClientBuilder
at it.io.openliberty.sample.health.HealthUtilIT.connectToHealthEnpoint(HealthUtilIT.java:46)
at it.io.openliberty.sample.health.HealthIT.testIfServicesAreDown(HealthIT.java:42)
Caused by: java.lang.ClassNotFoundException: javax.ws.rs.client.ClientBuilder
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 15 more

[ERROR] it.io.openliberty.sample.health.HealthIT.testIfServicesAreUp() Time elapsed: 0 s <<< FAILURE!
java.lang.NoClassDefFoundError: javax/ws/rs/client/ClientBuilder
at it.io.openliberty.sample.health.HealthUtilIT.connectToHealthEnpoint(HealthUtilIT.java:46)
at it.io.openliberty.sample.health.HealthIT.testIfServicesAreUp(HealthIT.java:36)

[INFO] Running it.io.openliberty.sample.health.HealthUtilIT
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] it.io.openliberty.sample.health.HealthIT#testIfServicesAreDown NoClassDefFoundError
[ERROR] it.io.openliberty.sample.health.HealthIT#testIfServicesAreUp NoClassDefFoundError
[INFO]
[ERROR] Tests run: 2, Failures: 2, Errors: 0, Skipped: 0
[INFO]
[ERROR] Failed to run integration tests
[INFO] Press the Enter key to run tests on demand.

Trademark mentions on UI

There are two mentions of "MicroProfile^TM" on the sample UI. If we have to include trademark attributions here, we need to do them correctly. So only the first mention should include the mark and I think it should be "Eclipse MicroProfile^TM" (ie include Eclipse in the first mention with the trademark). @kwsutter will know what the minimum requirement is but also see link [4] in this issue: microprofile/microprofile-site-config#76.

(Also, there's a weird line break in the 'sweet MicroProfile' paragraph.)

The generated io.openliberty.sample.getting.started.war does not work elsewhere

"mvnw package" generates "io.openliberty.sample.getting.started.war" of the sample-getting-started example.
This .war file does not work if dropped into another standalone Liberty server.
The index.html will display, but the microservice will not output the info on that page ("Not Found").
If you hit the link for "API Source" below (should invoke "/system/properties") you get an error: "Context Root Not Found"

Update the pom to package app during package phase

Install app during package so that server with app can be ran after package phase
Replace trademark with registered
Add favicon

After this is pushed, we'll update the openliberty.io front page to specify "mvn clean package liberty:run-server"

./mvnw package is broken: Unable to load the mojo 'war'

./mvnw package

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project io.openliberty.sample.getting.started: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.2:war failed: Unable to load the mojo 'war' in the plugin 'org.apache.maven.plugins:maven-war-plugin:2.2' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Cannot access defaults field of Properties
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-war-plugin:2.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/colvin/.m2/repository/org/apache/maven/plugins/maven-war-plugin/2.2/maven-war-plugin-2.2.jar
[ERROR] urls[1] = file:/home/colvin/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6.jar
[ERROR] urls[2] = file:/home/colvin/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7.jar
[ERROR] urls[3] = file:/home/colvin/.m2/repository/commons-cli/commons-cli/1.0/commons-cli-1.0.jar
[ERROR] urls[4] = file:/home/colvin/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
[ERROR] urls[5] = file:/home/colvin/.m2/repository/org/apache/maven/maven-archiver/2.5/maven-archiver-2.5.jar
[ERROR] urls[6] = file:/home/colvin/.m2/repository/org/codehaus/plexus/plexus-io/2.0.2/plexus-io-2.0.2.jar
[ERROR] urls[7] = file:/home/colvin/.m2/repository/org/codehaus/plexus/plexus-archiver/2.1/plexus-archiver-2.1.jar
[ERROR] urls[8] = file:/home/colvin/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.15/plexus-interpolation-1.15.jar
[ERROR] urls[9] = file:/home/colvin/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[10] = file:/home/colvin/.m2/repository/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar
[ERROR] urls[11] = file:/home/colvin/.m2/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar
[ERROR] urls[12] = file:/home/colvin/.m2/repository/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar
[ERROR] urls[13] = file:/home/colvin/.m2/repository/org/apache/maven/shared/maven-filtering/1.0-beta-2/maven-filtering-1.0-beta-2.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------

Setting a later version of maven in the maven-wrapper.properties fixes it https://stackoverflow.com/questions/75079601/unable-to-load-the-mojo-war-in-the-plugin-org-apache-maven-pluginsmaven-war.

Move features up to MP6.1

Liberty supports MP6.1 since 23.0.0.12, and this sample should be updated to to reflect that (aka, update to mpConfig-3.1 and mpMetrics-5.1)

Question: How to create fat jar for this project using liberty-maven-plugin?

Hi, I'm from Eclipse JKube team. We help Java developers deploy their applications onto Kubernetes/OpenShift. We already have support for OpenLiberty in Eclipse JKube. Here is our OpenLiberty quickstart: https://github.com/eclipse/jkube/tree/master/quickstarts/maven/openliberty

I was trying to deploy this application to Kubernetes using Eclipse JKube but somehow I'm stuck at configuring liberty maven plugin to create correct fat jar. Here is my plugin configuration:

            <!-- Enable liberty-maven plugin -->
            <plugin>
                <groupId>io.openliberty.tools</groupId>
                <artifactId>liberty-maven-plugin</artifactId>
                <version>3.0.1</version>

                <configuration>
                    <configFile>src/main/liberty/config/server.xml</configFile>
                    <assemblyArtifact>
                        <groupId>io.openliberty</groupId>
                        <artifactId>openliberty-runtime</artifactId>
                        <version>[18.0.0.1,)</version>
                        <type>zip</type>
                    </assemblyArtifact>
                    <bootstrapProperties>
                        <default.http.port>${http.port}</default.http.port>
                        <default.https.port>${https.port}</default.https.port>
                        <app.context.root>/</app.context.root>
                    </bootstrapProperties>
                </configuration>
                <executions>
                    <execution>
                        <id>create</id>
                        <phase>package</phase>
                        <goals>
                            <goal>create</goal>
                            <goal>deploy</goal>
                            <goal>package</goal>
                        </goals>
                        <configuration>
                            <looseApplication>true</looseApplication>
                            <stripVersion>true</stripVersion>
                            <installAppPackages>project</installAppPackages>
                            <packageName>io-openliberty-sample-getting-started</packageName>
                            <packageType>jar</packageType>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

This create a fat jar but when I run it, I get this error:

work/repos/sample-getting-started : $ java -jar target/io-openliberty-sample-getting-started.ja 
Extracting files to /home/rohaan/wlpExtract/io-openliberty-sample-getting-started_5177235419688/wlp
Successfully extracted all product files.
Launching defaultServer (Open Liberty 20.0.0.8/wlp-1.0.43.cl200820200721-1900) on Java HotSpot(TM) 64-Bit Server VM, version 14.0.1+7 (en_US)
[AUDIT   ] CWWKE0001I: The server defaultServer has been launched.
[AUDIT   ] CWWKG0093A: Processing configuration drop-ins resource: /home/rohaan/wlpExtract/io-openliberty-sample-getting-started_5177235419688/wlp/usr/servers/defaultServer/configDropins/defaults/install_apps_configuration_1491924271.xml
[ERROR   ] CWWKG0075E: The value  is not valid for attribute httpPort of configuration element httpEndpoint. The validation message was: Value "" is not a number..
[AUDIT   ] CWWKZ0058I: Monitoring dropins for applications.
Java HotSpot(TM) 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
[WARNING ] CWWKZ0014W: The application io.openliberty.sample.getting.started could not be started as it could not be found at location io.openliberty.sample.getting.started.war.
[AUDIT   ] CWWKS4104A: LTPA keys created in 2.430 seconds. LTPA key file: /home/rohaan/wlpExtract/io-openliberty-sample-getting-started_5177235419688/wlp/usr/servers/defaultServer/resources/security/ltpa.keys
[AUDIT   ] CWPKI0803A: SSL certificate created in 3.564 seconds. SSL key file: /home/rohaan/wlpExtract/io-openliberty-sample-getting-started_5177235419688/wlp/usr/servers/defaultServer/resources/security/key.p12
[err] java.io.FileNotFoundException: /home/rohaan/wlpExtract/io-openliberty-sample-getting-started_5177235419688/wlp/usr/servers/defaultServerresources/CustomConfigSource.json (No such file or directory)
[err] 	at java.base/java.io.FileInputStream.open0(Native Method)
[err] 	at java.base/java.io.FileInputStream.open(FileInputStream.java:212)
[err] 	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:154)
[err] 	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:109)
[err] 	at java.base/java.io.FileReader.<init>(FileReader.java:60)
[err] 	at io.openliberty.sample.config.CustomConfigSource.readFile(CustomConfigSource.java:86)
[err] 	at io.openliberty.sample.config.CustomConfigSource.getProperties(CustomConfigSource.java:52)
[err] 	at io.openliberty.sample.config.CustomConfigSource.getOrdinal(CustomConfigSource.java:32)
[err] 	at com.ibm.ws.microprofile.config.impl.ConfigSourceComparator.compare(ConfigSourceComparator.java:38)
[err] 	at [internal classes]
[err] 	at java.base/java.util.TreeMap.put(TreeMap.java:550)
[err] 	at java.base/java.util.TreeSet.add(TreeSet.java:255)
[err] 	at com.ibm.ws.microprofile.config.impl.SortedSourcesImpl.add(SortedSourcesImpl.java:77)
[err] 	at [internal classes]
[err] 	at java.base/java.util.AbstractCollection.addAll(AbstractCollection.java:336)
[err] 	at com.ibm.ws.microprofile.config14.impl.Config14BuilderImpl.getSources(Config14BuilderImpl.java:52)
[err] 	at [internal classes]
[err] 	at org.eclipse.microprofile.config.ConfigProvider.getConfig(ConfigProvider.java:105)
[err] 	at com.ibm.ws.microprofile.config.cdi.ConfigCDIExtension.processConversionType(ConfigCDIExtension.java:153)
[err] 	at [internal classes]
[err] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[err] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[err] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[err] 	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
[err] 	at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:95)
[err] 	at [internal classes]
[err] 	at javax.enterprise.inject.spi.ObserverMethod.notify(ObserverMethod.java:124)
[err] 	at org.jboss.weld.util.Observers.notify(Observers.java:166)
[err] 	at [internal classes]
[err] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
[err] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
[err] 	at java.base/java.lang.Thread.run(Thread.java:832)
[ERROR   ] CWMCG5003E: The [BackedAnnotatedField] @Inject @ConfigProperty io.openliberty.sample.system.SystemConfig.inMaintenance InjectionPoint dependency was not resolved. Error: java.lang.NumberFormatException: null
	at java.base/java.lang.Integer.parseInt(Integer.java:614)
	at java.base/java.lang.Integer.parseInt(Integer.java:770)
	at io.openliberty.sample.config.CustomConfigSource.getOrdinal(CustomConfigSource.java:32)
	at com.ibm.ws.microprofile.config.impl.ConfigSourceComparator.compare(ConfigSourceComparator.java:38)
	at [internal classes]
	at org.eclipse.microprofile.config.ConfigProvider.getConfig(ConfigProvider.java:105)
	at com.ibm.ws.microprofile.config.cdi.ConfigCDIExtension.processConversionType(ConfigCDIExtension.java:153)
	at [internal classes]

[AUDIT   ] CWWKZ0001I: Application io-openliberty-sample-getting-started started in 2.436 seconds.
[AUDIT   ] CWWKF0012I: The server installed the following features: [cdi-2.0, distributedMap-1.0, jaxrs-2.1, jaxrsClient-2.1, jndi-1.0, json-1.0, jsonp-1.1, monitor-1.0, mpConfig-1.4, mpHealth-2.2, mpMetrics-2.3, servlet-4.0, ssl-1.0].
[AUDIT   ] CWWKF0011I: The defaultServer server is ready to run a smarter planet. The defaultServer server started in 8.707 seconds.

Could anyone please help me here? Maybe I'm not configuring liberty-maven-plugin properly? What am I missing?

Create release tags

We want to use this sample app as the default application image in the sample custom resources of Open/WebSphere Liberty Operators. At the moment, this application image doesn't have any tags. It has the default latest tag. In the operator, we have to reference the image using a digest (sha256) value. Some registries clean up images if it's not associated with any tags. Not sure if icr.io does that. But in any case, it'll be good to create releases for sample applications.

@mbroz2 could you please help with this? Thanks.

Develop a light-weight front-end for the getting started app

The UI should cleanly expose a landing page which links/showcases the technologies the app implements and exposes (MP health, metrics, & config).

Priority: Done by Think (March 19th)

Requirements:

  • Display system properties #2
  • Showcase microprofile config
  • Showcase microprofile metrics #3
  • Showcase microprofile health #4

Getting started sample Metrics problem

In the sample UI I see the message "Internal Server Error" when I expand the Metrics section.

From the server output, I see:

[INFO] [AUDIT ] CWWKF0011I: The server sampleAppServer is ready to run a smarter planet.
[INFO] [WARNING ] Interceptor for {https://10.5.35.42:9443/metrics/}WebClient has thrown exception, unwinding now
[INFO] Could not send Message.
[INFO] [WARNING ] Application {http://metrics.sample.openliberty.io/}MetricsOverHTTPResource has thrown exception, unwinding now
[INFO] java.io.IOException: IOException invoking https://10.5.35.42:9443/metrics/: HTTPS hostname wrong: should be <10.5.35.42>

Accepting the self-signed cert in the browser does not fix the problem.

The run commands are weird...(and inconsistent with Liberty Maven plugin)

The sample commands are a bit odd and inconsistent with our use of the Liberty Maven plugin elsewhere.

The command mvn clean install should only build the app and install it (and run the tests, I think) but not run it.

Current behaviour:

According to the instructions in the readme, to run the sample you run mvn clean install. This does not run the tests and then starts the server in the background. Even though this makes the command shorter, it is inconsistent with our other guides and I think is confusing.

Suggested new behaviour:

Make the sample app start with the command mvn clean install liberty:run-server and run the tests (we could document the option to use mvn clean install -DskipTests liberty:run-server in the readme though don't know it's necessary?).

That way, it's consistent with the guides etc and shows we care about tests. Also, by running in the foreground, it's easy to stop the server without having to read the readme or something (ie CTRL+C). And the URL to visit is displayed in the console too. (as discussed with @gcharters )

Remove asciidoc tags

This sample does not have any asciidoc documentation but it contains lots of asciidoc tags. These should be renoved.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.