You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Jean-Philippe CLEMENT (JIRA)" <ji...@apache.org> on 2010/06/14 15:19:12 UTC
[jira] Created: (FELIX-2409) javax.annotation not exported
javax.annotation not exported
-----------------------------
Key: FELIX-2409
URL: https://issues.apache.org/jira/browse/FELIX-2409
Project: Felix
Issue Type: Bug
Components: Karaf
Affects Versions: karaf 1.6.0
Environment: Windows / jre-1.6
Reporter: Jean-Philippe CLEMENT
Karaf config.properties does not export "jre-1.6" javax.annotation and javax.annotation.processing standard packages.
As they are part of the java 1.6 API it sounds normal to have them imported by default:
javax.annotation, \
javax.annotation.processing, \
Would it be possible to fix this?
Thanks.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
Re: [jira] Commented: (FELIX-2409) javax.annotation not exported
Posted by Guillaume Nodet <gn...@gmail.com>.
On Mon, Jun 14, 2010 at 15:48, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> Thanks for the update Bengt,
>
> but I'm a little bit surprised as we have two standard package set: one for
> jre-1.5 and one for jre-1.6.
>
>
I'd rather not export any spec than can be provided with a better
osgi-enhanced version, such as the one we provide in ServiceMix.
> Note that javax.transaction is exported with a mandatory attribute:
> javax.transaction; javax.transaction.xa; partial=true;mandatory:=partial, \
> in both jre 1.5 and 1.6.
>
Right, but this is a hack required in order to have JTA work in OSGi. If
you look at the content of the package in the JRE, it only provides a few
classes, but those are used by JDBC. Also, if you look more closely, you
should see a boot delegation to javax.transaction too. This is required in
order to be able to deploy a javax.transaction package that people can use,
while ensuring that the classes from the JRE will always be used, but that
noone can wire on to the package provided by the JRE ... A bit complicated,
but it seems to work ...
As for javax.annotation and javax.annotation.processing, those two packages
may be considered differently as javax.scripting. Is there any bundle other
than the JRE that can provide those packages ? Are they really tied to the
JRE so that if we use a different version, it won't work ?
>
> Regards
> JB
>
>
> On 06/14/2010 03:43 PM, Bengt Rodehav wrote:
>
>> I had the same problem a while back. I was informed that since Karaf also
>> supports Java 1.5 (which doesnt have these packages), they should not by
>> default be imported by Karaf.
>>
>> See the following:
>>
>> http://old.nabble.com/Karaf-1.4.0-and-ActiveMQ-5.3.1-td28191404.html
>>
>> /Bengt
>>
>> 2010/6/14 Jean-Baptiste Onofré (JIRA)<ji...@apache.org>
>>
>>
>>> [
>>>
>>> https://issues.apache.org/jira/browse/FELIX-2409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12878569#action_12878569
>>> ]
>>>
>>> Jean-Baptiste Onofré commented on FELIX-2409:
>>> ---------------------------------------------
>>>
>>> It sounds good for me.
>>>
>>> javax.annotation not exported
>>>> -----------------------------
>>>>
>>>> Key: FELIX-2409
>>>> URL: https://issues.apache.org/jira/browse/FELIX-2409
>>>> Project: Felix
>>>> Issue Type: Bug
>>>> Components: Karaf
>>>> Affects Versions: karaf 1.6.0
>>>> Environment: Windows / jre-1.6
>>>> Reporter: Jean-Philippe CLEMENT
>>>>
>>>> Karaf config.properties does not export "jre-1.6" javax.annotation and
>>>>
>>> javax.annotation.processing standard packages.
>>>
>>>> As they are part of the java 1.6 API it sounds normal to have them
>>>>
>>> imported by default:
>>>
>>>> javax.annotation, \
>>>> javax.annotation.processing, \
>>>> Would it be possible to fix this?
>>>> Thanks.
>>>>
>>>
>>> --
>>> This message is automatically generated by JIRA.
>>> -
>>> You can reply to this email to add a comment to the issue online.
>>>
>>>
>>>
>>
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com
Re: [jira] Commented: (FELIX-2409) javax.annotation not exported
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Thanks for the update Bengt,
but I'm a little bit surprised as we have two standard package set: one
for jre-1.5 and one for jre-1.6.
Note that javax.transaction is exported with a mandatory attribute:
javax.transaction; javax.transaction.xa; partial=true;mandatory:=partial, \
in both jre 1.5 and 1.6.
Regards
JB
On 06/14/2010 03:43 PM, Bengt Rodehav wrote:
> I had the same problem a while back. I was informed that since Karaf also
> supports Java 1.5 (which doesnt have these packages), they should not by
> default be imported by Karaf.
>
> See the following:
>
> http://old.nabble.com/Karaf-1.4.0-and-ActiveMQ-5.3.1-td28191404.html
>
> /Bengt
>
> 2010/6/14 Jean-Baptiste Onofré (JIRA)<ji...@apache.org>
>
>>
>> [
>> https://issues.apache.org/jira/browse/FELIX-2409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12878569#action_12878569]
>>
>> Jean-Baptiste Onofré commented on FELIX-2409:
>> ---------------------------------------------
>>
>> It sounds good for me.
>>
>>> javax.annotation not exported
>>> -----------------------------
>>>
>>> Key: FELIX-2409
>>> URL: https://issues.apache.org/jira/browse/FELIX-2409
>>> Project: Felix
>>> Issue Type: Bug
>>> Components: Karaf
>>> Affects Versions: karaf 1.6.0
>>> Environment: Windows / jre-1.6
>>> Reporter: Jean-Philippe CLEMENT
>>>
>>> Karaf config.properties does not export "jre-1.6" javax.annotation and
>> javax.annotation.processing standard packages.
>>> As they are part of the java 1.6 API it sounds normal to have them
>> imported by default:
>>> javax.annotation, \
>>> javax.annotation.processing, \
>>> Would it be possible to fix this?
>>> Thanks.
>>
>> --
>> This message is automatically generated by JIRA.
>> -
>> You can reply to this email to add a comment to the issue online.
>>
>>
>
Re: [jira] Commented: (FELIX-2409) javax.annotation not exported
Posted by Bengt Rodehav <be...@rodehav.com>.
I had the same problem a while back. I was informed that since Karaf also
supports Java 1.5 (which doesnt have these packages), they should not by
default be imported by Karaf.
See the following:
http://old.nabble.com/Karaf-1.4.0-and-ActiveMQ-5.3.1-td28191404.html
/Bengt
2010/6/14 Jean-Baptiste Onofré (JIRA) <ji...@apache.org>
>
> [
> https://issues.apache.org/jira/browse/FELIX-2409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12878569#action_12878569]
>
> Jean-Baptiste Onofré commented on FELIX-2409:
> ---------------------------------------------
>
> It sounds good for me.
>
> > javax.annotation not exported
> > -----------------------------
> >
> > Key: FELIX-2409
> > URL: https://issues.apache.org/jira/browse/FELIX-2409
> > Project: Felix
> > Issue Type: Bug
> > Components: Karaf
> > Affects Versions: karaf 1.6.0
> > Environment: Windows / jre-1.6
> > Reporter: Jean-Philippe CLEMENT
> >
> > Karaf config.properties does not export "jre-1.6" javax.annotation and
> javax.annotation.processing standard packages.
> > As they are part of the java 1.6 API it sounds normal to have them
> imported by default:
> > javax.annotation, \
> > javax.annotation.processing, \
> > Would it be possible to fix this?
> > Thanks.
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>
[jira] Commented: (FELIX-2409) javax.annotation not exported
Posted by "Jean-Philippe CLEMENT (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12878606#action_12878606 ]
Jean-Philippe CLEMENT commented on FELIX-2409:
----------------------------------------------
"karaf is set up is that all applications can run independantly of being run on JDK 1.5 or 1.6"
Well, in that case, why having two parts - one for jre-1.5 another for jre-1.6 - in the configuration file? ...what would happen for java 1.7 new features, will Karaf be blocked on java 1.5 forever?
"it would fail because we currently rely on servicemix specs"
So, if I understand correctly, karaf internal constraints interact with user setup. It would be great if Karaf could be as transparent as possible.
Why not having two configurations: one for karaf internal needs and one for the user?
> javax.annotation not exported
> -----------------------------
>
> Key: FELIX-2409
> URL: https://issues.apache.org/jira/browse/FELIX-2409
> Project: Felix
> Issue Type: Bug
> Components: Karaf
> Affects Versions: karaf 1.6.0
> Environment: Windows / jre-1.6
> Reporter: Jean-Philippe CLEMENT
>
> Karaf config.properties does not export "jre-1.6" javax.annotation and javax.annotation.processing standard packages.
> As they are part of the java 1.6 API it sounds normal to have them imported by default:
> javax.annotation, \
> javax.annotation.processing, \
> Would it be possible to fix this?
> Thanks.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (FELIX-2409) javax.annotation not exported
Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12878679#action_12878679 ]
Guillaume Nodet commented on FELIX-2409:
----------------------------------------
Splitting the jre exported packages sounds good to me.
Wanna provide a patch that would do that ?
> javax.annotation not exported
> -----------------------------
>
> Key: FELIX-2409
> URL: https://issues.apache.org/jira/browse/FELIX-2409
> Project: Felix
> Issue Type: Bug
> Components: Karaf
> Affects Versions: karaf 1.6.0
> Environment: Windows / jre-1.6
> Reporter: Jean-Philippe CLEMENT
>
> Karaf config.properties does not export "jre-1.6" javax.annotation and javax.annotation.processing standard packages.
> As they are part of the java 1.6 API it sounds normal to have them imported by default:
> javax.annotation, \
> javax.annotation.processing, \
> Would it be possible to fix this?
> Thanks.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (FELIX-2409) javax.annotation not exported
Posted by "Jean-Philippe CLEMENT (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12878615#action_12878615 ]
Jean-Philippe CLEMENT commented on FELIX-2409:
----------------------------------------------
Ok, I'm not sure to have the full picture. But, why not relying on the jre, as it is the base API and what is provided by the jre API is expected to be usable.
This would imply having Karaf config.properties with all jre packages set. Then it's up to the user to remove config.properties lines that does not match his needs.
I guess it provides the same functionality... just a matter on what to expect by default, isn't it?
> javax.annotation not exported
> -----------------------------
>
> Key: FELIX-2409
> URL: https://issues.apache.org/jira/browse/FELIX-2409
> Project: Felix
> Issue Type: Bug
> Components: Karaf
> Affects Versions: karaf 1.6.0
> Environment: Windows / jre-1.6
> Reporter: Jean-Philippe CLEMENT
>
> Karaf config.properties does not export "jre-1.6" javax.annotation and javax.annotation.processing standard packages.
> As they are part of the java 1.6 API it sounds normal to have them imported by default:
> javax.annotation, \
> javax.annotation.processing, \
> Would it be possible to fix this?
> Thanks.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (FELIX-2409) javax.annotation not exported
Posted by "Jean-Philippe CLEMENT (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12878638#action_12878638 ]
Jean-Philippe CLEMENT commented on FELIX-2409:
----------------------------------------------
"I guess the choice comes down to:
* export everything from the jre and let the user deal with nasty issues when / if they come up
* export a minimal set and force the user to either tweak the config (meaning they kinda have a good knowledge of osgi) or make them deploy the needed bundles"
Correct.
I don't know why the JAX api you mentioned would fail. I guess it is a manifest issue. I'm not too sure if this is up to Karaf - a shared framework - to fix user bundles issues ;)
Moreover, I would say, if I'm using the regular java api in a regular way, I'm expecting it to work also in Karaf... which is not the case (as it needs a little of configuration).
But that's true this is not a big deal. Maybe, if the "minimal export" case is still retained, I would suggest to move the export part in some external configuration files. For instance:
default.export.properties
jre16.export.properties
myadhoc.export.properties
...
where config.properties would contain a reference to the used export file instead of "jre-X.Y" parts:
felix.export=default.export.properties
which could easily changed to:
felix.export=jre16.export.properties
and *.export.properties would contain ad'hoc exports:
javax.accessibility, \
javax.activity, \
javax.crypto, \
javax.crypto.interfaces, \
javax.crypto.spec, \
javax.imageio, \
...
What do you think?
> javax.annotation not exported
> -----------------------------
>
> Key: FELIX-2409
> URL: https://issues.apache.org/jira/browse/FELIX-2409
> Project: Felix
> Issue Type: Bug
> Components: Karaf
> Affects Versions: karaf 1.6.0
> Environment: Windows / jre-1.6
> Reporter: Jean-Philippe CLEMENT
>
> Karaf config.properties does not export "jre-1.6" javax.annotation and javax.annotation.processing standard packages.
> As they are part of the java 1.6 API it sounds normal to have them imported by default:
> javax.annotation, \
> javax.annotation.processing, \
> Would it be possible to fix this?
> Thanks.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (FELIX-2409) javax.annotation not exported
Posted by "Jean-Philippe CLEMENT (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12878875#action_12878875 ]
Jean-Philippe CLEMENT commented on FELIX-2409:
----------------------------------------------
Why not!
For the moment I'm in the early phase of a new project which means no time left. I will have a better outlook in a month.
> javax.annotation not exported
> -----------------------------
>
> Key: FELIX-2409
> URL: https://issues.apache.org/jira/browse/FELIX-2409
> Project: Felix
> Issue Type: Bug
> Components: Karaf
> Affects Versions: karaf 1.6.0
> Environment: Windows / jre-1.6
> Reporter: Jean-Philippe CLEMENT
>
> Karaf config.properties does not export "jre-1.6" javax.annotation and javax.annotation.processing standard packages.
> As they are part of the java 1.6 API it sounds normal to have them imported by default:
> javax.annotation, \
> javax.annotation.processing, \
> Would it be possible to fix this?
> Thanks.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (FELIX-2409) javax.annotation not exported
Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12878627#action_12878627 ]
Guillaume Nodet commented on FELIX-2409:
----------------------------------------
Let's give you a concrete example.
if we just put in the patch you propose, you wouln't be able to deploy the JAX-WS api provided by http://www.springsource.com/repository/app/bundle/version/detail?name=com.springsource.com.sun.xml.ws&version=2.1.3 for example, because the package versioning won't work. So you'd have to deploy another bundle anyway. Then there's really no reason for exporting the one from the JRE in the first place, it will only fragment the space more.
I guess the choice comes down to:
* export everything from the jre and let the user deal with nasty issues when / if they come up
* export a minimal set and force the user to either tweak the config (meaning they kinda have a good knowledge of osgi) or make them deploy the needed bundles
Currently, we've mostly focused on the second way. We may want to reconsider that, but has to be discussed furtther i think.
Btw, javax.annotation can easily be provided using the following bundle:
http://repo2.maven.org/maven2/org/apache/geronimo/specs/geronimo-annotation_1.1_spec/1.0/geronimo-annotation_1.1_spec-1.0.jar
or from inside karaf:
mvn:org.apache.geronimo.specs/geronimo-annotation_1.1_spec/1.0
> javax.annotation not exported
> -----------------------------
>
> Key: FELIX-2409
> URL: https://issues.apache.org/jira/browse/FELIX-2409
> Project: Felix
> Issue Type: Bug
> Components: Karaf
> Affects Versions: karaf 1.6.0
> Environment: Windows / jre-1.6
> Reporter: Jean-Philippe CLEMENT
>
> Karaf config.properties does not export "jre-1.6" javax.annotation and javax.annotation.processing standard packages.
> As they are part of the java 1.6 API it sounds normal to have them imported by default:
> javax.annotation, \
> javax.annotation.processing, \
> Would it be possible to fix this?
> Thanks.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (FELIX-2409) javax.annotation not exported
Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12878594#action_12878594 ]
Guillaume Nodet commented on FELIX-2409:
----------------------------------------
It doesn't for me. Currently, the way karaf is set up is that all applications can run independantly of being run on JDK 1.5 or 1.6.
If we do that for javax.annotation, we'd have to do that for javax.scripting for example, but in that case, it would fail because we currently rely on servicemix specs, which are enhanced for osgi, so this would break as soon as you use jdk 1.6.
So i'd rather advise you to tweak the karaf config in order to suit your needs, if your target jre is jdk 1.6 only.
> javax.annotation not exported
> -----------------------------
>
> Key: FELIX-2409
> URL: https://issues.apache.org/jira/browse/FELIX-2409
> Project: Felix
> Issue Type: Bug
> Components: Karaf
> Affects Versions: karaf 1.6.0
> Environment: Windows / jre-1.6
> Reporter: Jean-Philippe CLEMENT
>
> Karaf config.properties does not export "jre-1.6" javax.annotation and javax.annotation.processing standard packages.
> As they are part of the java 1.6 API it sounds normal to have them imported by default:
> javax.annotation, \
> javax.annotation.processing, \
> Would it be possible to fix this?
> Thanks.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (FELIX-2409) javax.annotation not exported
Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12878611#action_12878611 ]
Guillaume Nodet commented on FELIX-2409:
----------------------------------------
It's not for karaf internal needs. Let me try to explain.
Let say you want to use JAX-WS, javax.scripting, SAAJ, or any specification that usually leverage META-INF/services discovery mechanism. Some of those specs are provided by JDK 1.6 and maybe some new specs will be provided by JDK 1.7 in the future.
If you come from a Java SE environment, you're used to using those API. If you want to drop a new provider, you just add it to your classpath and it will be used.
Now in an OSGI environment, things don't really work that way. The worst thing is that if we offer those APIs from the JRE, the user has *no way* to change the provider. So that 's the main problem i'd like to avoid. It's about making things work in OSGi ... That's why Karaf try to avoid exporing any package that can be provided by other means (such as javax.xml.ws, javax.scripting, javax.jws, javax.activation).
All those can be provided by additional bundles.
In addition, a common problem with those packages is that they aren't versioned, which can also cause problems if you have a bundle requiring a version > 0.0.
Now, as I said, I think it's fair to tweak the configuration for you own environment.
Last, when JDK 1.7 comes out, we'll have to check it and write a new config for it I suppose.
> javax.annotation not exported
> -----------------------------
>
> Key: FELIX-2409
> URL: https://issues.apache.org/jira/browse/FELIX-2409
> Project: Felix
> Issue Type: Bug
> Components: Karaf
> Affects Versions: karaf 1.6.0
> Environment: Windows / jre-1.6
> Reporter: Jean-Philippe CLEMENT
>
> Karaf config.properties does not export "jre-1.6" javax.annotation and javax.annotation.processing standard packages.
> As they are part of the java 1.6 API it sounds normal to have them imported by default:
> javax.annotation, \
> javax.annotation.processing, \
> Would it be possible to fix this?
> Thanks.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (FELIX-2409) javax.annotation not exported
Posted by "Jean-Baptiste Onofré (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12878569#action_12878569 ]
Jean-Baptiste Onofré commented on FELIX-2409:
---------------------------------------------
It sounds good for me.
> javax.annotation not exported
> -----------------------------
>
> Key: FELIX-2409
> URL: https://issues.apache.org/jira/browse/FELIX-2409
> Project: Felix
> Issue Type: Bug
> Components: Karaf
> Affects Versions: karaf 1.6.0
> Environment: Windows / jre-1.6
> Reporter: Jean-Philippe CLEMENT
>
> Karaf config.properties does not export "jre-1.6" javax.annotation and javax.annotation.processing standard packages.
> As they are part of the java 1.6 API it sounds normal to have them imported by default:
> javax.annotation, \
> javax.annotation.processing, \
> Would it be possible to fix this?
> Thanks.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.