Hi
On 08/07/14 14:49, Krzysztof Nowicki wrote:
Hi,
I believe I've fixed the issue, I was able to get ResourceInfo injected
and reporting the correct class and method name.
See the fix at [1], can you try it please ?
- Ok I will try inject ResourceInfo with your fix and send you results
Thanks
You mentioned ResourceInfo.getResource returning null, that can happen
in a PreMatch ContainerRequestFilter. What kind of filter do you use ?
- Yes you are right it was in PreMatch filter so no surprise that
ResourceInfo object was not created yet
and I got null nevertheless I
tried also in not PreMatch filter but than I got NPE during
ResourceInfo.getResourceMethod()
Can you post a stacktrace ? May be it is the case of Spring proxifying
something...
Cheers, Sergey
Thanks,
Kris
2014-07-08 14:14 GMT+02:00 Sergey Beryozkin <[email protected]
<mailto:[email protected]>>:
Hi,
I believe I've fixed the issue, I was able to get ResourceInfo
injected and reporting the correct class and method name.
See the fix at [1], can you try it please ?
You mentioned ResourceInfo.getResource returning null, that can
happen in a PreMatch ContainerRequestFilter. What kind of filter do
you use ?
Re RequestContext: not sure where NPE is coming from, perhaps it was
related to a ThreadLocalProxy issue, can you retry ? I was able to
use RequestContext to initialize a subresource (it is supposed to be
used with subresources only). I've found a minor issue with it (late
context value injection), something I will fix
Cheers, Sergey
[1] https://issues.apache.org/__jira/browse/CXF-5860
<https://issues.apache.org/jira/browse/CXF-5860>
On 08/07/14 10:49, Sergey Beryozkin wrote:
Hi
I've reproduced the issue and am looking into it
Cheers, Sergey
On 07/07/14 09:15, Krzysztof Nowicki wrote:
Hi,
That was also my first thought that package is not exported
but when I
checked it seems that export packages are correct:
Exported Packages org.apache.cxf.jaxrs,version=__3.0.0
org.apache.cxf.jaxrs.__blueprint,version=3.0.0
org.apache.cxf.jaxrs.ext,__version=3.0.0
org.apache.cxf.jaxrs.ext.__multipart,version=3.0.0
org.apache.cxf.jaxrs.ext.xml,__version=3.0.0
org.apache.cxf.jaxrs.impl,__version=3.0.0
org.apache.cxf.jaxrs.impl.tl
<http://org.apache.cxf.jaxrs.impl.tl>
<http://org.apache.cxf.jaxrs.__impl.tl
<http://org.apache.cxf.jaxrs.impl.tl>>,version=3.0.0
org.apache.cxf.jaxrs.__interceptor,version=3.0.0
org.apache.cxf.jaxrs.__lifecycle,version=3.0.0
org.apache.cxf.jaxrs.model,__version=3.0.0
org.apache.cxf.jaxrs.provider,__version=3.0.0
org.apache.cxf.jaxrs.security,__version=3.0.0
org.apache.cxf.jaxrs.servlet,__version=3.0.0
org.apache.cxf.jaxrs.spring,__version=3.0.0
org.apache.cxf.jaxrs.utils,__version=3.0.0
org.apache.cxf.jaxrs.utils.__multipart,version=3.0.0
org.apache.cxf.jaxrs.utils.__schemas,version=3.0.0
org.apache.cxf.jaxrs.__validation,version=3.0.0
Do you have any ideas what else I can try ?
Cheers,
Krzysztof Nowicki
2014-07-06 22:51 GMT+02:00 Sergey Beryozkin
<[email protected] <mailto:[email protected]>
<mailto:[email protected] <mailto:[email protected]>>>__:
Hi,
We have tests where ResourceInfo is injected.
The problem is that in OSGI it is not visible to it not
being
exported.
Rather than modifying the code, can you experiment with
updating the
Export-Package instruction in the pom.xml ?
Cheers, Sergey
On 05/07/14 11:05, Krzysztof Nowicki wrote:
Hi,
So I suppose that there is a bug in InjectionUtils
class, the
jsr339
classloader is used for new ThreadLocalProxy so
changed a
little bit
implementation:
ClassLoader classLoader =
ThreadLocalProxy.class.____isAssignableFrom(type)
? type
.getClassLoader() :
ThreadLocalProxy.class.____getClassLoader();
return (ThreadLocalProxy<T>) Proxy
.newProxyInstance(classLoader, new
Class[]{type,
ThreadLocalProxy.class},
new
ThreadLocalInvocationHandler<____T>());
After this I was able to inject ResourceInfo or
ResourceContext
classes,
but overall it didn't resolve my problem which is
determine
target
Method in filter.
ResourceInfo after injection was null.
Also tried this:
JAXRSUtils.getCurrentMessage()____.getExchange().get(____OperationResourceInfo.class)
but it's also null.
When I tried to use ResourceContext then in runtime
I got:
java.lang.NullPointerException
at
org.apache.cxf.jaxrs.impl.____ResourceContextImpl.<init>(____ResourceContextImpl.java:36)[____90:org.apache.cxf.cxf-rt-____frontend-jaxrs:3.0.0]
at
org.apache.cxf.jaxrs.utils.____JAXRSUtils.createContextValue(____JAXRSUtils.java:1076)[90:__org.__apache.cxf.cxf-rt-__frontend-__jaxrs:3.0.0]
at
org.apache.cxf.jaxrs.utils.____InjectionUtils.____injectContextFields(____InjectionUtils.java:977)[90:____org.apache.cxf.cxf-rt-____frontend-jaxrs:3.0.0]
at
org.apache.cxf.jaxrs.utils.____InjectionUtils.injectContexts(____InjectionUtils.java:946)[90:____org.apache.cxf.cxf-rt-____frontend-jaxrs:3.0.0]
at
org.apache.cxf.jaxrs.utils.____JAXRSUtils.____runContainerRequestFilters(____JAXRSUtils.java:1626)[90:org.____apache.cxf.cxf-rt-frontend-____jaxrs:3.0.0]
at
org.apache.cxf.jaxrs.____interceptor.____JAXRSInInterceptor.____processRequest(____JAXRSInInterceptor.java:104)[____90:org.apache.cxf.cxf-rt-____frontend-jaxrs:3.0.0]
at
org.apache.cxf.jaxrs.____interceptor.____JAXRSInInterceptor.____handleMessage(____JAXRSInInterceptor.java:76)[____90:org.apache.cxf.cxf-rt-____frontend-jaxrs:3.0.0]
at
org.apache.cxf.phase.____PhaseInterceptorChain.____doIntercept(____PhaseInterceptorChain.java:____307)[91:org.apache.cxf.cxf-____core:3.0.0]
at
org.apache.cxf.transport.____ChainInitiationObserver.____onMessage(____ChainInitiationObserver.java:____121)[91:org.apache.cxf.cxf-____core:3.0.0]
at
org.apache.cxf.transport.http.____AbstractHTTPDestination.____invoke(____AbstractHTTPDestination.java:____243)[96:org.apache.cxf.cxf-__rt-__transports-http:3.0.0]
at
org.apache.cxf.transport.____servlet.ServletController.____invokeDestination(____ServletController.java:223)[____96:org.apache.cxf.cxf-rt-____transports-http:3.0.0]
at
org.apache.cxf.transport.____servlet.ServletController.____invoke(ServletController.java:____197)[96:org.apache.cxf.cxf-__rt-__transports-http:3.0.0]
at
org.apache.cxf.transport.____servlet.ServletController.____invoke(ServletController.java:____149)[96:org.apache.cxf.cxf-__rt-__transports-http:3.0.0]
at
org.apache.cxf.transport.____servlet.CXFNonSpringServlet.____invoke(CXFNonSpringServlet.____java:171)[96:org.apache.cxf.____cxf-rt-transports-http:3.0.0]
at
org.apache.cxf.transport.____servlet.AbstractHTTPServlet.____handleRequest(____AbstractHTTPServlet.java:286)[____96:org.apache.cxf.cxf-rt-____transports-http:3.0.0]
at
org.apache.cxf.transport.____servlet.AbstractHTTPServlet.____doGet(AbstractHTTPServlet.____java:211)[96:org.apache.cxf.____cxf-rt-transports-http:3.0.0]
at
javax.servlet.http.____HttpServlet.service(____HttpServlet.java:575)[102:org.____apache.geronimo.specs.____geronimo-servlet_3.0_spec:1.0]
at
org.apache.cxf.transport.____servlet.AbstractHTTPServlet.____service(AbstractHTTPServlet.____java:262)[96:org.apache.cxf.____cxf-rt-transports-http:3.0.0]
at
org.eclipse.jetty.servlet.____ServletHolder.handle(____ServletHolder.java:684)[222:____org.eclipse.jetty.aggregate.____jetty-all-server:8.1.14.____v20131031]
at
org.eclipse.jetty.servlet.____ServletHandler.doHandle(____ServletHandler.java:501)[222:____org.eclipse.jetty.aggregate.____jetty-all-server:8.1.14.____v20131031]
at
org.ops4j.pax.web.service.____jetty.internal.____HttpServiceServletHandler.____doHandle(____HttpServiceServletHandler.____java:69)[232:org.ops4j.pax.____web.pax-web-jetty:3.1.0]
at
org.eclipse.jetty.server.____handler.ScopedHandler.handle(____ScopedHandler.java:137)[222:____org.eclipse.jetty.aggregate.____jetty-all-server:8.1.14.____v20131031]
at
org.eclipse.jetty.security.____SecurityHandler.handle(____SecurityHandler.java:557)[222:____org.eclipse.jetty.aggregate.____jetty-all-server:8.1.14.____v20131031]
at
org.eclipse.jetty.server.____session.SessionHandler.____doHandle(SessionHandler.java:____231)[222:org.eclipse.jetty.____aggregate.jetty-all-server:8.____1.14.v20131031]
at
org.eclipse.jetty.server.____handler.ContextHandler.____doHandle(ContextHandler.java:____1086)[222:org.eclipse.jetty.____aggregate.jetty-all-server:8.____1.14.v20131031]
at
org.ops4j.pax.web.service.____jetty.internal.____HttpServiceContext.doHandle(____HttpServiceContext.java:240)[____232:org.ops4j.pax.web.pax-__web-__jetty:3.1.0]
at
org.eclipse.jetty.servlet.____ServletHandler.doScope(____ServletHandler.java:428)[222:____org.eclipse.jetty.aggregate.____jetty-all-server:8.1.14.____v20131031]
at
org.eclipse.jetty.server.____session.SessionHandler.____doScope(SessionHandler.java:____193)[222:org.eclipse.jetty.____aggregate.jetty-all-server:8.____1.14.v20131031]
at
org.eclipse.jetty.server.____handler.ContextHandler.____doScope(ContextHandler.java:____1020)[222:org.eclipse.jetty.____aggregate.jetty-all-server:8.____1.14.v20131031]
at
org.eclipse.jetty.server.____handler.ScopedHandler.handle(____ScopedHandler.java:135)[222:____org.eclipse.jetty.aggregate.____jetty-all-server:8.1.14.____v20131031]
at
org.ops4j.pax.web.service.____jetty.internal.____JettyServerHandlerCollection.____handle(____JettyServerHandlerCollection.____java:77)[232:org.ops4j.pax.____web.pax-web-jetty:3.1.0]
at
org.eclipse.jetty.server.____handler.HandlerWrapper.handle(____HandlerWrapper.java:116)[__222:__org.eclipse.jetty.__aggregate.__jetty-all-server:__8.1.14.__v20131031]
at
org.eclipse.jetty.server.____Server.handle(Server.java:370)____[222:org.eclipse.jetty.____aggregate.jetty-all-server:8.____1.14.v20131031]
at
org.eclipse.jetty.server.____AbstractHttpConnection.____handleRequest(____AbstractHttpConnection.java:____494)[222:org.eclipse.jetty.____aggregate.jetty-all-server:8.____1.14.v20131031]
at
org.eclipse.jetty.server.____AbstractHttpConnection.____headerComplete(____AbstractHttpConnection.java:____971)[222:org.eclipse.jetty.____aggregate.jetty-all-server:8.____1.14.v20131031]
at
org.eclipse.jetty.server.____AbstractHttpConnection$____RequestHandler.headerComplete(____AbstractHttpConnection.java:____1033)[222:org.eclipse.jetty.____aggregate.jetty-all-server:__8.__1.14.v20131031]
at
org.eclipse.jetty.http.____HttpParser.parseNext(____HttpParser.java:644)[222:org.____eclipse.jetty.aggregate.__jetty-__all-server:8.1.14.__v20131031]
at
org.eclipse.jetty.http.____HttpParser.parseAvailable(____HttpParser.java:235)[222:org.____eclipse.jetty.aggregate.__jetty-__all-server:8.1.14.__v20131031]
at
org.eclipse.jetty.server.____AsyncHttpConnection.handle(____AsyncHttpConnection.java:82)[____222:org.eclipse.jetty.____aggregate.jetty-all-server:8.____1.14.v20131031]
at
org.eclipse.jetty.io.nio.____SelectChannelEndPoint.handle(____SelectChannelEndPoint.java:____667)[222:org.eclipse.jetty.____aggregate.jetty-all-server:8.____1.14.v20131031]
at
org.eclipse.jetty.io.nio.____SelectChannelEndPoint$1.run(____SelectChannelEndPoint.java:52)____[222:org.eclipse.jetty.____aggregate.jetty-all-server:8.____1.14.v20131031]
at
org.eclipse.jetty.util.thread.____QueuedThreadPool.runJob(____QueuedThreadPool.java:608)[____222:org.eclipse.jetty.____aggregate.jetty-all-server:8.____1.14.v20131031]
at
org.eclipse.jetty.util.thread.____QueuedThreadPool$3.run(____QueuedThreadPool.java:543)[____222:org.eclipse.jetty.____aggregate.jetty-all-server:8.____1.14.v20131031]
at java.lang.Thread.run(Thread.____java:722)[:1.7.0_06]
2014-07-04 15:27:08,326 | WARN | tp1790679978-170 |
PhaseInterceptorChain | 91 -
org.apache.cxf.cxf-core
- 3.0.0
| Exception in handleFault on interceptor
org.apache.cxf.jaxrs.____interceptor.____JAXRSDefaultFaultOutIntercepto____r@5e64b67
org.apache.cxf.interceptor.____Fault
at
org.apache.cxf.interceptor.____AbstractFaultChainInitiatorObs____erver.onMessage(____AbstractFaultChainInitiatorObs____erver.java:76)[91:org.__apache.__cxf.cxf-core:3.0.0]
at
org.apache.cxf.phase.____PhaseInterceptorChain.____doIntercept(____PhaseInterceptorChain.java:____371)[91:org.apache.cxf.cxf-____core:3.0.0]
at
org.apache.cxf.transport.____ChainInitiationObserver.____onMessage(____ChainInitiationObserver.java:____121)[91:org.apache.cxf.cxf-____core:3.0.0]
at
org.apache.cxf.transport.http.____AbstractHTTPDestination.____invoke(____AbstractHTTPDestination.java:____243)[96:org.apache.cxf.cxf-__rt-__transports-http:3.0.0]
at
org.apache.cxf.transport.____servlet.ServletController.____invokeDestination(____ServletController.java:223)[____96:org.apache.cxf.cxf-rt-____transports-http:3.0.0]
at
org.apache.cxf.transport.____servlet.ServletController.____invoke(ServletController.java:____197)[96:org.apache.cxf.cxf-__rt-__transports-http:3.0.0]
at
org.apache.cxf.transport.____servlet.ServletController.____invoke(ServletController.java:____149)[96:org.apache.cxf.cxf-__rt-__transports-http:3.0.0]
at
org.apache.cxf.transport.____servlet.CXFNonSpringServlet.____invoke(CXFNonSpringServlet.____java..
Thanks,
Krzysztof Nowicki
2014-07-04 16:42 GMT+02:00 Sergey Beryozkin
<[email protected] <mailto:[email protected]>
<mailto:[email protected] <mailto:[email protected]>>
<mailto:[email protected]
<mailto:[email protected]> <mailto:[email protected]
<mailto:[email protected]>>>__>__:
Hi
So the problem is here:
> Caused by:
java.lang.______IllegalArgumentException:
interface
> org.apache.cxf.jaxrs.impl.tl
<http://org.apache.cxf.jaxrs.impl.tl>
<http://org.apache.cxf.jaxrs.__impl.tl
<http://org.apache.cxf.jaxrs.impl.tl>>
<http://org.apache.cxf.jaxrs.____impl.tl
<http://impl.tl>
<http://org.apache.cxf.jaxrs.__impl.tl
<http://org.apache.cxf.jaxrs.impl.tl>>>.__ThreadLocalProxy
is not
visible from class
> loader
> at
java.lang.reflect.Proxy.______getProxyClass(Proxy.java:373)
> at
java.lang.reflect.Proxy.______newProxyInstance(Proxy.java:______601)
and we have SpringDM.
The JAX-RS frontend pom exports
'org.apache.cxf.jaxrs*'
So I'm not sure why
org.apache.cxf.jaxrs.impl.tl
<http://org.apache.cxf.jaxrs.impl.tl>
<http://org.apache.cxf.jaxrs.__impl.tl
<http://org.apache.cxf.jaxrs.impl.tl>>
<http://org.apache.cxf.jaxrs.____impl.tl
<http://impl.tl>
<http://org.apache.cxf.jaxrs.__impl.tl
<http://org.apache.cxf.jaxrs.impl.tl>>>.__ThreadLocalProxy
would not
be visible :-)
Dan, do you have an idea why it might be the
case ?
Thanks, Sergey
On 04/07/14 13:15, Krzysztof Nowicki wrote:
Hi,
Can you help me with following issue, it
occurs when
I'm trying
inject
ResourceInfo into filter:
Exception in thread
"SpringOsgiExtenderThread-116"
org.springframework.beans.______factory.BeanCreationException:
Error
creating
bean with name 'oAuthServer': Invocation
of init method
failed;
nested
exception is
org.apache.cxf.service.______factory.______ServiceConstructionException
at
org.springframework.beans.______factory.support.______AbstractAutowireCapableBeanFac______tory.initializeBean(______AbstractAutowireCapableBeanFac______tory.java:1482)
at
org.springframework.beans.______factory.support.______AbstractAutowireCapableBeanFac______tory.doCreateBean(______AbstractAutowireCapableBeanFac______tory.java:521)
at
org.springframework.beans.______factory.support.______AbstractAutowireCapableBeanFac______tory.createBean(______AbstractAutowireCapableBeanFac______tory.java:458)
at
org.springframework.beans.______factory.support.______AbstractBeanFactory$1.______getObject(AbstractBeanFactory.______java:295)
at
org.springframework.beans.______factory.support.______DefaultSingletonBeanRegistry.______getSingleton(______DefaultSingletonBeanRegistry.______java:223)
at
org.springframework.beans.______factory.support.______AbstractBeanFactory.doGetBean(______AbstractBeanFactory.java:____292)
at
org.springframework.beans.______factory.support.______AbstractBeanFactory.getBean(______AbstractBeanFactory.java:__194)
at
org.springframework.beans.______factory.support.______DefaultListableBeanFactory.______preInstantiateSingletons(______DefaultListableBeanFactory.______java:628)
at
org.springframework.context.______support.______AbstractApplicationContext.________finishBeanFactoryInitializatio______n(____AbstractApplicationContext.______java:932)
at
org.springframework.osgi.______context.support.______AbstractDelegatedExecutionAppl______icationContext.access$__1600(________AbstractDelegatedExecutionAppl______icationContext.java:69)
at
org.springframework.osgi.______context.support.______AbstractDelegatedExecutionAppl______icationContext$4.run(______AbstractDelegatedExecutionAppl______icationContext.java:355)
at
org.springframework.osgi.util.______internal.PrivilegedUtils.______executeWithCustomTCCL(______PrivilegedUtils.java:85)
at
org.springframework.osgi.______context.support.______AbstractDelegatedExecutionAppl______icationContext.______completeRefresh(______AbstractDelegatedExecutionAppl______icationContext.java:320)
at
org.springframework.osgi.______extender.internal.______dependencies.startup.______DependencyWaiterApplicationCon______textExecutor$______CompleteRefreshTask.run(______DependencyWaiterApplicationCon______textExecutor.java:132)
at
java.lang.Thread.run(Thread.______java:722)
Caused by:
org.apache.cxf.service.______factory.______ServiceConstructionException
at
org.apache.cxf.jaxrs.______JAXRSServerFactoryBean.create(______JAXRSServerFactoryBean.__java:____210)
at
sun.reflect.______NativeMethodAccessorImpl.______invoke0(Native
Method)
at
sun.reflect.______NativeMethodAccessorImpl.______invoke(______NativeMethodAccessorImpl.java:______57)
at
sun.reflect.______DelegatingMethodAccessorImpl.______invoke(______DelegatingMethodAccessorImpl.______java:43)
at
java.lang.reflect.Method.______invoke(Method.java:601)
at
org.springframework.beans.______factory.support.______AbstractAutowireCapableBeanFac______tory.__invokeCustomInitMethod(________AbstractAutowireCapableBeanFac______tory.java:1608)
at
org.springframework.beans.______factory.support.______AbstractAutowireCapableBeanFac______tory.invokeInitMethods(________AbstractAutowireCapableBeanFac______tory.java:1549)
at
org.springframework.beans.______factory.support.______AbstractAutowireCapableBeanFac______tory.initializeBean(______AbstractAutowireCapableBeanFac______tory.java:1479)
... 14 more
Caused by:
java.lang.______IllegalArgumentException:
interface
org.apache.cxf.jaxrs.impl.tl
<http://org.apache.cxf.jaxrs.impl.tl>
<http://org.apache.cxf.jaxrs.__impl.tl
<http://org.apache.cxf.jaxrs.impl.tl>>
<http://org.apache.cxf.jaxrs.____impl.tl
<http://impl.tl>
<http://org.apache.cxf.jaxrs.__impl.tl
<http://org.apache.cxf.jaxrs.impl.tl>>>.__ThreadLocalProxy
is not
visible from class
loader
at
java.lang.reflect.Proxy.______getProxyClass(Proxy.java:373)
at
java.lang.reflect.Proxy.______newProxyInstance(Proxy.java:______601)
at
org.apache.cxf.jaxrs.utils.______InjectionUtils.______createThreadLocalProxy(______InjectionUtils.java:975)
at
org.apache.cxf.jaxrs.model.______AbstractResourceInfo.______getFieldThreadLocalProxy(______AbstractResourceInfo.java:142)
at
org.apache.cxf.jaxrs.model.______AbstractResourceInfo.______findContextFields(______AbstractResourceInfo.java:124)
at
org.apache.cxf.jaxrs.model.______AbstractResourceInfo.______findContexts(______AbstractResourceInfo.java:82)
at
org.apache.cxf.jaxrs.model.______AbstractResourceInfo.<init>(______AbstractResourceInfo.java:__76)
at
org.apache.cxf.jaxrs.model.______ProviderInfo.<init>(______ProviderInfo.java:38)
at
org.apache.cxf.jaxrs.model.______ProviderInfo.<init>(______ProviderInfo.java:32)
at
org.apache.cxf.jaxrs.provider.______ProviderFactory.______prepareProviders(______ProviderFactory.java:1242)
at
org.apache.cxf.jaxrs.provider.______ServerProviderFactory.______setProviders(______ServerProviderFactory.java:______216)
at
org.apache.cxf.jaxrs.provider.______ProviderFactory.______setUserProviders(______ProviderFactory.java:766)
at
org.apache.cxf.jaxrs.______AbstractJAXRSFactoryBean.______setupFactory(______AbstractJAXRSFactoryBean.java:______322)
at
org.apache.cxf.jaxrs.______JAXRSServerFactoryBean.______setupFactory(______JAXRSServerFactoryBean.java:______228)
at
org.apache.cxf.jaxrs.______JAXRSServerFactoryBean.create(______JAXRSServerFactoryBean.__java:____173)
... 21 more
Thanks,
Krzysztof Nowicki
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com