You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2012/12/17 11:44:14 UTC

[jira] [Commented] (CXF-4704) Class loading problem using CXFNonSpringJaxrsServlet in OSGi environment

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

Sergey Beryozkin commented on CXF-4704:
---------------------------------------

You probably need to extend it, as done here for example:

http://svn.apache.org/repos/asf/cxf/trunk/distribution/src/main/release/samples/jax_rs/minimal_osgi/src/main/java/minimalosgi/SampleServlet.java

or

use you bundle Activator to register it directly with OSGI HttpService.

> It would be good, to set an explicit classloader for the servlet.

Do you mean adding "setClassLoader" setter to it so that the servlet can use this loader instead of delegating to ClassLoaderUtils ?








                
> Class loading problem using CXFNonSpringJaxrsServlet in OSGi environment
> ------------------------------------------------------------------------
>
>                 Key: CXF-4704
>                 URL: https://issues.apache.org/jira/browse/CXF-4704
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.6.2
>         Environment: Apache Felix
>            Reporter: Valdas Jasaitis
>
> The JAX-RS proxy classes are not loaded when I try to use CXFNonSpringJaxrsServlet in Apache Felix. I get ClassNotFoundException.
> The problem is that currently CXFNonSpringJaxrsServlet.loadClass always uses the ClassLoadUtils.loadClass which tries the following class loaders:
> ThreadContextClassloader,
> ClassLoader from CXFNonSpringJaxrsServlet,
> Classloader from ClassLoaderUtils.
> All of them are not compatible with OSGi. It would be good, to set an explicit classloader for the servlet.

--
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