openliberty / open-liberty-deep-dive Goto Github PK
View Code? Open in Web Editor NEWThis repository has been archived. Visit https://github.com/openliberty/guide-liberty-deep-dive for the new version of this tutorial..
This repository has been archived. Visit https://github.com/openliberty/guide-liberty-deep-dive for the new version of this tutorial..
Update the section Integration Testing section to reflect the latest approach with dev mode incorporated.
FYI, @gkwan-ibm
Should not have the following error:
[INFO] [ERROR ] CWWKO1650E: Validation of the OpenAPI document produced the following error(s):
[INFO]
[INFO] - Message: The Schema Object of "array" type must have "items" property defined, Location: #/paths/~1resources~1orders/get/responses/200/content/application~1json/schema
Update the section on Docker to be in sync/consistent with what we suggest per https://github.com/OpenLiberty/ci.docker/
Do the same for Dockerfiles used too.
Add a module to cover deploying to Kubernetes using the Open Liberty Operator.
Can show a local scenario deploying to Minikube (where appropriate).
Need to sync up what is under start with what is under finish.
For Module 7 (step8) and Module 10 (s
At module 7 (step 8) and 9 (step 10),
change
curl http://localhost:9080/health
curl -X POST "http://localhost:9080/coffee-shop/resources/orders" \
-H "accept: */*" -H "Content-Type: application/json" \
-d "{\"status\":\"FINISHED\",\"type\":\"ESPRESSO\"}"
curl http://localhost:9080/coffee-shop/resources/orders
to
curl http://localhost:9080/health | jq
curl -X POST "http://localhost:9080/coffee-shop/resources/orders" \
-H "accept: */*" -H "Content-Type: application/json" \
-d "{\"status\":\"FINISHED\",\"type\":\"ESPRESSO\"}"
curl http://localhost:9080/coffee-shop/resources/orders | jq
"Prime Maven and Docker Caches" still points to GH repo under gcharters.
git clone https://github.com/gcharters/open-liberty-masterclass.git
Update all GH repo references to point to repo under OpenLiberty.
in cloud hosted version, any paths containing sebastian_daschner
are displayed as sebastiandaschner
. That caused problems
This is v1 of the deep dive is now superseded by https://github.com/OpenLiberty/guide-liberty-deep-dive. We should archive this repo and point to the latest.
When the fix for the issue below is ready, remove the workaround introduced in the commit referenced.
[INFO] [ERROR ] CWWKS9114E: The incoming http request cannot be redirected to a secure port because the servlet request URL https,http,http://localhost/metrics is malformed. Ensure the request URL is correct.
Rename the master
branch to prod
This is for the cloud-hosted instruction for Module 8. Add a copy button to make it easier for users.
og4j.rootLogger=INFO, stdout
log4j.appender=org.apache.log4j.ConsoleAppender
log4j.appender.layout=org.apache.log4j.PatternLayoutlog4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%r %p %c %x - %m%nlog4j.logger.org.microshed=DEBUG
The touch command has a copy button but not for the file content.
instead of receiving the expected [INFO] BaristaClient response: 200
I am seeing
[INFO] http://localhost:9081/barista
[INFO] [WARNING ] CWPMI2005W: The MicroProfile Metrics exception mapper detected and is handling an unhandled exception from the JAX-RS application.
[INFO] java.lang.NoClassDefFoundError: com.ibm.websphere.monitor.jmx.Counter
[INFO] at java.base/java.lang.Class.getDeclaredMethodsImpl(Native Method)
[INFO] at java.base/java.lang.Class.getDeclaredMethods(Class.java:1129)
[INFO] at java.base/java.lang.Class.getMethodSet(Class.java:1596)
[INFO] at java.base/java.lang.Class.addInterfaceMethods(Class.java:1645)
[INFO] at java.base/java.lang.Class.getMethodSet(Class.java:1604)
[INFO] at java.base/java.lang.Class.getMethods(Class.java:1520)
[INFO] at java.management/com.sun.jmx.mbeanserver.MBeanIntrospector.getMethods(MBeanIntrospector.java:181)
[INFO] at java.management/com.sun.jmx.mbeanserver.MBeanAnalyzer.initMaps(MBeanAnalyzer.java:128)
[INFO] at java.management/com.sun.jmx.mbeanserver.MBeanAnalyzer.<init>(MBeanAnalyzer.java:118)
[INFO] at java.management/com.sun.jmx.mbeanserver.MBeanAnalyzer.analyzer(MBeanAnalyzer.java:102)
[INFO] at java.management/com.sun.jmx.mbeanserver.MXBeanIntrospector.getAnalyzer(MXBeanIntrospector.java:74)
[INFO] at java.management/com.sun.jmx.mbeanserver.MBeanIntrospector.getPerInterface(MBeanIntrospector.java:192)
[INFO] at java.management/com.sun.jmx.mbeanserver.MBeanSupport.<init>(MBeanSupport.java:138)
[INFO] at java.management/com.sun.jmx.mbeanserver.MXBeanSupport.<init>(MXBeanSupport.java:66)
[INFO] at java.management/com.sun.jmx.mbeanserver.Introspector.makeDynamicMBean(Introspector.java:203)
[INFO] at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:888)
[INFO] at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:320)
[INFO] at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
[INFO] at com.ibm.ws.kernel.boot.jmx.service.MBeanServerForwarderDelegate.registerMBean(MBeanServerForwarderDelegate.java:221)
[INFO] at [internal classes]
[INFO] Caused by: java.lang.ClassNotFoundException: com.ibm.websphere.monitor.jmx.Counter cannot be found by com.ibm.websphere.appserver.api.jaxrs20_1.1.51.cl210420210407-0944
[INFO] at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:519)
[INFO] ... 1 more
[INFO]
[INFO] [WARNING ] Interceptor for {http://boundary.coffee_shop.sebastian_daschner.com/}OrdersResource has thrown exception, unwinding now
[INFO] com.ibm.websphere.monitor.jmx.Counter
[INFO] BaristaClient response: 200
A work around for this issue is:
mvn clean
mvn liberty:dev
The below should point to what's under OpenLiberty (and not wasdev):
https://github.com/wasdev/ci.maven https://github.com/wasdev/ci.gradle
Ensure that all Central coordinates point to io.openliberty too.
Show
[File->Open] open-liberty-masterclass/start/coffee-shop/src/main/java/com/sebastiandaschner/coffeeshop/boundary/OrdersResource.java
Actual path is open-liberty-masterclass/start/coffee-shop/src/main/java/com/sebastian_daschner/coffee_shop/boundary/OrdersResource.java
Because md cannot show _
underscore characters, suggest to change the path to use -
dash character as sebastian-daschner/coffee-shop
instead
Instead of seeing the expeced
[AUDIT ] CWWKG0093A: Processing configuration drop-ins resource: /opt/ol/wlp/usr/servers/defaultServer/configDropins/overrides/metrics-prod.xml
I am seeing the bellow:
$ docker logs coffee-shop
Launching defaultServer (Open Liberty 21.0.0.4/wlp-1.0.51.cl210420210407-0944) on Eclipse OpenJ9 VM, version 1.8.0_292-b10 (en_US)
[AUDIT ] CWWKE0001I: The server defaultServer has been launched.
[AUDIT ] CWWKG0093A: Processing configuration drop-ins resource: /opt/ol/wlp/usr/servers/defaultServer/configDropins/defaults/keystore.xml
[AUDIT ] CWWKG0093A: Processing configuration drop-ins resource: /opt/ol/wlp/usr/servers/defaultServer/configDropins/defaults/open-default-port.xml
[AUDIT ] CWWKZ0058I: Monitoring dropins for applications.
[AUDIT ] CWWKT0016I: Web application available (default_host): http://15b6f01c93d9:9080/openapi/ui/
[AUDIT ] CWWKT0016I: Web application available (default_host): http://15b6f01c93d9:9080/openapi/
[AUDIT ] CWWKT0016I: Web application available (default_host): http://15b6f01c93d9:9080/ibm/api/
[AUDIT ] CWWKT0016I: Web application available (default_host): http://15b6f01c93d9:9080/health/
[AUDIT ] CWWKT0016I: Web application available (default_host): http://15b6f01c93d9:9080/metrics/
[AUDIT ] CWWKT0016I: Web application available (default_host): http://15b6f01c93d9:9080/coffee-shop/
[AUDIT ] CWWKZ0001I: Application coffee-shop started in 2.581 seconds.
[AUDIT ] CWWKF0012I: The server installed the following features: [beanValidation-2.0, cdi-2.0, distributedMap-1.0, ejbLite-3.2, el-3.0, jaxrs-2.1, jaxrsClient-2.1, jndi-1.0, json-1.0, jsonp-1.1, monitor-1.0, mpConfig-2.0, mpHealth-3.0, mpMetrics-3.0, mpOpenAPI-2.0, mpRestClient-2.0, servlet-4.0, ssl-1.0].
[AUDIT ] CWWKF0011I: The defaultServer server is ready to run a smarter planet. The defaultServer server started in 5.057 seconds.
[ERROR ] CWWKS3005E: A configuration exception has occurred. No UserRegistry implementation service is available. Ensure that you have a user registry configured.```
in barista/pom.xml missing following, so mvn failsafe:integration-test
failed at the end of this Module
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>1.16.2</version>
<scope>test</scope>
</dependency>
Open the coffee-shop/src/main/webapp/META-INF/microprofile-config.properties
toNew the open-liberty-masterclass/start/coffee-shop/src/main/webapp/META-INF/microprofile-config.properties
Edit the file: open-liberty-masterclass/start/coffee-shop/src/main/java/com/sebastiandaschner/coffeeshop/health/CoffeeShopReadinessCheck.java
curl http://localhost:9080/health/ready
to curl -s http://localhost:9080/health/ready | jq
and the output as{
"checks": [
{
"data": {},
"name": "CoffeeShopReadinessCheck Readiness Check",
"status": "DOWN"
}
],
"status": "DOWN"
}
Use Java 11 image for Docker.
(1) Remove the below since users no longer need to worry about these with the use of dev mode and our opinionated ideal POM file.
For example, take a look at: https://search.maven.org/artifact/io.openliberty.features/mpMetrics-2.0/20.0.0.4/esa
You'll see in the XML on the left that this feature depends on:
<dependency> <groupId>io.openliberty.features</groupId> <artifactId>com.ibm.websphere.appserver.org.eclipse.microprofile.metrics-2.0</artifactId> <version>19.0.0.8</version> <type>esa</type> </dependency>
Which depends on the Metrics API from Eclipse MicroProfile:
<dependency> <groupId>org.eclipse.microprofile.metrics</groupId> <artifactId>microprofile-metrics-api</artifactId> <version>2.3.0</version> </dependency>
And so during build, this API will be added for you.
Update the below to clarify that you don't need to update the dependencies since we suggest that you depend on the public API from MP and Jakarta EE (as noted in the previous section on Dev Mode) and you only need to configure the features you need in the server.xml.
As we've seen, to use a new feature, we need to add them to the build. There is no need to add a dependency on the APIs for the feature because each feature depends on the APIs. That means during build, the API dependencies are automatically added from maven central.
(2) The use of a parent POM is not necessary especially with dev mode. Should remove the sentence below and the use of parent POM unless there are issues.
The starting and stopping of the Liberty server is configured by the Liberty parent pom (see https://search.maven.org/artifact/net.wasdev.wlp.maven.parent/liberty-maven-app-parent/2.6.3/pom), which is configured as the parent of the Masterclass poms.
AUDIT ] CWWKG0102I: Found conflicting settings for mpMetrics configuration.
Property authentication has conflicting values:
Value false is set in file:/opt/ol/wlp/usr/servers/defaultServer/server.xml.
Value true is set in file:/opt/ol/wlp/usr/servers/defaultServer/configDropins/overrides/metrics-prod.xml.
Property authentication will be set to true.
Issue with UI access too:
Access the /metrics metrics endpoint at: https://accountname-9080.theiadocker-1.proxy.cognitiveclass.ai/metrics via the Launch application tab above the IDE and enter the port 9445.
You will see that the browser complains about the certificate. This is a self-signed certificate generated by Liberty for test purposes. Accept the exception (note, Firefox may not allow you to do this in which case you'll need to use a different browser). You'll be presented with a login prompt. Sign in with userid admin and password change_it (the values in the metrics-prod.xml).
(1) mvn liberty:dev
should suffice
mvn install liberty:dev
(2) Clarify when users need to exit dev mode
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.