Johannes Hoenger created OLINGO-1140:
----------------------------------------
Summary: Support of OSGi architecture
Key: OLINGO-1140
URL: https://issues.apache.org/jira/browse/OLINGO-1140
Project: Olingo
Issue Type: New Feature
Components: odata2-core
Affects Versions: (Java) V4 4.3.0
Reporter: Johannes Hoenger
*Context*
We as OSGi developers face a challenge when using third-party libraries like
Olingo that OSGi bundles may not be provided.
Since Olingo does also not provide a bundle we opted for the most common
solution. We wrapped the Olingo library using [Apache
Felix|http://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle-plugin-bnd.html].
For more details about wrapping please refer to this link [Wrapping Libraries
to OSGi Bundles|http://bnd.bndtools.org/chapters/390-wrapping.html].
*Request*
An inherent property of the wrapping is that the namespace of the wrapped
artifact changes. This is usually not an issue.
However, when in the code is a package name hardcoded which leads to issue in
our software component.
The issue occurs at line 63 in the class RuntimeDelegate. Please refer to the
following like
https://github.com/apache/olingo-odata2/blob/b33cdc411ac8731162266ebb19ae97a90ca88be9/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/rt/RuntimeDelegate.java#L51-L76
The aforementioned lined throws in our OSGi components the following exception
{code:title=exception.log|borderStyle=solid}
Exception:
org.apache.olingo.odata2.api.rt.RuntimeDelegate$RuntimeDelegateException:
java.lang.ClassNotFoundException:
org.apache.olingo.odata2.core.rt.RuntimeDelegateImpl cannot be found by
<wrapping container name>
org.apache.olingo.odata2.api.rt.RuntimeDelegate$RuntimeDelegateException:
java.lang.ClassNotFoundException:
org.apache.olingo.odata2.core.rt.RuntimeDelegateImpl cannot be found by
<wrapping container name>
at
org.apache.olingo.odata2.api.rt.RuntimeDelegate.getInstance(RuntimeDelegate.java:73)
at
org.apache.olingo.odata2.api.rt.RuntimeDelegate.extractExceptionMessage(RuntimeDelegate.java:236)
at
org.apache.olingo.odata2.api.exception.ODataMessageException.getMessage(ODataMessageException.java:127)
at java.lang.Throwable.getLocalizedMessage(Throwable.java:391)
at java.lang.Throwable.toString(Throwable.java:480)
at java.lang.Throwable.<init>(Throwable.java:311)
at java.lang.Exception.<init>(Exception.java:102)
at
org.apache.olingo.odata2.api.exception.ODataException.<init>(ODataException.java:42)
at
org.apache.olingo.odata2.api.exception.ODataMessageException.<init>(ODataMessageException.java:75)
at
org.apache.olingo.odata2.api.exception.ODataMessageException.<init>(ODataMessageException.java:63)
at
org.apache.olingo.odata2.api.edm.EdmException.<init>(EdmException.java:48)
at
org.apache.olingo.odata2.api.edm.EdmLiteralException.<init>(EdmLiteralException.java:43)
at
org.apache.olingo.odata2.core.edm.EdmSimpleTypeFacadeImpl.parseUriLiteral(EdmSimpleTypeFacadeImpl.java:76)
at
org.apache.olingo.odata2.core.uri.expression.Tokenizer.checkForLiteral(Tokenizer.java:171)
at
org.apache.olingo.odata2.core.uri.expression.Tokenizer.tokenize(Tokenizer.java:153)
at
org.apache.olingo.odata2.core.uri.expression.FilterParserImpl.parseFilterString(FilterParserImpl.java:89)
at
org.apache.olingo.odata2.core.uri.expression.FilterParserImpl.parseFilterString(FilterParserImpl.java:80)
{code}
This line is, as far as we can tell, the only line which is incompatible with
the OSGi wrapping approach. Is is possible to provide a solution for this case?
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)