Skip to content

Conversation

geoand
Copy link
Collaborator

@geoand geoand commented Feb 4, 2019

Follows up on #17 since the PR needed to be opened against development

@geoand geoand force-pushed the rest-client branch 2 times, most recently from 9996797 to f84db2d Compare February 4, 2019 08:58
@geoand geoand changed the title Add a rest-client example WIP: Add a rest-client example Feb 4, 2019
@geoand
Copy link
Collaborator Author

geoand commented Feb 4, 2019

@gsmet Currently I can't get this work even with no https involved: I'm seeing:

Caused by: java.lang.ClassNotFoundException: com.oracle.svm.core.jdk.UnsupportedFeatureError

The even weirder thing is that when I use mvn clean compile shamrock:dev, the quickstart does work 🤔

Any idea what might be going on?

@cescoffier
Copy link
Member

Here is the complete stack trace:

ERROR: UT005023: Exception handling request to /country/name/greece
java.lang.NoClassDefFoundError: com/oracle/svm/core/jdk/UnsupportedFeatureError
	at org.acme.restclient.CountriesService_Synthetic_Bean.create(Unknown Source)
	at org.acme.restclient.CountriesService_Synthetic_Bean.create(Unknown Source)
	at org.jboss.protean.arc.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:76)
	at org.jboss.protean.arc.AbstractSharedContext.lambda$new$0(AbstractSharedContext.java:32)
	at org.jboss.protean.arc.ComputingCache$CacheFunction.lambda$apply$0(ComputingCache.java:108)
	at org.jboss.protean.arc.LazyValue.get(LazyValue.java:42)
	at org.jboss.protean.arc.ComputingCache.getValue(ComputingCache.java:54)
	at org.jboss.protean.arc.AbstractSharedContext.get(AbstractSharedContext.java:38)
	at org.acme.restclient.CountriesService_Synthetic_Bean.get(Unknown Source)
	at org.acme.restclient.CountriesService_Synthetic_Bean.get(Unknown Source)
	at org.acme.restclient.CountriesResource_Bean.create(Unknown Source)
	at org.acme.restclient.CountriesResource_Bean.create(Unknown Source)
	at org.jboss.protean.arc.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:76)
	at org.jboss.protean.arc.AbstractSharedContext.lambda$new$0(AbstractSharedContext.java:32)
	at org.jboss.protean.arc.ComputingCache$CacheFunction.lambda$apply$0(ComputingCache.java:108)
	at org.jboss.protean.arc.LazyValue.get(LazyValue.java:42)
	at org.jboss.protean.arc.ComputingCache.getValue(ComputingCache.java:54)
	at org.jboss.protean.arc.AbstractSharedContext.get(AbstractSharedContext.java:38)
	at org.acme.restclient.CountriesResource_Bean.get(Unknown Source)
	at org.acme.restclient.CountriesResource_Bean.get(Unknown Source)
	at org.jboss.protean.arc.ArcContainerImpl$1.get(ArcContainerImpl.java:145)
	at org.jboss.protean.arc.ArcContainerImpl$1.get(ArcContainerImpl.java:138)
	at org.jboss.shamrock.arc.runtime.ArcDeploymentTemplate$2$1.get(ArcDeploymentTemplate.java:76)
	at org.jboss.shamrock.jaxrs.runtime.graal.ShamrockConstructorInjector.construct(ShamrockConstructorInjector.java:62)
	at org.jboss.resteasy.plugins.server.resourcefactory.POJOResourceFactory.createResource(POJOResourceFactory.java:69)
	at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:316)
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:476)
	at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:252)
	at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:153)
	at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:362)
	at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:156)
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:238)
	at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:229)
	at org.jboss.shamrock.jaxrs.runtime.ResteasyFilter$ResteasyResponseWrapper.sendError(ResteasyFilter.java:71)
	at io.undertow.servlet.handlers.DefaultServlet.doGet(DefaultServlet.java:173)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:686)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:791)
	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
	at org.jboss.shamrock.jaxrs.runtime.ResteasyFilter.doFilter(ResteasyFilter.java:42)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
	at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)
	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
	at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
	at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
	at org.jboss.shamrock.undertow.runtime.UndertowDeploymentTemplate$5$1$1.call(UndertowDeploymentTemplate.java:322)
	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:364)
	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1998)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1525)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1382)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: com.oracle.svm.core.jdk.UnsupportedFeatureError
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 73 more

If I remember correctly it's the same issue I had initially.

@cescoffier
Copy link
Member

Hum actually not, mine was really about SSL. This one looks related to Arc. @mkouba any idea?

@mkouba
Copy link
Contributor

mkouba commented Feb 4, 2019

I'll take a look in few mins...

@geoand
Copy link
Collaborator Author

geoand commented Feb 4, 2019

I think I know the culprit: https://github.com/jbossas/protean-shamrock/blob/c9d8a344ac897e6c6b18bc2b72c607219111e0cc/extensions/rest-client/runtime/src/main/java/org/jboss/shamrock/restclient/runtime/RestClientBase.java#L26

It seems like the RestClientBase "depends" on an SVM class which won't be there when running the JAR.

@geoand
Copy link
Collaborator Author

geoand commented Feb 4, 2019

@gsmet Would you like me to open a PR in Protean that will catch an Exception and check for the class name as a String?

@geoand
Copy link
Collaborator Author

geoand commented Feb 4, 2019

Protean PR ready: quarkusio/quarkus#747

@geoand geoand changed the title WIP: Add a rest-client example Add a rest-client example Feb 5, 2019
@geoand
Copy link
Collaborator Author

geoand commented Feb 5, 2019

Now that the fix has been merged, https should be working just fine with this example

README.md Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nitpicking s/Rest/REST/g

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@gsmet
Copy link
Member

gsmet commented Feb 5, 2019

So... I wanted to use it as the base for my SSL guide and then discovered that the tests were not run for native images.

I fixed that but it definitely does not work in native mode. I fixed a few issues already but there are a few more I need to understand and fix.

Please do not merge for now.

@geoand Your code is OK so feel free to start writing the guide. The issues are in Shamrock itself.

@geoand
Copy link
Collaborator Author

geoand commented Feb 5, 2019

@gsmet Sounds good.

I am pretty busy this week, but I believe I'll be able to squeeze in the guide :)

@geoand
Copy link
Collaborator Author

geoand commented Feb 7, 2019

@gsmet Since the guides are supposed to link to the quickstart, should we perhaps postpone the RESTClient guide?

@gsmet
Copy link
Member

gsmet commented Feb 7, 2019

You can write still write it, we will just merge them both at the same time. I hope I will get it done by the end of today.

@geoand
Copy link
Collaborator Author

geoand commented Feb 7, 2019

Will do then 😉

@gsmet
Copy link
Member

gsmet commented Feb 13, 2019

@geoand got it working with native now so I added a commit to enable native testing and merged.

Thanks again.

@gsmet gsmet closed this Feb 13, 2019
@geoand
Copy link
Collaborator Author

geoand commented Feb 13, 2019

Sounds great 👍

@geoand geoand deleted the rest-client branch February 13, 2019 10:14
@geoand
Copy link
Collaborator Author

geoand commented Feb 13, 2019

So I guess we can now merge quarkusio/quarkus#791?

@gsmet
Copy link
Member

gsmet commented Feb 13, 2019

Working on it as we speak :)

@geoand
Copy link
Collaborator Author

geoand commented Feb 13, 2019

Awesome :)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants