[
https://issues.apache.org/jira/browse/OLINGO-41?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13805082#comment-13805082
]
Stephan Klevenz commented on OLINGO-41:
---------------------------------------
Will this be a solution for OSGi?
Implement a servlet filter which attaches the classloader of the web
application to the request object. The OData lib then can use it to load the
applications factory class.
The package "org.apache.olingo.odata2.core.rest" is not exposed by purpose and
that is because of to keep dependencies to implementation module at minimum.
Are there reasons against this solution?
public class ServiceFactoryFilter implements Filter {
@Override
public void init(FilterConfig filterConfig) throws ServletException {
}
@Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
request.setAttribute(ODataServiceFactory.FACTORY_CLASSLOADER_LABEL,
MyServiceFactory.class.getClassLoader());
chain.doFilter(request, response);
}
@Override
public void destroy() {
}
}
> Export-Package header incorrect in olingo-odata2-core
> -----------------------------------------------------
>
> Key: OLINGO-41
> URL: https://issues.apache.org/jira/browse/OLINGO-41
> Project: Olingo
> Issue Type: Bug
> Components: odata2-core
> Affects Versions: 1.0.0
> Environment: Apache Karaf 2.3.3
> Reporter: Vassili Jakovlev
> Fix For: 1.0.0
>
>
> "Export-Package" header in olingo-odata2-core's MANIFEST.MF file misses the
> package "org.apache.olingo.odata2.core.rest", but includes
> "org.apache.olingo.odata2.core.rest.app". In my opinion both packages should
> be included in "Export-Package" header and corresponding section in pom.xml
> should look like this:
> <Export-Package>
> org.apache.olingo.odata2.core.rest;version=${project.version},
> org.apache.olingo.odata2.core.rest.app;version=${project.version},
> org.apache.olingo.odata2.core.rt;version=${project.version},
> </Export-Package>
> PS. I need this package because it was required to create custom
> ODataRootLocator since default ODataRootLocator accepts only fully qualified
> factory class name, what causes problems in OSGi environment (my factory
> class in not visible to olingo-odata2-core bundle)
--
This message was sent by Atlassian JIRA
(v6.1#6144)