Hi,
The getting-started-with-astra-java code is working OK. Astra connection info has been initialized correctly in SessionManager.java
and the Java code is tested OK with mvn spring-boot:run
and Swagger on http://localhost:5000/.
The ./target/getting-started-with-astra-java-1.0.0-SNAPSHOT.jar
has been successfully built by mvn clean install
After working out the issue building the docker image of getting-started-with-astra-java
as mentioned in the post week6 mvn dockerfile:build failed
I'd like to test that the java backend (using Astra) is working Ok.
$ docker run astra-backend:my-image -p 5000:5000
The console output seems to indicate that the Java backend is running
___ _
/ _ \ | |
/ /_\ \ ___ | |_ _ __ __ _
| _ |/ __|| __|| '__| / _` |
| | | |\__ \| |_ | | | (_| |
\_| |_/|___/ \__||_| \__,_|
Getting Started with Astra
03:54:40.565 INFO com.datastax.astra.GettingStartedWithAstra : Starting GettingStartedWithAstra v1.0.0-SNAPSHOT on 559b69bdfe58 with PID 1 (/app.jar started by root in /)
03:54:40.572 INFO com.datastax.astra.GettingStartedWithAstra : No active profile set, falling back to default profiles: default
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (jar:file:/app.jar!/BOOT-INF/lib/groovy-2.5.7-indy.jar!/) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
03:54:43.594 INFO com.datastax.astra.controller.CorsController : Allowing CORS
03:54:44.793 INFO com.datastax.astra.GettingStartedWithAstra : Started GettingStartedWithAstra in 5.057 seconds (JVM running for 5.748)
03:54:44.801 INFO com.datastax.astra.GettingStartedWithAstra : Environment variable 'USE_ASTRA' not found defaulting to 'true'
{PATH=/usr/local/openjdk-11/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin, HOSTNAME=559b69bdfe58, JAVA_HOME=/usr/local/openjdk-11, JAVA_VERSION=11.0.8, LANG=C.UTF-8, HOME=/root}
On another terminal, I'd like to see if the java backend is serving on port 5000
$ curl http://localhost:5000
curl: (7) Failed to connect to localhost port 5000: Connection refused
$ curl http://localhost:5000/api/credentials
curl: (7) Failed to connect to localhost port 5000: Connection refused
QUESTION: Can you please suggest a way to test that the JAR in the docker image is working?