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

Michael Bolz commented on OLINGO-171:
-------------------------------------

Hi Petr,

again thanks for your feedback.

The mentioned issue with the 
{{AnnotationServiceFactory.createAnnotationService(String)}} is based on a 
limitation with Java.
Unfortunately it is not that easy to get all available classes within a java 
package. To get these it is necessary to access the folder (i.e. the 
corresponding folder to the java package) and read the filenames. And dependent 
on the environment (e.g. _Application Server_, _OSGi_, _.._) their exists no 
accessible folder. In this case currently the only solution is to use 
{{AnnotationServiceFactory.createAnnotationService(Collection)}} and providing 
the classes directly as you have done.
In my main environment I deploy a {{war}} which contains the model package in a 
_Tomcat_ or _Jetty_. In this combination the 
{{AnnotationServiceFactory.createAnnotationService(String)}} works.

And to your question to _create an annotation service factory for multiple 
packages_. Currently this is not supported. But you could create an feature 
request for this in JIRA (and then someone can contribute an implementation).
As workaround it is possible to use a parent package for different models. E.g. 
{{org.olingo.sample.model.one}} and {{org.olingo.sample.model.two}} for models 
and then for creation of the service {{org.olingo.sample.model}} as package.
But the limitation/issue from your mentioned issue will still be there.

Kind regards,
Michael

> Export-Package header missing package 
> org.apache.olingo.odata2.annotation.processor.core.datasource
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OLINGO-171
>                 URL: https://issues.apache.org/jira/browse/OLINGO-171
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-annotation
>    Affects Versions: V2 1.2.0
>         Environment: OSGi (Equinox 3.8.0)
> olingo-odata2-annotation-processor-core-incubating-1.2.0-20140219.004952-67.jar
>            Reporter: Petr Dolezal
>            Assignee: Michael Bolz
>             Fix For: V2 1.2.0
>
>
> Package org.apache.olingo.odata2.annotation.processor.core.datasource is not 
> exported from olingo-odata2-annotation-processor-core.
> Due to this bug it is not possible to refer e.g. to DataStore class in OSGi 
> environment (the importing bundles can't be resolved).



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to