You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(4) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2010 |
Jan
(1) |
Feb
(2) |
Mar
(6) |
Apr
(5) |
May
(1) |
Jun
(2) |
Jul
(2) |
Aug
(8) |
Sep
(4) |
Oct
(2) |
Nov
(6) |
Dec
(4) |
2011 |
Jan
(4) |
Feb
(18) |
Mar
(9) |
Apr
(7) |
May
(6) |
Jun
(13) |
Jul
(11) |
Aug
(7) |
Sep
(12) |
Oct
(28) |
Nov
(12) |
Dec
(11) |
2012 |
Jan
(20) |
Feb
(21) |
Mar
(19) |
Apr
(12) |
May
(44) |
Jun
(23) |
Jul
(14) |
Aug
(26) |
Sep
(23) |
Oct
(7) |
Nov
(42) |
Dec
(15) |
2013 |
Jan
(62) |
Feb
(20) |
Mar
(14) |
Apr
(52) |
May
(29) |
Jun
(46) |
Jul
(20) |
Aug
(55) |
Sep
(27) |
Oct
(53) |
Nov
(29) |
Dec
(21) |
2014 |
Jan
(35) |
Feb
(44) |
Mar
(12) |
Apr
(37) |
May
(24) |
Jun
(17) |
Jul
(13) |
Aug
(1) |
Sep
(4) |
Oct
(13) |
Nov
(1) |
Dec
(1) |
2015 |
Jan
(11) |
Feb
(8) |
Mar
(10) |
Apr
(7) |
May
(17) |
Jun
(11) |
Jul
(13) |
Aug
(14) |
Sep
(6) |
Oct
(3) |
Nov
(7) |
Dec
(3) |
2016 |
Jan
(1) |
Feb
(4) |
Mar
(8) |
Apr
(2) |
May
(2) |
Jun
(10) |
Jul
|
Aug
|
Sep
(5) |
Oct
(1) |
Nov
|
Dec
|
From: Pavel H. <pho...@ce...> - 2016-03-09 08:43:57
|
Hi, using resteasy 3.0.11 provided in Wildfly 9. I just need to transmit InputStream received from another rest service. @GET @Produces(MediaType.APPLICATION_OCTET_STREAM) @Path("/files/{fileName}/content") public Response streamFile(@PathParam("fileName") String fileName) throws IOException { Invocation.Builder request = new ResteasyClientBuilder().build().target("htt....").request(); InputStream is = request.get(new GenericType<InputStream>() {}); return Response.ok().entity(is).build(); } But i should probably close the response somewhere. How to do it? If i change me code like below (to be able to call res.close()) only a part of original InputStream is readed and i become IO Closed Stream exception. Response res = request.get(); InputStream is = res.readEntity(new GenericType<InputStream>() {}); tHx. |
From: Nicolas G. <ng...@vi...> - 2016-03-02 11:44:16
|
Thanks Shivam for the reply, I will give it a try. Le 29/02/2016 14:29, res...@li... a écrit : > Message: 1 > Date: Fri, 5 Feb 2016 08:58:35 +0000 (UTC) > From: Shivam <shi...@hc...> > Subject: Re: [Resteasy-users] failed to upgrade resteasy in jboss eap > 6.1 > To: res...@li... > Message-ID: <loo...@po...> > Content-Type: text/plain; charset=utf-8 > > Nicolas Gavard <ng@...> writes: > >> >> >> Hi all resteasy users, >> I'm trying to upgrade resteasy in a JBoss EAP 6.1 with resteasy >> 3.0.13.Final. >> I followed the resteasy doc : > http://docs.jboss.org/resteasy/docs/3.0.13.Final/userguide/html/Installa > tion_Configuration.html#upgrading-eap61 >> that seems thraightforward. >> Nevertheless, i'm facing this following error at the very first > web >> service call. >> 11:20:06,374 WARN? ajp-localhost/127.0.0.1:8009-3(:) >> [modules] - Failed to define class >> org.jboss.resteasy.resteasy_jaxrs.i18n.LogMessages in Module >> "org.jboss.resteasy.resteasy-jaxrs:main" from local module >> loader <at> 40133da0 (finder: local module finder <at> > 2f32f43d (roots: >> D:\EnvDev\jboss-eap-6.1\modules,D:\EnvDev\jboss-eap- > 6.1\modules\system\layers\base)): >> java.lang.LinkageError: Failed to link >> org/jboss/resteasy/resteasy_jaxrs/i18n/LogMessages (Module >> "org.jboss.resteasy.resteasy-jaxrs:main" from local module >> loader <at> 40133da0 (finder: local module finder <at> > 2f32f43d (roots: >> D:\EnvDev\jboss-eap-6.1\modules,D:\EnvDev\jboss-eap- > 6.1\modules\system\layers\base))) >> ??? at >> > org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:4 > 27) >> [jboss-modules.jar:1.2.0.Final-redhat-1] >> ??? at >> > org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.jav > a:260) >> [jboss-modules.jar:1.2.0.Final-redhat-1] >> ??? at >> > org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.j > ava:75) >> [jboss-modules.jar:1.2.0.Final-redhat-1] >> ??? at > org.jboss.modules.Module.loadModuleClass(Module.java:526) >> [jboss-modules.jar:1.2.0.Final-redhat-1] >> ??? at >> > org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:188 > ) >> [jboss-modules.jar:1.2.0.Final-redhat-1] >> ??? at >> > org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(Concur > rentClassLoader.java:444) >> [jboss-modules.jar:1.2.0.Final-redhat-1] >> ??? at >> > org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(Concurre > ntClassLoader.java:432) >> [jboss-modules.jar:1.2.0.Final-redhat-1] >> ??? at >> > org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClass > Loader.java:374) >> [jboss-modules.jar:1.2.0.Final-redhat-1] >> ??? at >> > org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader. > java:119) >> [jboss-modules.jar:1.2.0.Final-redhat-1] >> ??? at >> > org.jboss.resteasy.plugins.providers.RegisterBuiltin.registerProviders(R > egisterBuiltin.java:72) >> ??? at >> > org.jboss.resteasy.plugins.providers.RegisterBuiltin.register(RegisterBu > iltin.java:29) >> ??? at >> > org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java: > 221) >> ??? at >> > org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.ini > t(ServletContainerDispatcher.java:113) >> ??? at >> > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(Htt > pServletDispatcher.java:36) >> [...] >> Caused by: java.lang.NoClassDefFoundError: >> org/jboss/logging/BasicLogger >> ??? at java.lang.ClassLoader.defineClass1(Native Method) >> [rt.jar:1.7.0_79] >> ??? at java.lang.ClassLoader.defineClass(ClassLoader.java:800) >> [rt.jar:1.7.0_79] >> ??? at >> > org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoade > r.java:344) >> [jboss-modules.jar:1.2.0.Final-redhat-1] >> ??? at >> > org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:4 > 22) >> [jboss-modules.jar:1.2.0.Final-redhat-1] >> ??? ... 27 more >> Caused by: java.lang.ClassNotFoundException: >> org.jboss.logging.BasicLogger from [Module >> "org.jboss.resteasy.resteasy-jaxrs:main" from local module >> loader <at> 40133da0 (finder: local module finder <at> > 2f32f43d (roots: >> D:\EnvDev\jboss-eap-6.1\modules,D:\EnvDev\jboss-eap- > 6.1\modules\system\layers\base))] >> ??? at >> > org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196 > ) >> [jboss-modules.jar:1.2.0.Final-redhat-1] >> ??? at >> > org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(Concur > rentClassLoader.java:444) >> [jboss-modules.jar:1.2.0.Final-redhat-1] >> ... >> ??? ... 31 more >> >> >> >> I tried to add "org.jboss.logging" as a module dependency in the >> modules.xml file in org.jboss.resteasy.resteasy-jaxrs:main >> But, then, i'm facing another NoClassDefFoundError: >> 11:43:53,060 WARN? ajp-localhost/127.0.0.1:8009-2(:) >> [i18n] - RESTEASY002145: NoClassDefFoundError: Unable to load >> builtin provider: >> > org.jboss.resteasy.plugins.validation.hibernate.ValidatorContextResolver > : >> java.lang.NoClassDefFoundError: javax/annotation/Priority >> ??? at >> > org.jboss.resteasy.spi.ResteasyProviderFactory.getPriority(ResteasyProvi > derFactory.java:1371) >> ??? at >> > org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(Resteasy > ProviderFactory.java:1636) >> ??? at >> > org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(Resteasy > ProviderFactory.java:1344) >> ??? at >> > org.jboss.resteasy.plugins.providers.RegisterBuiltin.registerProviders(R > egisterBuiltin.java:68) >> ??? at >> > org.jboss.resteasy.plugins.providers.RegisterBuiltin.register(RegisterBu > iltin.java:29) >> ??? at >> > org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java: > 221) >> ??? at >> > org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.ini > t(ServletContainerDispatcher.java:113) >> ??? at >> > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(Htt > pServletDispatcher.java:36) >> ??? at >> > org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav > a:1194) >> [...] >> Caused by: java.lang.ClassNotFoundException: >> javax.annotation.Priority from [Module >> "org.jboss.resteasy.resteasy-jaxrs:main" from local module >> loader <at> 40133da0 (finder: local module finder <at> > 2f32f43d (roots: >> D:\EnvDev\jboss-eap-6.1\modules,D:\EnvDev\jboss-eap- > 6.1\modules\system\layers\base))] >> ??? at >> > org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196 > ) >> [jboss-modules.jar:1.2.0.Final-redhat-1] >> ??? at >> > org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(Concur > rentClassLoader.java:444) >> [jboss-modules.jar:1.2.0.Final-redhat-1] >> ??? at >> > org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(Concurre > ntClassLoader.java:432) >> [jboss-modules.jar:1.2.0.Final-redhat-1] >> ??? at >> > org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClass > Loader.java:374) >> [jboss-modules.jar:1.2.0.Final-redhat-1] >> ??? at >> > org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader. > java:119) >> [jboss-modules.jar:1.2.0.Final-redhat-1] >> ??? ... 22 more >> >> >> I'm using a very simple jax Aplication that works fine with > resteasy >> provided by the jboss server >> <at> ApplicationPath("/api") >> public class JaxRestApplication extends Application { >> } >> >> >> >> It does not seem the right way to fix my issue. >> I did not find any clue or known issue about this. >> Any help would be great,-- >> Nicolas >> >> >> ---------------------------------------------------------------------- > -------- >> >> ---------------------------------------------------------------------- > -------- > > I have also faced the same problem while upgrading resteasy to 3.0.13 > from 2.3.2 > > Problem 1. For java.lang.LinkageError: Failed to link > org/jboss/resteasy/resteasy_jaxrs/i18n/LogMessages > > Solution: Add "org.jboss.logging" as a module dependency in the > modules.xml file in org.jboss.resteasy.resteasy-jaxrs:main > > > Problem 2: NoClassDefFoundError: Unable to load > builtin provider: > org.jboss.resteasy.plugins.validation.hibernate.ValidatorContextResolver > :java.lang.NoClassDefFoundError: javax/annotation/Priority > > > Solution: Upgraded the jboss-annotations-api_1.2_spec-1.0.0.Final.jar > from older jar. > > > That resolved both of the problems. -- Nicolas Gavard |
From: Thomas S. <tse...@re...> - 2016-03-01 17:29:07
|
Hi everyone, I work on Hawkular Metrics, which is a Wildfly 10 application. Most of our JAX-RS handlers use the asynchronous response capability. In front of our endpoints, we have a filter dedicated to authentication/authorization checks in Openshift environments. Currently this filter makes blocking calls to Kubernete's master server, and we would like to make this asynchronous as well. So I started by changing the filter code to start an AsyncContext (ServletRequest#startAsync()), but I get this exception from RestEasy: java.lang.IllegalStateException: RESTEASY009510: Already suspended It comes from #setupAsyncContext in Servlet3AsyncHttpRequest.Servlet3ExecutionContext: https://git.io/v2PUW This code could be changed to reuse the asyncContext if ServletRequest#isAsyncStarted returns true. But I guess there is a reason not to that? Regards, Thomas |
From: Noushad A. <nou...@gm...> - 2016-02-29 13:29:46
|
I have created a standalone application using NettyJaxrsServer. In one scenario I want to get the IP of the request coming to the server. How do to do that.? I have the pom here with dependency <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-netty</artifactId> <version>3.0.10.Final</version></dependency> I have created the NettyJaxrsServer using the following code. public void createServer() { server = new NettyJaxrsServer(); server.setDeployment(getDeployment()); server.setPort(configuration.getPort()); server.setSecurityDomain(null); server.setRootResourcePath(configuration.getResourceRootPath()); } public ResteasyDeployment getDeployment() { final ResteasyDeployment dp = new ResteasyDeployment(); final Collection<Object> controllers = new ArrayList<Object>(); controllers.add(ctx.getBean(TestIP.class)); dp.getResources().addAll(controllers); return dp;} and my webservice class @Path("/test")@Componentpublic class TestIP { @GET @Path("/pingIp") @Produces(MediaType.APPLICATION_JSON) public String getAd( @Context HttpServletRequest servletRequest) { return servletRequest.getRemoteAddr(); } } while Encountering servletRequest.getRemoteAddr(); it throws the org.jboss.resteasy.spi.LoggableFailure Exception. Please some body healp me to find out what I am doing wrong here. Thanks in advance..! |
From: Savvas A. M. <sav...@gm...> - 2016-02-07 18:03:11
|
Hi Fausto, It doesn't look like there is a more straightforward solution to this than what you've some up with. What I'd have done however is make the TokenValidatorInterceptor a "non-managed" class (in whatever DI framework you are using) meaning a simple, plain class. Then I'd inject all its required dependencies into the DynamicFeature (since it's @Provider) and have that instantiate and register a TokenValidatorInterceptor. In that sense (and in GRASP parlance) the latter would act as a "creator" of the former. HTF, Savvas On 1 February 2016 at 17:03, Fausto Santos <fst...@gm...> wrote: > I'm converting an application from RestEasy 2 to 3. There is one > authorization interceptor that implements PreProcessInterceptor and > AcceptedByMethod interfaces. This interceptor is responsible for verifying > an encrypted token in the request, and then authorizing or not the > execution of a given method. There is also a @TokenValidationNotRequired > annotation, to avoid the validation of the token on some methods, including > the authentication method. > > So I changed the PreProcessInterceptor to a ContainerRequestFilter, and as > the AcceptByMethod interface is deprecated I decided to use the Name > Binding feature, then I would have to change the annotation to > @TokenValidationRequired and put it in all methods that need authorization > checking. This would result in a huge refactoring, and it's a bit insecure > because other developers may forget to use the annotation. It's better to > explicit annotate methods that doesn't need authorization checking, than > doing the opposite. > > So I implemented a DynamicFeature that verifies methods that doesn't have > the @TokenValidationNotRequired annotation and bind the > TokenValidationInterceptor to them, like this: > > context.register(TokenValidatorInterceptor.class); > > The problem is that if I leave the interceptor annotated with @Provider, > it becomes a global interceptor. If I remove it, the interceptor is > correctly binded, but the autowiring on it's properties doesn't happen. I > solved the problem by injecting the application context in the > DynamicFeature and then getting the interceptor from the context, like this: > > > context.register(applicationContext.getBean(TokenValidatorInterceptor.class)); > > Is there an easier, or more correct, way of doing this? Something like a > reverse name binding, that only binds the interceptor to methods that > doesn't have the specific annotation? > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users > > |
From: Shivam <shi...@hc...> - 2016-02-05 09:05:34
|
Nicolas Gavard <ng@...> writes: > > > > Hi all resteasy users, > I'm trying to upgrade resteasy in a JBoss EAP 6.1 with resteasy > 3.0.13.Final. > I followed the resteasy doc : http://docs.jboss.org/resteasy/docs/3.0.13.Final/userguide/html/Installa tion_Configuration.html#upgrading-eap61 > that seems thraightforward. > Nevertheless, i'm facing this following error at the very first web > service call. > 11:20:06,374 WARN ajp-localhost/127.0.0.1:8009-3(:) > [modules] - Failed to define class > org.jboss.resteasy.resteasy_jaxrs.i18n.LogMessages in Module > "org.jboss.resteasy.resteasy-jaxrs:main" from local module > loader <at> 40133da0 (finder: local module finder <at> 2f32f43d (roots: > D:\EnvDev\jboss-eap-6.1\modules,D:\EnvDev\jboss-eap- 6.1\modules\system\layers\base)): > > java.lang.LinkageError: Failed to link > org/jboss/resteasy/resteasy_jaxrs/i18n/LogMessages (Module > "org.jboss.resteasy.resteasy-jaxrs:main" from local module > loader <at> 40133da0 (finder: local module finder <at> 2f32f43d (roots: > D:\EnvDev\jboss-eap-6.1\modules,D:\EnvDev\jboss-eap- 6.1\modules\system\layers\base))) > at > org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:4 27) > [jboss-modules.jar:1.2.0.Final-redhat-1] > at > org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.jav a:260) > [jboss-modules.jar:1.2.0.Final-redhat-1] > at > org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.j ava:75) > [jboss-modules.jar:1.2.0.Final-redhat-1] > at org.jboss.modules.Module.loadModuleClass(Module.java:526) > [jboss-modules.jar:1.2.0.Final-redhat-1] > at > org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:188 ) > [jboss-modules.jar:1.2.0.Final-redhat-1] > at > org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(Concur rentClassLoader.java:444) > > [jboss-modules.jar:1.2.0.Final-redhat-1] > at > org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(Concurre ntClassLoader.java:432) > > [jboss-modules.jar:1.2.0.Final-redhat-1] > at > org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClass Loader.java:374) > > [jboss-modules.jar:1.2.0.Final-redhat-1] > at > org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader. java:119) > > [jboss-modules.jar:1.2.0.Final-redhat-1] > at > org.jboss.resteasy.plugins.providers.RegisterBuiltin.registerProviders(R egisterBuiltin.java:72) > at > org.jboss.resteasy.plugins.providers.RegisterBuiltin.register(RegisterBu iltin.java:29) > at > org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java: 221) > at > org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.ini t(ServletContainerDispatcher.java:113) > at > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(Htt pServletDispatcher.java:36) > [...] > Caused by: java.lang.NoClassDefFoundError: > org/jboss/logging/BasicLogger > at java.lang.ClassLoader.defineClass1(Native Method) > [rt.jar:1.7.0_79] > at java.lang.ClassLoader.defineClass(ClassLoader.java:800) > [rt.jar:1.7.0_79] > at > org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoade r.java:344) > > [jboss-modules.jar:1.2.0.Final-redhat-1] > at > org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:4 22) > [jboss-modules.jar:1.2.0.Final-redhat-1] > ... 27 more > Caused by: java.lang.ClassNotFoundException: > org.jboss.logging.BasicLogger from [Module > "org.jboss.resteasy.resteasy-jaxrs:main" from local module > loader <at> 40133da0 (finder: local module finder <at> 2f32f43d (roots: > D:\EnvDev\jboss-eap-6.1\modules,D:\EnvDev\jboss-eap- 6.1\modules\system\layers\base))] > at > org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196 ) > [jboss-modules.jar:1.2.0.Final-redhat-1] > at > org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(Concur rentClassLoader.java:444) > > [jboss-modules.jar:1.2.0.Final-redhat-1] > ... > ... 31 more > > > > I tried to add "org.jboss.logging" as a module dependency in the > modules.xml file in org.jboss.resteasy.resteasy-jaxrs:main > But, then, i'm facing another NoClassDefFoundError: > 11:43:53,060 WARN ajp-localhost/127.0.0.1:8009-2(:) > [i18n] - RESTEASY002145: NoClassDefFoundError: Unable to load > builtin provider: > org.jboss.resteasy.plugins.validation.hibernate.ValidatorContextResolver : > > java.lang.NoClassDefFoundError: javax/annotation/Priority > at > org.jboss.resteasy.spi.ResteasyProviderFactory.getPriority(ResteasyProvi derFactory.java:1371) > at > org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(Resteasy ProviderFactory.java:1636) > at > org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(Resteasy ProviderFactory.java:1344) > at > org.jboss.resteasy.plugins.providers.RegisterBuiltin.registerProviders(R egisterBuiltin.java:68) > at > org.jboss.resteasy.plugins.providers.RegisterBuiltin.register(RegisterBu iltin.java:29) > at > org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java: 221) > at > org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.ini t(ServletContainerDispatcher.java:113) > at > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(Htt pServletDispatcher.java:36) > at > org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav a:1194) > [...] > Caused by: java.lang.ClassNotFoundException: > javax.annotation.Priority from [Module > "org.jboss.resteasy.resteasy-jaxrs:main" from local module > loader <at> 40133da0 (finder: local module finder <at> 2f32f43d (roots: > D:\EnvDev\jboss-eap-6.1\modules,D:\EnvDev\jboss-eap- 6.1\modules\system\layers\base))] > at > org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196 ) > [jboss-modules.jar:1.2.0.Final-redhat-1] > at > org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(Concur rentClassLoader.java:444) > > [jboss-modules.jar:1.2.0.Final-redhat-1] > at > org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(Concurre ntClassLoader.java:432) > > [jboss-modules.jar:1.2.0.Final-redhat-1] > at > org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClass Loader.java:374) > > [jboss-modules.jar:1.2.0.Final-redhat-1] > at > org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader. java:119) > > [jboss-modules.jar:1.2.0.Final-redhat-1] > ... 22 more > > > I'm using a very simple jax Aplication that works fine with resteasy > provided by the jboss server > <at> ApplicationPath("/api") > public class JaxRestApplication extends Application { > } > > > > It does not seem the right way to fix my issue. > I did not find any clue or known issue about this. > Any help would be great,-- > Nicolas > > > ---------------------------------------------------------------------- -------- > > > ---------------------------------------------------------------------- -------- > I have also faced the same problem while upgrading resteasy to 3.0.13 from 2.3.2 Problem 1. For java.lang.LinkageError: Failed to link org/jboss/resteasy/resteasy_jaxrs/i18n/LogMessages Solution: Add "org.jboss.logging" as a module dependency in the modules.xml file in org.jboss.resteasy.resteasy-jaxrs:main Problem 2: NoClassDefFoundError: Unable to load builtin provider: org.jboss.resteasy.plugins.validation.hibernate.ValidatorContextResolver :java.lang.NoClassDefFoundError: javax/annotation/Priority Solution: Upgraded the jboss-annotations-api_1.2_spec-1.0.0.Final.jar from older jar. That resolved both of the problems. |
From: Fausto S. <fst...@gm...> - 2016-02-01 16:04:11
|
I'm converting an application from RestEasy 2 to 3. There is one authorization interceptor that implements PreProcessInterceptor and AcceptedByMethod interfaces. This interceptor is responsible for verifying an encrypted token in the request, and then authorizing or not the execution of a given method. There is also a @TokenValidationNotRequired annotation, to avoid the validation of the token on some methods, including the authentication method. So I changed the PreProcessInterceptor to a ContainerRequestFilter, and as the AcceptByMethod interface is deprecated I decided to use the Name Binding feature, then I would have to change the annotation to @TokenValidationRequired and put it in all methods that need authorization checking. This would result in a huge refactoring, and it's a bit insecure because other developers may forget to use the annotation. It's better to explicit annotate methods that doesn't need authorization checking, than doing the opposite. So I implemented a DynamicFeature that verifies methods that doesn't have the @TokenValidationNotRequired annotation and bind the TokenValidationInterceptor to them, like this: context.register(TokenValidatorInterceptor.class); The problem is that if I leave the interceptor annotated with @Provider, it becomes a global interceptor. If I remove it, the interceptor is correctly binded, but the autowiring on it's properties doesn't happen. I solved the problem by injecting the application context in the DynamicFeature and then getting the interceptor from the context, like this: context.register(applicationContext.getBean(TokenValidatorInterceptor.class)); Is there an easier, or more correct, way of doing this? Something like a reverse name binding, that only binds the interceptor to methods that doesn't have the specific annotation? |
From: Craig C. <cra...@gm...> - 2016-01-06 02:58:23
|
I’m trying to integrate Guice with Resteasy using reasteasy-netty4. I can see how to use the GuiceResourceFactory get use Guice for resources, however, how do I inject non-JAX-RS resources into resources? For instance, if I have an AuthenticationResource that uses an AuthenticationService, how do I do this? @Path(“/“) public class AuthenticationResource { @Inject public AuthenticationResource(AuthenticationService authService) { ... } } The problem is that if I add AuthenticationService to the guice module that I use in the GuiceResourceFactory, then Resteasy expects all bound classes to be resources. But I don’t see the equivalent of the GuiceResteasyBootstrapServletContextListener for non-servlet based Resteasy servers like netty. Can anyone help me? Thanks! |
From: Weinan Li <we...@re...> - 2015-12-23 08:47:09
|
Hi Ricardo, Could you please help to create a JIRA issue for this? -- Weinan Li / JBoss > On Dec 23, 2015, at 12:14 AM, Ricardo Veloso <ric...@fl...> wrote: > > When invoking entities with a variant with an encoding, and an IllegalStateException is thrown after a while because request headers reaches to is maximum. > > This is because setEntity on ClientInvocation adds the header to a map: > headers.header("Content-Encoding", v.getEncoding()); > > This should use a putSingle or a method headers.setEncoding should be created like setLanguage or setMediaType. > Cumprimentos / Best regards, > Ricardo Veloso > > > ------------------------------------------------------------------------------ > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users |
From: Ricardo V. <ric...@fl...> - 2015-12-22 16:41:40
|
When invoking entities with a variant with an encoding, and an IllegalStateException is thrown after a while because request headers reaches to is maximum. This is because setEntity on ClientInvocation adds the header to a map: headers.header("Content-Encoding", v.getEncoding()); This should use a putSingle or a method headers.setEncoding should be created like setLanguage or setMediaType. Cumprimentos / Best regards, Ricardo Veloso |
From: Nate D. <nd...@gm...> - 2015-12-16 13:58:54
|
Hi, We're experiencing a Stackoverflow error in our RESTEasy backend. We aren't sure why it is happening. Has anyone else seen this? The strange thing is that it seems to only for certain endpoint calls. Restarting the server seemed to fix it, but then a different end point started having this issue. We are using RESTEasy 3.0.12.Final running in JBoss 7.1.1.Final on Java 1.7.0_75. Thanks! Nate Here is a truncated stack trace it as it just repeats over and over with no other information: 2015-12-14 15:00:00,281 ERROR [org.apache.catalina.core.ContainerBase. [jboss.web].[default-host].[/].[com.fi.rest.RestService]] Servlet.service() for servlet com.fi.rest.RestService threw exception: java.lang.StackOverflowError at com.fasterxml.jackson.databind.introspect.AnnotationIntrospectorPair.isAnnotationBundle(AnnotationIntrospectorPair.ja va:89) [jackson-databind-2.4.1.jar:2.4.1] at com.fasterxml.jackson.databind.introspect.AnnotationIntrospectorPair.isAnnotationBundle(AnnotationIntrospectorPair.ja va:89) [jackson-databind-2.4.1.jar:2.4.1] .... |
From: Weinan Li <we...@re...> - 2015-11-08 03:20:38
|
Sorry for the delay John. Ron and I are working on Wildfly/EAP bug requests these days. Let us see whether we can find more time to review PRs asap. -- Weinan Li / JBoss > On Nov 7, 2015, at 8:39 PM, John D. Ament <joh...@gm...> wrote: > > All, > > I've noticed that no PRs have been merged in a while. Any plans to accept outside contributions? > > John > ------------------------------------------------------------------------------ > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users |
From: John D. A. <joh...@gm...> - 2015-11-07 12:39:45
|
All, I've noticed that no PRs have been merged in a while. Any plans to accept outside contributions? John |
From: John D. A. <joh...@gm...> - 2015-11-05 00:57:14
|
HI Dave, You have a context param which is disabling scanning <context-param> <param-name>resteasy.resources</param-name> <param-value> zedi.pacbridge.web.services.OutgoingRequests, zedi.pacbridge.web.services.Connections </param-value> </context-param> Please add your class here, or stop using the context param. On Wed, Nov 4, 2015 at 5:54 PM Dave Rathnow <Dav...@ze...> wrote: > I’m having a strange problem and hope someone can tell me what I’m doing > wrong. > > > > I have a Resteasy servlet configured and reachable at > http://myhost.com/srv and a couple of classes that look like this: > > > > @Path("/connections") > > public class Connections { > > @Inject > > private NetworkService networkService; > > > > @GET > > @Path("/") > > @Produces({MediaType.APPLICATION_JSON}) > > public Collection<ConnectionDTO> allConnections() { > > . . . > > return listOfConnectionsDtos; > > } > > } > > > > @Path("/outgoingrequests") > > public class OutgoingRequests { > > @Inject > > private OutgoingRequestCache cache; > > > > @GET > > @Path("/") > > @Produces({MediaType.APPLICATION_JSON}) > > public Collection<OutgoingRequestDTO> allRequests() { > > . . . > > return listOfOutgoingReuqestsDtos; > > } > > } > > > > These work fine and have been working for some time now. I access them > with http://myhost.com/srv/connections and > http://myhost.com/srv/outgoingrequests respectively. > > > > I recently tried to add a new service to my app that looks like this > > > > @Path("/devices") > > public class Devices { > > @Inject > > private DeviceCache cache; > > > > @GET > > @Path("/") > > @Produces({MediaType.APPLICATION_JSON}) > > public Collection<DeviceDTO> allDevices() { > > . . . > > return listOfDeviceDTO; > > } > > } > > > > However this one doesn’t work. When I try to access it with the url > http://myhost.com/srv/devices I get “HTTP Status: 404” returned. I've > tried creating a couple of other dummy service using this same pattern and > they are all coming back with a 404 error. I’ve turned on debug logging for > Resteasy categories and I’m seeing the following exception in my JBoss log > file: > > > > 15:33:10,001 DEBUG [org.jboss.resteasy.core.SynchronousDispatcher] () > PathInfo: /devices > > 15:33:10,002 DEBUG [org.jboss.resteasy.core.SynchronousDispatcher] () > Failed executing GET /devices: org.jboss.resteasy.spi.NotFoundException: > Could not find resource for relative : /devices of full path: > http://myhost.com/myapp/srv/devices > > at > org.jboss.resteasy.core.registry.RootSegment.matchChildren(RootSegment.java:360) > [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2] > > at > org.jboss.resteasy.core.registry.RootSegment.matchRoot(RootSegment.java:374) > [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2] > > at > org.jboss.resteasy.core.registry.RootSegment.matchRoot(RootSegment.java:367) > [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2] > > at > org.jboss.resteasy.core.ResourceMethodRegistry.getResourceInvoker(ResourceMethodRegistry.java:350) > [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2] > > at > org.jboss.resteasy.core.SynchronousDispatcher.getInvoker(SynchronousDispatcher.java:192) > [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2] > > at > org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:125) > [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2] > > at > org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) > [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2] > > at > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) > [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2] > > at > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) > [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2] > > < -- SNIP -- > > > > > My web.xml file looks like this: > > > > <context-param> > > <param-name>resteasy.resources</param-name> > > <param-value> > > zedi.pacbridge.web.services.OutgoingRequests, > > zedi.pacbridge.web.services.Connections > > </param-value> > > </context-param> > > > > <servlet> > > <servlet-name>Resteasy</servlet-name> > > > <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class> > > </servlet> > > > > <context-param> > > <param-name>resteasy.servlet.mapping.prefix</param-name> > > <param-value>/srv</param-value> > > </context-param> > > > > <servlet-mapping> > > <servlet-name>Resteasy</servlet-name> > > <url-pattern>/srv/*</url-pattern> > > </servlet-mapping> > > > > Can anyone tell me what might be happening here? What am I doing wrong??? > > > > Thanks, > > Dave. > > ------------------------------------------------------------------------------ > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users > |
From: Dave R. <Dav...@ze...> - 2015-11-04 22:53:11
|
I'm having a strange problem and hope someone can tell me what I'm doing wrong. I have a Resteasy servlet configured and reachable at http://myhost.com/srv and a couple of classes that look like this: @Path("/connections") public class Connections { @Inject private NetworkService networkService; @GET @Path("/") @Produces({MediaType.APPLICATION_JSON}) public Collection<ConnectionDTO> allConnections() { . . . return listOfConnectionsDtos; } } @Path("/outgoingrequests") public class OutgoingRequests { @Inject private OutgoingRequestCache cache; @GET @Path("/") @Produces({MediaType.APPLICATION_JSON}) public Collection<OutgoingRequestDTO> allRequests() { . . . return listOfOutgoingReuqestsDtos; } } These work fine and have been working for some time now. I access them with http://myhost.com/srv/connections and http://myhost.com/srv/outgoingrequests respectively. I recently tried to add a new service to my app that looks like this @Path("/devices") public class Devices { @Inject private DeviceCache cache; @GET @Path("/") @Produces({MediaType.APPLICATION_JSON}) public Collection<DeviceDTO> allDevices() { . . . return listOfDeviceDTO; } } However this one doesn't work. When I try to access it with the url http://myhost.com/srv/devices I get "HTTP Status: 404" returned. I've tried creating a couple of other dummy service using this same pattern and they are all coming back with a 404 error. I've turned on debug logging for Resteasy categories and I'm seeing the following exception in my JBoss log file: 15:33:10,001 DEBUG [org.jboss.resteasy.core.SynchronousDispatcher] () PathInfo: /devices 15:33:10,002 DEBUG [org.jboss.resteasy.core.SynchronousDispatcher] () Failed executing GET /devices: org.jboss.resteasy.spi.NotFoundException: Could not find resource for relative : /devices of full path: http://myhost.com/myapp/srv/devices at org.jboss.resteasy.core.registry.RootSegment.matchChildren(RootSegment.java:360) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2] at org.jboss.resteasy.core.registry.RootSegment.matchRoot(RootSegment.java:374) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2] at org.jboss.resteasy.core.registry.RootSegment.matchRoot(RootSegment.java:367) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2] at org.jboss.resteasy.core.ResourceMethodRegistry.getResourceInvoker(ResourceMethodRegistry.java:350) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2] at org.jboss.resteasy.core.SynchronousDispatcher.getInvoker(SynchronousDispatcher.java:192) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2] at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:125) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2] at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2] at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2] at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.7.Final-redhat-2.jar:2.3.7.Final-redhat-2] < -- SNIP -- > My web.xml file looks like this: <context-param> <param-name>resteasy.resources</param-name> <param-value> zedi.pacbridge.web.services.OutgoingRequests, zedi.pacbridge.web.services.Connections </param-value> </context-param> <servlet> <servlet-name>Resteasy</servlet-name> <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class> </servlet> <context-param> <param-name>resteasy.servlet.mapping.prefix</param-name> <param-value>/srv</param-value> </context-param> <servlet-mapping> <servlet-name>Resteasy</servlet-name> <url-pattern>/srv/*</url-pattern> </servlet-mapping> Can anyone tell me what might be happening here? What am I doing wrong??? Thanks, Dave. |
From: Nicolas G. <ng...@vi...> - 2015-11-03 10:35:04
|
Hi all resteasy users, I'm trying to upgrade resteasy in a JBoss EAP 6.1 with resteasy 3.0.13.Final. I followed the resteasy doc : http://docs.jboss.org/resteasy/docs/3.0.13.Final/userguide/html/Installation_Configuration.html#upgrading-eap61 that seems thraightforward. Nevertheless, i'm facing this following error at the very first web service call. 11:20:06,374 WARN ajp-localhost/127.0.0.1:8009-3(:) [modules] - Failed to define class org.jboss.resteasy.resteasy_jaxrs.i18n.LogMessages in Module "org.jboss.resteasy.resteasy-jaxrs:main" from local module loader @40133da0 (finder: local module finder @2f32f43d (roots: D:\EnvDev\jboss-eap-6.1\modules,D:\EnvDev\jboss-eap-6.1\modules\system\layers\base)): java.lang.LinkageError: Failed to link org/jboss/resteasy/resteasy_jaxrs/i18n/LogMessages (Module "org.jboss.resteasy.resteasy-jaxrs:main" from local module loader @40133da0 (finder: local module finder @2f32f43d (roots: D:\EnvDev\jboss-eap-6.1\modules,D:\EnvDev\jboss-eap-6.1\modules\system\layers\base))) at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:427) [jboss-modules.jar:1.2.0.Final-redhat-1] at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:260) [jboss-modules.jar:1.2.0.Final-redhat-1] at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:75) [jboss-modules.jar:1.2.0.Final-redhat-1] at org.jboss.modules.Module.loadModuleClass(Module.java:526) [jboss-modules.jar:1.2.0.Final-redhat-1] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:188) [jboss-modules.jar:1.2.0.Final-redhat-1] at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1] at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1] at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1] at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1] at org.jboss.resteasy.plugins.providers.RegisterBuiltin.registerProviders(RegisterBuiltin.java:72) at org.jboss.resteasy.plugins.providers.RegisterBuiltin.register(RegisterBuiltin.java:29) at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:221) at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:113) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36) [...] Caused by: java.lang.NoClassDefFoundError: org/jboss/logging/BasicLogger at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_79] at java.lang.ClassLoader.defineClass(ClassLoader.java:800) [rt.jar:1.7.0_79] at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:344) [jboss-modules.jar:1.2.0.Final-redhat-1] at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:422) [jboss-modules.jar:1.2.0.Final-redhat-1] ... 27 more Caused by: java.lang.ClassNotFoundException: org.jboss.logging.BasicLogger from [Module "org.jboss.resteasy.resteasy-jaxrs:main" from local module loader @40133da0 (finder: local module finder @2f32f43d (roots: D:\EnvDev\jboss-eap-6.1\modules,D:\EnvDev\jboss-eap-6.1\modules\system\layers\base))] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.0.Final-redhat-1] at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1] ... ... 31 more I tried to add "org.jboss.logging" as a module dependency in the modules.xml file in org.jboss.resteasy.resteasy-jaxrs:main But, then, i'm facing another NoClassDefFoundError: 11:43:53,060 WARN ajp-localhost/127.0.0.1:8009-2(:) [i18n] - RESTEASY002145: NoClassDefFoundError: Unable to load builtin provider: org.jboss.resteasy.plugins.validation.hibernate.ValidatorContextResolver: java.lang.NoClassDefFoundError: javax/annotation/Priority at org.jboss.resteasy.spi.ResteasyProviderFactory.getPriority(ResteasyProviderFactory.java:1371) at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1636) at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1344) at org.jboss.resteasy.plugins.providers.RegisterBuiltin.registerProviders(RegisterBuiltin.java:68) at org.jboss.resteasy.plugins.providers.RegisterBuiltin.register(RegisterBuiltin.java:29) at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:221) at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:113) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1194) [...] Caused by: java.lang.ClassNotFoundException: javax.annotation.Priority from [Module "org.jboss.resteasy.resteasy-jaxrs:main" from local module loader @40133da0 (finder: local module finder @2f32f43d (roots: D:\EnvDev\jboss-eap-6.1\modules,D:\EnvDev\jboss-eap-6.1\modules\system\layers\base))] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.0.Final-redhat-1] at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1] at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1] at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1] at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1] ... 22 more I'm using a very simple jax Aplication that works fine with resteasy provided by the jboss server @ApplicationPath("/api") public class JaxRestApplication extends Application { } It does not seem the right way to fix my issue. I did not find any clue or known issue about this. Any help would be great, -- Nicolas |
From: Sean D. <sea...@gm...> - 2015-11-02 16:06:59
|
I have to execute a separate task, which does not require notifying the client. The original thread needs to return so the client can continue however. On Sun, Nov 1, 2015 at 2:08 PM, Savvas Andreas Moysidis < sav...@gm...> wrote: > Hi Sean, > > I see..if I get this right however, not sure how you can have a pool of > threads that when done return a response to the calling client..don't you > need to somehow keep these connections open? (which would result in the > same client latency as with the AsyncResponse way) > > Perhaps websockets could come in handy here. > > Regards, > Savvas > > On 31 October 2015 at 20:42, Sean Dawson <sea...@gm...> wrote: > >> >> Thanks for the reply. I'd like the original call to return so the client >> can continue, but initiate processing a tangential action that takes some >> time. >> >> There are other ways to re-architect this better - but we need something >> fairly quick/simple for now. >> >> I'm considering putting in a thread pool watcher/executor for handling >> out-of-band requests. But if the extra thread is guaranteed to complete >> (which it has so far in testing), then that's unneeded currently. >> >> >> >> On Sat, Oct 31, 2015 at 2:00 PM, Savvas Andreas Moysidis < >> sav...@gm...> wrote: >> >>> Hi Sean, >>> >>> If your goal is to process a request in a separate thread other than the >>> handler thread then (assuming you are using a JAX-RS 2.0 implementation) >>> the AsyncResponse API is probably the safest way of achieving that. >>> >>> Have a look at: https://jersey.java.net/documentation/latest/async.html >>> >>> HTH, >>> Savvas >>> >>> >>> >>> >>> >>> On 29 October 2015 at 21:22, Sean Dawson <sea...@gm...> >>> wrote: >>> >>>> >>>> Hello, >>>> >>>> A general question if anyone here knows off-hand or could point me to >>>> an answer. Perhaps it depends on the http client or server or whatever >>>> but.... >>>> >>>> If I start a new Java thread in server code that handles a RestEasy >>>> call, does that new thread execute fully even if the original call has >>>> ended/returned? Or does it get canceled/interrupted/etc? >>>> >>>> Thank you. >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> >>>> _______________________________________________ >>>> Resteasy-users mailing list >>>> Res...@li... >>>> https://lists.sourceforge.net/lists/listinfo/resteasy-users >>>> >>>> >>> >> > |
From: Savvas A. M. <sav...@gm...> - 2015-11-01 19:08:32
|
Hi Sean, I see..if I get this right however, not sure how you can have a pool of threads that when done return a response to the calling client..don't you need to somehow keep these connections open? (which would result in the same client latency as with the AsyncResponse way) Perhaps websockets could come in handy here. Regards, Savvas On 31 October 2015 at 20:42, Sean Dawson <sea...@gm...> wrote: > > Thanks for the reply. I'd like the original call to return so the client > can continue, but initiate processing a tangential action that takes some > time. > > There are other ways to re-architect this better - but we need something > fairly quick/simple for now. > > I'm considering putting in a thread pool watcher/executor for handling > out-of-band requests. But if the extra thread is guaranteed to complete > (which it has so far in testing), then that's unneeded currently. > > > > On Sat, Oct 31, 2015 at 2:00 PM, Savvas Andreas Moysidis < > sav...@gm...> wrote: > >> Hi Sean, >> >> If your goal is to process a request in a separate thread other than the >> handler thread then (assuming you are using a JAX-RS 2.0 implementation) >> the AsyncResponse API is probably the safest way of achieving that. >> >> Have a look at: https://jersey.java.net/documentation/latest/async.html >> >> HTH, >> Savvas >> >> >> >> >> >> On 29 October 2015 at 21:22, Sean Dawson <sea...@gm...> >> wrote: >> >>> >>> Hello, >>> >>> A general question if anyone here knows off-hand or could point me to an >>> answer. Perhaps it depends on the http client or server or whatever but.... >>> >>> If I start a new Java thread in server code that handles a RestEasy >>> call, does that new thread execute fully even if the original call has >>> ended/returned? Or does it get canceled/interrupted/etc? >>> >>> Thank you. >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Resteasy-users mailing list >>> Res...@li... >>> https://lists.sourceforge.net/lists/listinfo/resteasy-users >>> >>> >> > |
From: Sean D. <sea...@gm...> - 2015-10-31 19:42:44
|
Thanks for the reply. I'd like the original call to return so the client can continue, but initiate processing a tangential action that takes some time. There are other ways to re-architect this better - but we need something fairly quick/simple for now. I'm considering putting in a thread pool watcher/executor for handling out-of-band requests. But if the extra thread is guaranteed to complete (which it has so far in testing), then that's unneeded currently. On Sat, Oct 31, 2015 at 2:00 PM, Savvas Andreas Moysidis < sav...@gm...> wrote: > Hi Sean, > > If your goal is to process a request in a separate thread other than the > handler thread then (assuming you are using a JAX-RS 2.0 implementation) > the AsyncResponse API is probably the safest way of achieving that. > > Have a look at: https://jersey.java.net/documentation/latest/async.html > > HTH, > Savvas > > > > > > On 29 October 2015 at 21:22, Sean Dawson <sea...@gm...> wrote: > >> >> Hello, >> >> A general question if anyone here knows off-hand or could point me to an >> answer. Perhaps it depends on the http client or server or whatever but.... >> >> If I start a new Java thread in server code that handles a RestEasy call, >> does that new thread execute fully even if the original call has >> ended/returned? Or does it get canceled/interrupted/etc? >> >> Thank you. >> >> >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> Resteasy-users mailing list >> Res...@li... >> https://lists.sourceforge.net/lists/listinfo/resteasy-users >> >> > |
From: Savvas A. M. <sav...@gm...> - 2015-10-31 18:00:49
|
Hi Sean, If your goal is to process a request in a separate thread other than the handler thread then (assuming you are using a JAX-RS 2.0 implementation) the AsyncResponse API is probably the safest way of achieving that. Have a look at: https://jersey.java.net/documentation/latest/async.html HTH, Savvas On 29 October 2015 at 21:22, Sean Dawson <sea...@gm...> wrote: > > Hello, > > A general question if anyone here knows off-hand or could point me to an > answer. Perhaps it depends on the http client or server or whatever but.... > > If I start a new Java thread in server code that handles a RestEasy call, > does that new thread execute fully even if the original call has > ended/returned? Or does it get canceled/interrupted/etc? > > Thank you. > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users > > |
From: Sean D. <sea...@gm...> - 2015-10-29 20:22:38
|
Hello, A general question if anyone here knows off-hand or could point me to an answer. Perhaps it depends on the http client or server or whatever but.... If I start a new Java thread in server code that handles a RestEasy call, does that new thread execute fully even if the original call has ended/returned? Or does it get canceled/interrupted/etc? Thank you. |
From: Rodrigo U. <rod...@gm...> - 2015-09-24 19:05:35
|
I had a similar question in the jersey mailing list. It seems the specification is open to interpretation. Someone even filled a Jira to this issue. http://jersey.576304.n2.nabble.com/Pool-for-javax-ws-rs-client-Client-objects-td7582806.html On Thu, Sep 17, 2015 at 12:53 PM, Ron Sigal <rs...@re...> wrote: > Hi Peter, > > Currently, Resteasy defaults to using > org.apache.http.impl.conn.BasicClientConnectionManager from the > HttpClient project, which allows only one connection at a time. You can > instruct Resteasy to use > org.apache.http.impl.conn.PoolingClientConnectionManager by calling > org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder.connectionPoolSize() > with a value greater than 0. When Bill says "The default behavior of the > RESTEasy JAX-RS implementation actually only lets you have one open > Response per Client instance", I'm pretty sure that he's referring to > the default use of BasicClientConnectionManager. > > With PoolingClientConnectionManager, you can do this: > > > ResteasyClient client = new > > ResteasyClientBuilder().connectionPoolSize(2).build(); > > Invocation.Builder request = > > client.target(TestPortProvider.generateURL("/test")).request(); > > Response response1 = request.get(); > > Response response2 = request.get(); > > response1.close(); > > response2.close(); > > client.close(); > > Note that BasicClientConnectionManager and > PoolingClientConnectionManager are deprecated in HttpClient 4.3. When we > finish https://issues.jboss.org/browse/RESTEASY-1200 "Resteasy uses > httpclient 4.2.6 which is not in sync with httpclient 4.3.6 used in > Wildfly" and upgrade to the new connection managers, this behavior might > change. We've been talking about defaulting to the new > PoolingHttpClientConnectionManager. > > -Ron > > On 07/14/2015 01:25 AM, Peter Luttrell wrote: > > We have a service within our webapp that connects to another RESTful > service using the JAX-RS Client API. We deploy to Wildfly 8.2, which is of > course uses RESTEasy. This service is a singleton and will receive many > concurrent requests. > > > > I'd like to know if I can safely re-use the 'javax.ws.rs.client.Client' > and 'javax.ws.rs.client.WebTarget' instances and just close each > 'javax.ws.rs.core.Response' for each request that our service makes? > > > > In other words I'd like to initialize my Client and WebTarget instances > once when my service starts up and only close the Client only our service > shuts down. For each of the concurrent requests that our service receives, > it will execute a new request and close the Response. > > > > In researching this online and such, I come across different answers and > I'd like to find out what's the correct one. > > > > In the book "RESTful Java with JAX-RS 2.0 (2nd edition)" by Burke, I see > the following relevant statements: > > > > 1. "The javax.ws.rs.client.Client interface is the main entry point into > the JAX-RS Client API. Client instances manage client socket connections > and are pretty heavyweight. Instances of this interface should be reused > wherever possible, as it can be quite expensive to create and destroy these > objects." > > > > 2. "WARNING: Always remember to close() your Client objects. Client > objects often pool connections for performance reasons. If you do not close > them, you are leaking valuable system resources. While most JAX-RS > implementations implement a finalize() method for Client, it is not a good > idea to rely on the garbage collector to clean up poorly written code." > > > > 3. "WARNING: Always remember to close() your Response objects. Response > objects reference open socket streams. If you do not close them, you are > leaking system resources. While most JAX-RS implementations implement a > finalize() method for Response, it is not a good idea to rely on the > garbage collector to clean up poorly written code. The default behavior of > the RESTEasy JAX-RS implementation actually only lets you have one open > Response per Client instance. This forces you to write responsible client > code." > > > > What's confusing here is that in quote 1, it's recommended that we reuse > the Client instance, but quote 3 ends by stating that RESTEasy only lets > you have one open Response per Client. When we have multiple concurrent > requests hitting our service, we'll need to have multiple JAX-RS Client > Request-Response cycles happen at once. Isn't this one of the use cases > where we should reuse the Client instance? > > > > I also see two conflicting response to the following StackOverflow post: > > http://stackoverflow.com/questions/24700798/is-jax-rs-client-thread-safe > > > > Also if I read the 2nd response to that StackOverflow post correctly, I > believe I should manually supply the ThreadSafeClientConnManager() for my > use case. Is that correct? > > > > Thanks, > > Peter Luttrell > > > ------------------------------------------------------------------------------ > > Don't Limit Your Business. Reach for the Cloud. > > GigeNET's Cloud Solutions provide you with the tools and support that > > you need to offload your IT needs and focus on growing your business. > > Configured For All Businesses. Start Your Cloud Today. > > https://www.gigenetcloud.com/ > > _______________________________________________ > > Resteasy-users mailing list > > Res...@li... > > https://lists.sourceforge.net/lists/listinfo/resteasy-users > > > > ------------------------------------------------------------------------------ > Monitor Your Dynamic Infrastructure at Any Scale With Datadog! > Get real-time metrics from all of your servers, apps and tools > in one place. > SourceForge users - Click here to start your Free Trial of Datadog now! > http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140 > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users > |
From: Ron S. <rs...@re...> - 2015-09-17 17:00:46
|
Hi Ari, Are you using Resteasy 3.x? If so, "resteasy.scan" is no longer supported. If you annotate your Application with @ApplicationPath, your WAR will be scanned automatically. See Section 3.4 "Configuring in JBoss AS 7, EAP, and Wildfly"(http://docs.jboss.org/resteasy/docs/3.0.9.Final/userguide/html_single/#javax.ws.rs.core.Application) in the Resteasy user guide. -Ron On 08/03/2015 02:00 PM, Ari King wrote: > Hi, > > I'm having a bit of trouble integrating swagger > <https://github.com/swagger-api/swagger-core> with my resteasy based > API and I believe the issue stems from the configuration, specifically > provider and resource identification. I'd appreciate help in sorting > out the issue. > > From what I understand from the swagger docs > <https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-RESTEasy-2.X-Project-Setup-1.5#automatic-scanning-and-registration>, > I need to do two things: > > 1. Set "resteasy.scan" to true, so swagger's providers and resources > will be automatically picked up. > <https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-RESTEasy-2.X-Project-Setup-1.5#automatic-scanning-and-registration> > > > Since I'm using Guice and an embedded undertow container, I created an > "javax.ws.rs.core.Application" subclass that returns empty sets for > both "classes" and "singletons" -- therefore resteasy should > automatically scan for providers and resources, correct? > > 2. Add "BeanConfig" to my "Application" subclass. > <https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-RESTEasy-2.X-Project-Setup-1.5#using-the-application-class> > > > (For completeness, I included this point as well, but I suspect the > issue with point #1) > > I included the following in the class constructor: > > BeanConfig beanConfig = new BeanConfig(); > beanConfig.setVersion("1.0"); > beanConfig.setHost("0.0.0.0:8080 <http://0.0.0.0:8080>"); > beanConfig.setBasePath("/docs"); > beanConfig.setTitle("API Docs"); > beanConfig.setPrettyPrint(true); > beanConfig.setResourcePackage("co.example.resources"); > beanConfig.setScan(true); > > >From the above the json and yaml docs should be at > http://127.0.0.1:8080/docs/swagger.[json|yaml] > <http://127.0.0.1:8080/docs/swagger.[json%7Cyaml]> but I currently get > javax.ws.rs.NotFoundException: Could not find resource for full path: > http://127.0.0.1:8080/docs/swagger.json > > Thanks. > > -Ari > > > > > > ------------------------------------------------------------------------------ > > > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users |
From: Ron S. <rs...@re...> - 2015-09-17 15:53:44
|
Hi Peter, Currently, Resteasy defaults to using org.apache.http.impl.conn.BasicClientConnectionManager from the HttpClient project, which allows only one connection at a time. You can instruct Resteasy to use org.apache.http.impl.conn.PoolingClientConnectionManager by calling org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder.connectionPoolSize() with a value greater than 0. When Bill says "The default behavior of the RESTEasy JAX-RS implementation actually only lets you have one open Response per Client instance", I'm pretty sure that he's referring to the default use of BasicClientConnectionManager. With PoolingClientConnectionManager, you can do this: > ResteasyClient client = new > ResteasyClientBuilder().connectionPoolSize(2).build(); > Invocation.Builder request = > client.target(TestPortProvider.generateURL("/test")).request(); > Response response1 = request.get(); > Response response2 = request.get(); > response1.close(); > response2.close(); > client.close(); Note that BasicClientConnectionManager and PoolingClientConnectionManager are deprecated in HttpClient 4.3. When we finish https://issues.jboss.org/browse/RESTEASY-1200 "Resteasy uses httpclient 4.2.6 which is not in sync with httpclient 4.3.6 used in Wildfly" and upgrade to the new connection managers, this behavior might change. We've been talking about defaulting to the new PoolingHttpClientConnectionManager. -Ron On 07/14/2015 01:25 AM, Peter Luttrell wrote: > We have a service within our webapp that connects to another RESTful service using the JAX-RS Client API. We deploy to Wildfly 8.2, which is of course uses RESTEasy. This service is a singleton and will receive many concurrent requests. > > I'd like to know if I can safely re-use the 'javax.ws.rs.client.Client' and 'javax.ws.rs.client.WebTarget' instances and just close each 'javax.ws.rs.core.Response' for each request that our service makes? > > In other words I'd like to initialize my Client and WebTarget instances once when my service starts up and only close the Client only our service shuts down. For each of the concurrent requests that our service receives, it will execute a new request and close the Response. > > In researching this online and such, I come across different answers and I'd like to find out what's the correct one. > > In the book "RESTful Java with JAX-RS 2.0 (2nd edition)" by Burke, I see the following relevant statements: > > 1. "The javax.ws.rs.client.Client interface is the main entry point into the JAX-RS Client API. Client instances manage client socket connections and are pretty heavyweight. Instances of this interface should be reused wherever possible, as it can be quite expensive to create and destroy these objects." > > 2. "WARNING: Always remember to close() your Client objects. Client objects often pool connections for performance reasons. If you do not close them, you are leaking valuable system resources. While most JAX-RS implementations implement a finalize() method for Client, it is not a good idea to rely on the garbage collector to clean up poorly written code." > > 3. "WARNING: Always remember to close() your Response objects. Response objects reference open socket streams. If you do not close them, you are leaking system resources. While most JAX-RS implementations implement a finalize() method for Response, it is not a good idea to rely on the garbage collector to clean up poorly written code. The default behavior of the RESTEasy JAX-RS implementation actually only lets you have one open Response per Client instance. This forces you to write responsible client code." > > What's confusing here is that in quote 1, it's recommended that we reuse the Client instance, but quote 3 ends by stating that RESTEasy only lets you have one open Response per Client. When we have multiple concurrent requests hitting our service, we'll need to have multiple JAX-RS Client Request-Response cycles happen at once. Isn't this one of the use cases where we should reuse the Client instance? > > I also see two conflicting response to the following StackOverflow post: > http://stackoverflow.com/questions/24700798/is-jax-rs-client-thread-safe > > Also if I read the 2nd response to that StackOverflow post correctly, I believe I should manually supply the ThreadSafeClientConnManager() for my use case. Is that correct? > > Thanks, > Peter Luttrell > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users |
From: Danilo C. M. <dco...@gm...> - 2015-09-04 00:39:15
|
Hello @Alexey and @Alberto, @Alexey I am very sorry that I didn't answer you any sooner. I had actually seen your e-mail a long time ago, but some projects have kept me quite busy (and I have never found a proper solution to our problem). @Alberto Great finding! Basically, I decided to forget about automatic Atom links injection because the feature didn't seem to be supported well enough. Furthermore, when I was keeping an eye on JEE 8 and the JSR-370 mailing lists, a few posts from Bill Burke (RESTEasy's lead developer) seemed to corroborate my impression that this feature simply got accepted into the codebase but doesn't receive any "official" attention at all. Therefore, it felt safer to abandon the whole thing altogether in my projects. These are the links to the pertinent messages from Bill Burke that I remember: https://java.net/projects/jax-rs-spec/lists/jsr370-experts/archive/2014-12/message/72 https://java.net/projects/jax-rs-spec/lists/jsr370-experts/archive/2014-12/message/88 Additionally, if any of you are interested in alternative approaches that use Jackson as a provider, I suggest you to check out Katharsis: http://katharsis.io/ The main problem is that its approach and support is limited to the JSON:API standard (http://jsonapi.org). If you want something simpler (based on HAL), these could prove to be somewhat interesting: https://github.com/RestExpress/HyperExpress http://www.gotohal.net/ I hope that at least some of this information can be useful to any of you. Respectfully yours, Danilo Cominotti Marques On Thu, Sep 3, 2015 at 8:15 PM, Alberto Saito <nob...@gm...> wrote: > Just found out the answer to this: > > We can't use jackson providers for this (as noted in the original > documentation), but jettison provider instead: > Thus, we need to disable all jackson providers from our environment. > > For example in WildFly 8.x: > > Create a META-INF/jboss-structure-deployment.xml file with the following: > > <jboss-deployment-structure> > <deployment> > <exclusions> > <module name="org.jboss.resteasy.resteasy-jackson-provider" /> > <module name="org.jboss.resteasy.resteasy-jackson2-provider" /> > </exclusions> > <dependencies> > <module name="org.jboss.resteasy.resteasy-jettison-provider" /> > </dependencies> > </deployment> > </jboss-deployment-structure> > > Hope this helps, > Alberto > > > > > ------------------------------------------------------------------------------ > Monitor Your Dynamic Infrastructure at Any Scale With Datadog! > Get real-time metrics from all of your servers, apps and tools > in one place. > SourceForge users - Click here to start your Free Trial of Datadog now! > http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140 > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users > |