cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-4508) @Context fails to inject SearchContext into JAX-RS resource bean
Date Fri, 21 Sep 2012 14:46:07 GMT

    [ https://issues.apache.org/jira/browse/CXF-4508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460531#comment-13460531
] 

Sergey Beryozkin commented on CXF-4508:
---------------------------------------

btw, for completeness, one more workaround for issue with injecting a thread-local SearchContext,
inject CXF MessageContext and then do context.getContext(SearchContext.class) - may be handy
if adding SearchContext parameter to the resource method affects the interface signature,
etc...
                
> @Context fails to inject SearchContext into JAX-RS resource bean
> ----------------------------------------------------------------
>
>                 Key: CXF-4508
>                 URL: https://issues.apache.org/jira/browse/CXF-4508
>             Project: CXF
>          Issue Type: Bug
>          Components: Core, JAX-RS
>    Affects Versions: 2.6.2
>         Environment: Mac OS 10.8.1 JDK 1.6.0_35
>            Reporter: Brian Topping
>            Assignee: Sergey Beryozkin
>            Priority: Critical
>             Fix For: 2.6.3, 2.7.0
>
>
> In an attempt to use the FIQL query parser functionality using the docs at http://cxf.apache.org/docs/jax-rs-advanced-features.html#JAX-RSAdvancedFeatures-FIQLsearchqueries,
it's clear there's a problem with the packaging such that the SearchContext cannot be injected
into a JAX-RS resource installed under Karaf.  The problem is with org.apache.cxf.jaxrs.utils.InjectionUtils#createThreadLocalProxy,
which returns the following exception:
> {code}
> java.lang.reflect.InvocationTargetException
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.apache.aries.blueprint.utils.ReflectionUtils$MethodPropertyDescriptor.internalSet(ReflectionUtils.java:568)
> 	at org.apache.aries.blueprint.utils.ReflectionUtils$PropertyDescriptor.set(ReflectionUtils.java:319)
> 	at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:935)
> 	at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:903)
> 	at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:884)
> 	at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:816)
> 	at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:783)
> 	at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)
> 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
> 	at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)
> 	at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)
> 	at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:183)
> 	at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:648)
> 	at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:340)
> 	at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:242)
> 	at org.apache.aries.blueprint.container.BlueprintExtender.checkBundle(BlueprintExtender.java:315)
> 	at org.apache.aries.blueprint.container.BlueprintExtender.bundleChanged(BlueprintExtender.java:235)
> 	at org.apache.aries.blueprint.container.BlueprintExtender$BlueprintBundleTrackerCustomizer.modifiedBundle(BlueprintExtender.java:434)
> 	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:198)
> 	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:128)
> 	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:468)
> 	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:161)
> 	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:117)
> 	at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1103)
> 	at org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:695)
> 	at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:483)
> 	at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4244)
> 	at org.apache.felix.framework.Felix.startBundle(Felix.java:1923)
> 	at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)
> 	at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931)
> 	at org.apache.karaf.bundle.command.Restart.doExecute(Restart.java:48)
> 	at org.apache.karaf.bundle.command.BundlesCommand.doExecute(BundlesCommand.java:50)
> 	at org.apache.karaf.bundle.command.BundlesCommandWithConfirmation.doExecute(BundlesCommandWithConfirmation.java:41)
> 	at org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)
> 	at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:39)
> 	at org.apache.karaf.shell.commands.basic.AbstractCommand.execute(AbstractCommand.java:33)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:54)
> 	at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:119)
> 	at org.apache.karaf.shell.console.commands.$BlueprintCommand2076750611.execute(Unknown
Source)
> 	at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)
> 	at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)
> 	at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)
> 	at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
> 	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
> 	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
> 	at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
> 	at org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:179)
> 	at java.lang.Thread.run(Thread.java:680)
> 	at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.doRun(ConsoleFactoryService.java:103)
> 	at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3$1.run(ConsoleFactoryService.java:94)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at javax.security.auth.Subject.doAs(Subject.java:337)
> 	at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.run(ConsoleFactoryService.java:92)
> Caused by: java.lang.IllegalArgumentException: interface org.apache.cxf.jaxrs.impl.tl.ThreadLocalProxy
is not visible from class loader
> 	at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)
> 	at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
> 	at org.apache.cxf.jaxrs.utils.InjectionUtils.createThreadLocalProxy(InjectionUtils.java:874)
> 	at org.apache.cxf.jaxrs.model.AbstractResourceInfo.addContextMethod(AbstractResourceInfo.java:163)
> 	at org.apache.cxf.jaxrs.model.AbstractResourceInfo.checkContextMethod(AbstractResourceInfo.java:146)
> 	at org.apache.cxf.jaxrs.model.AbstractResourceInfo.findContextSetterMethods(AbstractResourceInfo.java:132)
> 	at org.apache.cxf.jaxrs.model.AbstractResourceInfo.findContextSetterMethods(AbstractResourceInfo.java:139)
> 	at org.apache.cxf.jaxrs.model.AbstractResourceInfo.<init>(AbstractResourceInfo.java:65)
> 	at org.apache.cxf.jaxrs.model.ClassResourceInfo.<init>(ClassResourceInfo.java:80)
> 	at org.apache.cxf.jaxrs.utils.ResourceUtils.createClassResourceInfo(ResourceUtils.java:218)
> 	at org.apache.cxf.jaxrs.JAXRSServiceFactoryBean.setResourceClassesFromBeans(JAXRSServiceFactoryBean.java:232)
> 	at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.setServiceBeans(JAXRSServerFactoryBean.java:295)
> 	... 62 more
> {code}
> I'm trying to get this working with the cxf-bundle packaging but there's just too many
missing dependencies for this to be practical for the average user.  Will keep poking around
to see if I can figure out what the proper packaging is and provide a patch.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message