hantsy / maven-archetype-jakartaee9

Maven archetype for Jakarta EE 9
https://itnext.io/generate-a-jakarta-ee-9-project-skeleton-from-maven-archetype-2b9fc9ce9bb8
Apache License 2.0
6 stars 3 forks source link

Hello example #3

Open fabricecoulon opened 3 years ago

fabricecoulon commented 3 years ago

Hi, Thanks for sharing this example. I am sure I have the Glassfish container server running: After I did mvn clean package cargo:run, I tried the endpoint:

http://localhost:8080/myapp/api/greeting/JakartaEE

Returns with:

{"message":"Say Hello to JakartaEE at 2021-10-07T14:15:07.938482"}

At the same time, since the container is running, I try mvn clean verify -DskipTests=false but then I get:

Running com.example.demo.GreetingResourceTest
Oct 07, 2021 2:14:58 PM com.example.demo.GreetingResourceTest testGreeting
INFO:  client: null, baseURL: null
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.042 sec <<< FAILURE!
com.example.demo.GreetingResourceTest.testGreeting()  Time elapsed: 0.041 sec  <<< FAILURE!
java.net.MalformedURLException: no protocol: api/greeting/JakartaEE
    at java.base/java.net.URL.<init>(URL.java:627)
    at java.base/java.net.URL.<init>(URL.java:523)
    at com.example.demo.GreetingResourceTest.testGreeting(GreetingResourceTest.java:83)
...

Looks like client:null and baseURL:null can be the source of why the tests fail. I would really appreciate if you could help me with this. Any idea about what I did wrong?

hantsy commented 3 years ago

At the same time, since the container is running, I try mvn clean verify -DskipTests=false

Try to run a standalone Galssfish 6.x for it. I can not get reason from the limited log info, maybe the test deployment failed.