cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Topping (JIRA)" <>
Subject [jira] [Commented] (CXF-4508) @Context fails to inject SearchContext into JAX-RS resource bean
Date Wed, 19 Sep 2012 09:26:07 GMT


Brian Topping commented on CXF-4508:

Hi Sergey, thanks for the quick response, I really appreciate it.  I should have mentioned
that I did try injecting with the method as well (for instance finding that the setter must
be named setSearchContext or the method is silently ignored) as the field.  Both code paths
eventually lead to org.apache.cxf.jaxrs.utils.InjectionUtils#createThreadLocalProxy.  

After failing last night with trying to use the bundle-all jar due to dependencies, I am going
to try seeing if I can inject directly with Blueprint, without the @Context annotation to
get a manual injection.  

I looked around for the blueprint demo but couldn't find it, is it in the source tree?  Will
probably be easiest for me to look for the namespace handler next as well to see what my options

Thanks again, and if I can do anything to assist or you have other paths for me to help you
with, please don't hesitate to reach out!  :-)  
> @Context fails to inject SearchContext into JAX-RS resource bean
> ----------------------------------------------------------------
>                 Key: CXF-4508
>                 URL:
>             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
>            Priority: Critical
> In an attempt to use the FIQL query parser functionality using the docs at,
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(
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> 	at java.lang.reflect.Method.invoke(
> 	at org.apache.aries.blueprint.utils.ReflectionUtils$MethodPropertyDescriptor.internalSet(
> 	at org.apache.aries.blueprint.utils.ReflectionUtils$PropertyDescriptor.set(
> 	at org.apache.aries.blueprint.container.BeanRecipe.setProperty(
> 	at org.apache.aries.blueprint.container.BeanRecipe.setProperties(
> 	at org.apache.aries.blueprint.container.BeanRecipe.setProperties(
> 	at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(
> 	at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(
> 	at org.apache.aries.blueprint.di.AbstractRecipe$
> 	at java.util.concurrent.FutureTask$Sync.innerRun(
> 	at
> 	at org.apache.aries.blueprint.di.AbstractRecipe.create(
> 	at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(
> 	at org.apache.aries.blueprint.container.BlueprintRepository.createAll(
> 	at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(
> 	at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(
> 	at
> 	at org.apache.aries.blueprint.container.BlueprintExtender.checkBundle(
> 	at org.apache.aries.blueprint.container.BlueprintExtender.bundleChanged(
> 	at org.apache.aries.blueprint.container.BlueprintExtender$BlueprintBundleTrackerCustomizer.modifiedBundle(
> 	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(
> 	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(
> 	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(
> 	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(
> 	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(
> 	at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(
> 	at org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(
> 	at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(
> 	at org.apache.felix.framework.Felix.fireBundleEvent(
> 	at org.apache.felix.framework.Felix.startBundle(
> 	at org.apache.felix.framework.BundleImpl.start(
> 	at org.apache.felix.framework.BundleImpl.start(
> 	at org.apache.karaf.bundle.command.Restart.doExecute(
> 	at org.apache.karaf.bundle.command.BundlesCommand.doExecute(
> 	at org.apache.karaf.bundle.command.BundlesCommandWithConfirmation.doExecute(
> 	at
> 	at
> 	at
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> 	at java.lang.reflect.Method.invoke(
> 	at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(
> 	at org.apache.aries.proxy.impl.ProxyHandler.invoke(
> 	at$BlueprintCommand2076750611.execute(Unknown
> 	at org.apache.felix.gogo.runtime.CommandProxy.execute(
> 	at org.apache.felix.gogo.runtime.Closure.executeCmd(
> 	at org.apache.felix.gogo.runtime.Closure.executeStatement(
> 	at
> 	at org.apache.felix.gogo.runtime.Closure.execute(
> 	at org.apache.felix.gogo.runtime.Closure.execute(
> 	at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(
> 	at
> 	at
> 	at$3.doRun(
> 	at$3$
> 	at Method)
> 	at
> 	at$
> Caused by: java.lang.IllegalArgumentException: interface
is not visible from class loader
> 	at java.lang.reflect.Proxy.getProxyClass(
> 	at java.lang.reflect.Proxy.newProxyInstance(
> 	at org.apache.cxf.jaxrs.utils.InjectionUtils.createThreadLocalProxy(
> 	at org.apache.cxf.jaxrs.model.AbstractResourceInfo.addContextMethod(
> 	at org.apache.cxf.jaxrs.model.AbstractResourceInfo.checkContextMethod(
> 	at org.apache.cxf.jaxrs.model.AbstractResourceInfo.findContextSetterMethods(
> 	at org.apache.cxf.jaxrs.model.AbstractResourceInfo.findContextSetterMethods(
> 	at org.apache.cxf.jaxrs.model.AbstractResourceInfo.<init>(
> 	at org.apache.cxf.jaxrs.model.ClassResourceInfo.<init>(
> 	at org.apache.cxf.jaxrs.utils.ResourceUtils.createClassResourceInfo(
> 	at org.apache.cxf.jaxrs.JAXRSServiceFactoryBean.setResourceClassesFromBeans(
> 	at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.setServiceBeans(
> 	... 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:

View raw message