If I start the multi bundle distribution without any of my code, everything
starts up just fine. The moment I deploy a bundle with this activator, I
get the following exception:
public class Activator implements BundleActivator {
public void start(BundleContext context) throws Exception {
Dictionary props = new Hashtable();
props.put("service.exported.interfaces", MyRestService.class.getName());
props.put("service.exported.configs", "org.apache.cxf.rs");
props.put("org.apache.cxf.rs.httpservice.context", "/my");
context.registerService(MyRestService.class.getName(), new
MyRestService(), props);
}
public void stop(BundleContext context) throws Exception {}
}
INFO: Successfully registered CXF DOSGi servlet at /my
[pool-1-thread-4] INFO
org.apache.cxf.dosgi.dsw.handlers.JaxRSHttpServiceConfigurationTypeHandler -
Successfully registered CXF DOSGi servlet at /my
Exception in thread "pool-1-thread-4" java.lang.NoClassDefFoundError:
javax/ws/rs/WebApplicationException
at
org.apache.cxf.dosgi.dsw.handlers.JaxRSHttpServiceConfigurationTypeHandler.createServer(JaxRSHttpServiceConfigurationTypeHandler.java:76)
at
org.apache.cxf.dosgi.dsw.hooks.ServiceHookUtils.createServer(ServiceHookUtils.java:86)
at
org.apache.cxf.dosgi.dsw.hooks.CxfPublishHook.createServer(CxfPublishHook.java:106)
at
org.apache.cxf.dosgi.dsw.hooks.CxfPublishHook.publishEndpoint(CxfPublishHook.java:80)
at org.apache.cxf.dosgi.dsw.Activator$1.run(Activator.java:164)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:637)
Caused by: java.lang.ClassNotFoundException:
javax.ws.rs.WebApplicationException
at
org.apache.felix.framework.searchpolicy.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:618)
at
org.apache.felix.framework.searchpolicy.ModuleImpl.access$100(ModuleImpl.java:59)
at
org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1446)
at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:402)
... 8 more
Likewise, starting up the single bundle distribution without any of my code
is fine. However, when I try to start my simple bundle named
cxf-issue-0.1-SNAPSHOT.jar (containing the activator described above), I get
the following:
-> start file:/cxf-issue-0.1-SNAPSHOT.jar
...
WARNING: WARNING : Problem creating a remote endpoint for
org.opencastproject.cxfissue.MyRestService from CXF PublishHook, reason is
null
org.apache.cxf.service.factory.ServiceConstructionException
at
org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:112)
at
org.apache.cxf.dosgi.dsw.handlers.JaxRSHttpServiceConfigurationTypeHandler.createServer(JaxRSHttpServiceConfigurationTypeHandler.java:100)
at
org.apache.cxf.dosgi.dsw.hooks.ServiceHookUtils.createServer(ServiceHookUtils.java:86)
at
org.apache.cxf.dosgi.dsw.hooks.CxfPublishHook.createServer(CxfPublishHook.java:106)
at
org.apache.cxf.dosgi.dsw.hooks.CxfPublishHook.publishEndpoint(CxfPublishHook.java:80)
at org.apache.cxf.dosgi.dsw.Activator$1.run(Activator.java:164)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:637)
Caused by: javax.ws.rs.WebApplicationException
at
org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.checkResources(AbstractJAXRSFactoryBean.java:226)
at
org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:77)
... 8 more
Thanks for any ideas you can think of. I'll keep investigating.
Josh
On Tue, Sep 22, 2009 at 1:59 PM, Sergey Beryozkin <[email protected]>wrote:
> Also, does it with with both multii-bundle and single-bundle distributions
> ?
>
> thanks, Sergey
>
> ----- Original Message ----- From: "Sergey Beryozkin" <
> [email protected]>
> To: <[email protected]>
> Sent: Tuesday, September 22, 2009 12:32 PM
>
> Subject: Re: WebApplicationException not found by DOSGi
>
>
> Hi Josh
>>
>> CXF trunk has been updated to use a jax-rs 1.1 api but
>> cxf-dosgi-ri-dsw-cxf-1.1-SNAPSHOT depends on cxf 2.2.4.
>> So does it look like as if the real cause of the missing
>> WebApplicationException exception is that no WSPolicyFeatureBeanInfo can be
>> loaded ? It is strange...
>>
>> Is there any chance that you have other JAX-RS implementations loaded as
>> well ?
>>
>> thanks, Sergey
>>
>>
>>
>> ----- Original Message ----- From: "Josh Holtzman" <
>> [email protected]>
>> To: <[email protected]>
>> Sent: Tuesday, September 22, 2009 11:26 AM
>> Subject: Re: WebApplicationException not found by DOSGi
>>
>>
>> It looks like the classloader is not able to load
>>> org.apache.cxf.ws.policy.WSPolicyFeatureBeanInfo, in case that rings any
>>> bells.
>>>
>>> Josh
>>>
>>>
>>> On Tue, Sep 22, 2009 at 9:31 AM, Josh Holtzman <[email protected]
>>> >wrote:
>>>
>>> For some reason, cxf-dosgi-ri-dsw-cxf-1.1-SNAPSHOT.jar has stopped
>>>> starting
>>>> up. Has something changed in the last couple of days? FWIW, the JSR311
>>>> bundle is running:
>>>>
>>>> [ 40] [Active ] [ 2] Apache ServiceMix Specs :: JSR311 API 1.0
>>>> (1.3.0)
>>>>
>>>> Thanks,
>>>> Josh
>>>>
>>>> org.osgi.framework.BundleException: Activator start error in bundle
>>>> cxf-dosgi-ri-dsw-cxf [47].
>>>> at org.apache.felix.framework.Felix.startBundle(Felix.java:1506)
>>>> at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:779)
>>>> at
>>>>
>>>> org.apache.felix.shell.impl.StartCommandImpl.execute(StartCommandImpl.java:105)
>>>> at
>>>>
>>>> org.apache.felix.shell.impl.Activator$ShellServiceImpl.executeCommand(Activator.java:291)
>>>> at
>>>>
>>>> org.apache.felix.shell.tui.Activator$ShellTuiRunnable.run(Activator.java:177)
>>>> at java.lang.Thread.run(Thread.java:637)
>>>> Caused by: java.lang.NoClassDefFoundError:
>>>> javax/ws/rs/WebApplicationException
>>>> at
>>>>
>>>> org.apache.cxf.dosgi.dsw.handlers.JaxRSHttpServiceConfigurationTypeHandler.createServer(JaxRSHttpServiceConfigurationTypeHandler.java:76)
>>>> at
>>>>
>>>> org.apache.cxf.dosgi.dsw.hooks.ServiceHookUtils.createServer(ServiceHookUtils.java:86)
>>>> at
>>>>
>>>> org.apache.cxf.dosgi.dsw.hooks.CxfPublishHook.createServer(CxfPublishHook.java:106)
>>>> at
>>>>
>>>> org.apache.cxf.dosgi.dsw.hooks.CxfPublishHook.publishEndpoint(CxfPublishHook.java:80)
>>>> at
>>>>
>>>> org.apache.cxf.dosgi.dsw.Activator.checkExistingServices(Activator.java:151)
>>>> at org.apache.cxf.dosgi.dsw.Activator.start(Activator.java:81)
>>>> at
>>>>
>>>> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:589)
>>>> at org.apache.felix.framework.Felix.startBundle(Felix.java:1458)
>>>>
>>>>
>>>>
>>>
>>
>