RESTEASY003655: No resource method found for OPTIONS

Afternoon,
I am happy to be testing a new M1 with LEAF and ran into an error that I think might be related to my ARM chip. The below error repeats with no additional information.

I realize this is a bit early to be asking M1 questions, but I am hoping someone on the LEAF side of the house has seen this already?

Thanks in advance.
sg

19:46:11.433 [qtp501254005-36] WARN  c.l.l.e.m.LeafExceptionMapper - There has been an exception mapped to a Internal Server Error response
org.jboss.resteasy.spi.DefaultOptionsMethodException: RESTEASY003655: No resource method found for options, return OK with Allow header
	at org.jboss.resteasy.core.registry.SegmentNode.match(SegmentNode.java:442) ~[resteasy-core-4.6.1.Final.jar:4.6.1.Final]
	at org.jboss.resteasy.core.registry.SegmentNode.match(SegmentNode.java:154) ~[resteasy-core-4.6.1.Final.jar:4.6.1.Final]
	at org.jboss.resteasy.core.registry.RootNode.match(RootNode.java:74) ~[resteasy-core-4.6.1.Final.jar:4.6.1.Final]
	at org.jboss.resteasy.core.registry.RootClassNode.match(RootClassNode.java:47) ~[resteasy-core-4.6.1.Final.jar:4.6.1.Final]
	at org.jboss.resteasy.core.ResourceMethodRegistry.getResourceInvoker(ResourceMethodRegistry.java:480) ~[resteasy-core-4.6.1.Final.jar:4.6.1.Final]
	at org.jboss.resteasy.core.SynchronousDispatcher.getInvoker(SynchronousDispatcher.java:332) ~[resteasy-core-4.6.1.Final.jar:4.6.1.Final]
	at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:253) ~[resteasy-core-4.6.1.Final.jar:4.6.1.Final]
	at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:161) ~[resteasy-core-4.6.1.Final.jar:4.6.1.Final]
	at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364) ~[resteasy-core-4.6.1.Final.jar:4.6.1.Final]
	at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:164) ~[resteasy-core-4.6.1.Final.jar:4.6.1.Final]
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:247) ~[resteasy-core-4.6.1.Final.jar:4.6.1.Final]
	at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:249) ~[resteasy-core-4.6.1.Final.jar:4.6.1.Final]
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:60) ~[resteasy-core-4.6.1.Final.jar:4.6.1.Final]
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) ~[resteasy-core-4.6.1.Final.jar:4.6.1.Final]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[javax.servlet-api-3.1.0.jar:3.1.0]
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) ~[jetty-servlet-9.4.44.v20210927.jar:9.4.44.v20210927]
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550) ~[jetty-servlet-9.4.44.v20210927.jar:9.4.44.v20210927]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501) ~[jetty-servlet-9.4.44.v20210927.jar:9.4.44.v20210927]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:713) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:59) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.server.Server.handle(Server.java:512) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) ~[jetty-server-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) ~[jetty-io-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) ~[jetty-io-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) ~[jetty-io-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) ~[jetty-util-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) ~[jetty-util-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) ~[jetty-util-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) ~[jetty-util-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) ~[jetty-util-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) ~[jetty-util-9.4.45.v20220203.jar:9.4.45.v20220203]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) ~[jetty-util-9.4.45.v20220203.jar:9.4.45.v20220203]
	at java.lang.Thread.run(Thread.java:829) ~[?:?]

Hi Stephen.

Thanks for raising the issue! There are some LEAF devs with M1’s already and as far as I know there aren’t any issues with LEAF on M1. Could you please share exactly what LEAF calls you were making at the time this exception happened. It’s not clear from the stack trace you provided. Hopefully, if it is a LEAF problem, you should be able to find a stacktrace that has some LEAF classes in the call stack.

I’m tagging a few other folks just to see if they are aware of anything I might be missing. @joshua.l.ward @mark.a.alvaro

Not totally sure if I’m right about this, but I think browsers tend to make options requests when making cross origin requests. One workaround while developing is to add a CORS filter to the server to get around that error. I’d definitely do a little digging on CORS or maybe someone more knowledgeable about that than me can weigh in.

For development purposes, LEAF provides a CorsFilter that can be added to a Jetty server or a Spring server. I’ll paste a snippet of how to apply it to a new generated service below that uses LEAF’s WebServer class:

private final WebServer webServer;

...

this.webServer = WebServer.newBuilder()
        .withDataService(this.dataService)
        .build();
this.webServer.getRestServiceHandler().addFilter(CorsFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));
2 Likes

Gentleman,

Problem solved and I should apologize for raising this issue. I was too quick to mistrust the new architecture. It was in fact a CORS issue and not anything to do the ARM. Thank you both for responding.

sg

1 Like

Glad you solved the mystery and congrats on the new laptop that shouldn’t melt through your desk like the Intel Macs!

1 Like