IBMDevEnagageQuickLabs / katacoda-guides

A repository for Katacoda Guides to be used as Quick Labs at conferences
2 stars 2 forks source link

Problems in Deploying and packaging applications #1

Open fmhwong opened 4 years ago

fmhwong commented 4 years ago

Step 2

Problem 1

$ export JAVA_HOME=$(/usr/lib/jvm/java-8-openjdk-amd64)
-bash: /usr/lib/jvm/java-8-openjdk-amd64: Is a directory

The directory shouldn't be in $( )

Problem 2

After added <feature>mpHealth-2.0</feature> into server.xml and ran mvn package, Liberty didn't detect server.xml has changed and therefore /health still returned 404. I had to restart Liberty to get it working.

Step 3

Problem 3

Ran these two commands

$ cd src/main/java/io/openliberty/sample/system
$ touch SystemReadinessCheck.java

and clicked the link to open SystemReadinessCheck.java. No file was open in the editor. I have to manually navigate to the file to open it. Pasted the code.

Problem 4

Ran the this command

$ touch SystemLivenessCheck.java

Where is the link to open it? Where is the content to copy and paste?

Problem 5

Instruction says to ran mvn compileand got this error

[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/root/guide-getting-started/start/src/main/java/io/openliberty/sample/system). Please verify you invoked Maven from the correct directory. -> [Help 1]

This was because I was still at /root/guide-getting-started/start/src/main/java/io/openliberty/sample/system The instruction should have a cd back to start

Problem 6

I changed directory back to /root/guide-getting-started/start and ran mvn compile. I got compile error.

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project guide-getting-started: Compilation failure
[ERROR] /root/guide-getting-started/start/src/main/java/io/openliberty/sample/system/SystemReadinessCheck.java:[26,57] cannot find symbol
[ERROR] symbol:   method equalsIgnoreCase(java.lang.String)
[ERROR] location: class java.lang.Object
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Step 4

Problem 7

The link could not open server.xml

Problem 8

The content of server.xml in the instructions was different from what I have in the actual file.

Problem 9

It doesn't have a snippet for me to copy and paste the logging element.

<logging traceSpecification="com.ibm.ws.microprofile.health.*=all" />

Step 5

Problem 10

It didn't tell users to stop the server first before trying mvn liberty:start and mvn liberty:stop

Step 6

Problem 11

Since I have compile errors from previous steps, I started off from a new session and fast forwarded to step 6.

/root
$ cd guide-getting-started/
$ cd start
$ mvn install -P runnable-package
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for io.openliberty.guides:guide-getting-started:war:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for io.openliberty.tools:liberty-maven-plugin is missing. @ line 80, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building guide-getting-started 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ guide-getting-started ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /root/guide-getting-started/start/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ guide-getting-started ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ guide-getting-started ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /root/guide-getting-started/start/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) @ guide-getting-started ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ guide-getting-started ---
[INFO]
[INFO] --- maven-war-plugin:3.2.2:war (default-war) @ guide-getting-started ---
[INFO] Packaging webapp
[INFO] Assembling webapp [guide-getting-started] in [/root/guide-getting-started/start/target/guide-getting-started]
[INFO] Processing war project
[INFO] Copying webapp resources [/root/guide-getting-started/start/src/main/webapp]
[INFO] Webapp assembled in [51 msecs]
[INFO] Building war: /root/guide-getting-started/start/target/guide-getting-started.war
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ guide-getting-started ---
[INFO] Installing /root/guide-getting-started/start/target/guide-getting-started.war to /root/.m2/repository/io/openliberty/guides/guide-getting-started/1.0-SNAPSHOT/guide-getting-started-1.0-SNAPSHOT.war
[INFO] Installing /root/guide-getting-started/start/pom.xml to /root/.m2/repository/io/openliberty/guides/guide-getting-started/1.0-SNAPSHOT/guide-getting-started-1.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.292 s
[INFO] Finished at: 2019-10-30T22:50:33+00:00
[INFO] Final Memory: 15M/66M
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "runnable-package" could not be activated because it does not exist.

Problem 12

Got a similar warning in next step

[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "minify-runnable-package" could not be activated because it does not exist.

Step 7

Problem 13

This link To access the application, visit the http://localhost:9080/system/properties URL. opens up http://localhost:9080/system/properties not a katacoda URL. It should be https://2886795310-9080-cykoria02.environments.katacoda.com/system/properties

fmhwong commented 4 years ago

@yasmin-aumeeruddy Please take a look ASAP. We need this fixed by Friday morning. cc @gcharters