Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement - provide other MicroProfile runtime payara #7

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

amhambra
Copy link

note: I changed port to 8080.

issue 1: can not load the test data in

@PostConstruct
com.packt.microprofile.book.ch4.client.MPRestClient.initThesaurus()

so call to

http://localhost:8080/ch4/rest/thesaurus/funny

results in

funny

issue 2: exception on MPRestClient

Call to

http://localhost:8080/ch4/rest/client/mp/loud

results in

[INFO] [err] javax.ws.rs.WebApplicationException: HTTP 404 Not Found
[INFO] [err] at org.apache.cxf.microprofile.client.DefaultResponseExceptionMapper.toThrowable(DefaultResponseExceptionMapper.java:33)
[INFO] [err] at [internal classes]
[INFO] [err] at org.apache.cxf.microprofile.client.proxy.MicroProfileClientProxyImpl.access$000(MicroProfileClientProxyImpl.java:76)
[INFO] [err] at org.apache.cxf.microprofile.client.proxy.MicroProfileClientProxyImpl$Invoker.call(MicroProfileClientProxyImpl.java:510)
[INFO] [err] at [internal classes]
[INFO] [err] at com.sun.proxy.$Proxy69.setSynonymsFor(Unknown Source)
[INFO] [err] at com.packt.microprofile.book.ch4.client.MPRestClient.initThesaurus(MPRestClient.java:78)
[INFO] [err] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] [err] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO] [err] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] [err] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[INFO] [err] at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:83)
[INFO] [err] at [internal classes]
[INFO] [err] at javax.servlet.http.HttpServlet.service(HttpServlet.java:686)
[INFO] [err] at com.ibm.websphere.jaxrs.server.IBMRestServlet.service(IBMRestServlet.java:96)
[INFO] [err] at [internal classes]
[INFO] [err] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[INFO] [err] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[INFO] [err] at java.base/java.lang.Thread.run(Thread.java:829)
[INFO] [err] com.packt.microprofile.book.ch4.thesaurus.NoSuchWordException:
[INFO]

[INFO]
[INFO] [err] at com.packt.microprofile.book.ch4.client.NoSuchWordResponseMapper.toThrowable(NoSuchWordResponseMapper.java:20)
[INFO] [err] at com.packt.microprofile.book.ch4.client.NoSuchWordResponseMapper.toThrowable(NoSuchWordResponseMapper.java:10)
[INFO] [err] at org.apache.cxf.microprofile.client.proxy.MicroProfileClientProxyImpl.checkResponse(MicroProfileClientProxyImpl.java:197)
[INFO] [err] at [internal classes]
[INFO] [err] at org.apache.cxf.microprofile.client.proxy.MicroProfileClientProxyImpl.access$000(MicroProfileClientProxyImpl.java:76)
[INFO] [err] at org.apache.cxf.microprofile.client.proxy.MicroProfileClientProxyImpl$Invoker.call(MicroProfileClientProxyImpl.java:510)
[INFO] [err] at [internal classes]
[INFO] [err] at com.sun.proxy.$Proxy69.getSynonymsFor(Unknown Source)
[INFO] [err] at com.packt.microprofile.book.ch4.client.MPRestClient.synonymsFor(MPRestClient.java:31)
[INFO] [err] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] [err] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO] [err] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] [err] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[INFO] [err] at com.ibm.ws.jaxrs20.cdi.component.JaxRsFactoryImplicitBeanCDICustomizer.serviceInvoke(JaxRsFactoryImplicitBeanCDICustomizer.java:351)
[INFO] [err] at [internal classes]
[INFO] [err] at javax.servlet.http.HttpServlet.service(HttpServlet.java:686)
[INFO] [err] at com.ibm.websphere.jaxrs.server.IBMRestServlet.service(IBMRestServlet.java:96)
[INFO] [err] at [internal classes]
[INFO] [err] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[INFO] [err] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[INFO] [err] at java.base/java.lang.Thread.run(Thread.java:829)

solution: adapting quarkus starter project pom.xml and put it to work with unchanged code

note: Adapted code to use quarkus default port 8080.

Here both issues are away and expected results are coming.

info: no change on code apart from default port 8080.

Frank Schulte,OG1,,0202441468 and others added 10 commits October 22, 2021 23:29
…otal not working.

solve: ch4 - change to quarkus and only change url port to quarkus default 8080. Then ch4 endpoints are fully working!
add: working wildfly pom.
change: use port 8080 and host="*" server settings.
info: liberty and payara still not working.
…e (@RegisterRestClient). Only if you use @restclient injection will work on WildFly, Quarkus and Liberty.

fix: Consumer/Producer annotations of async/no-async clients.
open: Liberty and Payara have problems.
add: Readme.md for each MicroProfile Runtime.
@amhambra
Copy link
Author

Got Quarkus and Wildfly fully working.
Liberty and Payara fail on different problems.
Added pom and Readme for each MicroProfile Runtime.

@amhambra amhambra changed the title Issue #1 - current ch4 has issues when executed by liberty (19.0.0.9 till LATEST) but working in quarkus 2.3.1.Final enhancement - provide other MicroProfile runtimes like quarkus, wildfly, payara Oct 26, 2021
…wildfly that are working with the original code after fix of the context issue.

add: README.payara.md and pom.xml.payara with documenation that it can't execute the original code also after fix of the context issue.
@amhambra amhambra changed the title enhancement - provide other MicroProfile runtimes like quarkus, wildfly, payara enhancement - provide other MicroProfile runtime payara Oct 27, 2021
@amhambra
Copy link
Author

Issues here are solved without code changes for MicroProfile runtimes: quarkus, liberty and wildfly.
See: pr9.

Payara is NOT working in any Version with the current code.
Payara LATEST with changes to @restclient injection can start but @consumer / @Producer are reported to be not valid. Looking further into.

Other point: I did not test, till now, all the other endpoints in ch4 and in doing so now, find more issues like the async rest client not working. Any hints?

@andymc12
Copy link
Collaborator

Other point: I did not test, till now, all the other endpoints in ch4 and in doing so now, find more issues like the async rest client not working. Any hints?

Which server(s) is async failing on? And do you have more information (like an exception stack trace or error messages, etc.)? Thanks

test: wildfily ok.
test: quarkus ok but one endpojnt fails: http://localhost:9080/ch4/rest/client/jaxrs/async/callback/funny,JaxRsAsyncWord2,loud,JaxRsAsyncWord3 giving erratic result not expected!
test: payara ERROR. Nothing works as ch4 deployment fails on CDI injection.

update: README for liberty, wildfly, quarkus and payara.
note: libertiy is fully predictable working. the words coming back in the row they are in the input parameter.
note: wildfly is mostly predictable working. the words coming back in different ordering and changing ordering different as they are in the input parameter.
note: quarkus is fully unreliable. It does not return the expected result. Sometimes it is right. Sometimes nothing comes back or only a section of the result from the input parameter values.
@amhambra
Copy link
Author

Other point: I did not test, till now, all the other endpoints in ch4 and in doing so now, find more issues like the async rest client not working. Any hints?

Which server(s) is async failing on? And do you have more information (like an exception stack trace or error messages, etc.)? Thanks

In all I now tested all available endpoints for chapter 4. read the full chapter and following the samples and test all of them:

  • liberty OK
  • wildfly OK
  • quarkus ok but one endpoint unreliable
  • payara FAIL as CDI injection not working. See README.payara.md.

a) http://localhost:9080/ch4/rest/client/jaxrs/async/callback/funny,JaxRsAsyncWord2,loud,JaxRsAsyncWord3

I got it working for

  • liberty
  • wildfly
    and for
  • quarkus
    the result is unreliable.

Please see the other commit messages and the README..md files.

b) ASYNC - ThesaurusAsyncClient - /client/mp/async/{word}

http://localhost:9080/ch4/rest/client/mp/async/loud,UnKnown,funny

I got it working for

  • liberty
  • wildfly
  • quarkus

Please see the other commits.

c) Will work on merge conflicts tomorrow...

Cheers,
Frank

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants