You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by David Jencks <da...@yahoo.com> on 2010/11/05 19:02:00 UTC

require-bundle header in api bundle

I'm trying to understand why the require-bundle header is in the api bundle.  This is a pretty bizarre thing to do in what I've seen of osgi.

I took it out and geronimo-tomcat appears to work OK.  Maybe because this is because geronimo has a somewhat extended thread context classloader, but maybe not.

I saw some vague claims in the comments to MYFACES-2911 that the api classes need to load impl classes, but no details.  Could someone point me to the code where this happens?  There must be a better way to do this....

thanks
david jencks


Re: require-bundle header in api bundle

Posted by Leonardo Uribe <lu...@gmail.com>.
Hi

2010/11/8 David Jencks <da...@yahoo.com>

> Before I spend a lot of time figuring out why FactoryFinder works in
> geronimo, I wonder if there is any need for any of the impl classes to be
> exported for any reason other than making them visible to FactoryFinder?  If
> not then either packaging api and impl in a single bundle or making the impl
> bundle a fragment and the api bundle the fragment host ought to work.
>  Obviously with a single bundle you can also export anything you want.
>
>
Yes, Mike Kienenberger commented on:

https://issues.apache.org/jira/browse/MYFACES-2911

that Mojarra created a single bundle to deal with this stuff in a OSGi
friendly way. I'll provide the necessary setup on myfaces.


> I think either of these solutions would be a lot more reasonable than a
> require-bundle that goes the opposite direction from the package
> dependencies.
>
>
Ok, but anyway the way it is configured myfaces-api and impl right now is
ok.

regards,

Leonardo Uribe


> thanks
> david jencks
>
> On Nov 8, 2010, at 10:25 AM, Leonardo Uribe wrote:
>
> Hi
>
> 2010/11/5 David Jencks <da...@yahoo.com>
>
>> I'm trying to understand why the require-bundle header is in the api
>> bundle.  This is a pretty bizarre thing to do in what I've seen of osgi.
>>
>>
> Could you be more explicit about this point? I don't see anything bizarre
> here.
>
>
>> I took it out and geronimo-tomcat appears to work OK.  Maybe because this
>> is because geronimo has a somewhat extended thread context classloader, but
>> maybe not.
>>
>>
> In theory, to make JSF run it is necessary to provide a thread context
> classloader. The problem is javax.faces.FactoryFinder requires it to lookup
> Factory classes. There is no known valid workaround available.
>
>
>> I saw some vague claims in the comments to MYFACES-2911 that the api
>> classes need to load impl classes, but no details.  Could someone point me
>> to the code where this happens?  There must be a better way to do this....
>>
>
> In few words, the reasons why Require-Bundle header is ok are:
>
> - javax.faces.FactoryFinder load impl factory classes.
> - myfaces-api jar are only tested against myfaces-impl with the same number
> and pass TCK test only with this combination. It is not expected people use
> myfaces-api 2.0.1 and myfaces-impl 2.0.2 for a web-app for example.
>
> regards,
>
> Leonardo Uribe
>
>
>>
>> thanks
>> david jencks
>>
>>
>
>

Re: require-bundle header in api bundle

Posted by David Jencks <da...@yahoo.com>.
Before I spend a lot of time figuring out why FactoryFinder works in geronimo, I wonder if there is any need for any of the impl classes to be exported for any reason other than making them visible to FactoryFinder?  If not then either packaging api and impl in a single bundle or making the impl bundle a fragment and the api bundle the fragment host ought to work.  Obviously with a single bundle you can also export anything you want.

I think either of these solutions would be a lot more reasonable than a require-bundle that goes the opposite direction from the package dependencies.

thanks
david jencks

On Nov 8, 2010, at 10:25 AM, Leonardo Uribe wrote:

> Hi
> 
> 2010/11/5 David Jencks <da...@yahoo.com>
> I'm trying to understand why the require-bundle header is in the api bundle.  This is a pretty bizarre thing to do in what I've seen of osgi.
> 
> 
> Could you be more explicit about this point? I don't see anything bizarre here.
>  
> I took it out and geronimo-tomcat appears to work OK.  Maybe because this is because geronimo has a somewhat extended thread context classloader, but maybe not.
> 
> 
> In theory, to make JSF run it is necessary to provide a thread context classloader. The problem is javax.faces.FactoryFinder requires it to lookup Factory classes. There is no known valid workaround available.
>  
> I saw some vague claims in the comments to MYFACES-2911 that the api classes need to load impl classes, but no details.  Could someone point me to the code where this happens?  There must be a better way to do this....
> 
> In few words, the reasons why Require-Bundle header is ok are:
> 
> - javax.faces.FactoryFinder load impl factory classes. 
> - myfaces-api jar are only tested against myfaces-impl with the same number and pass TCK test only with this combination. It is not expected people use myfaces-api 2.0.1 and myfaces-impl 2.0.2 for a web-app for example.
> 
> regards,
> 
> Leonardo Uribe
>  
> 
> thanks
> david jencks
> 
> 


Re: require-bundle header in api bundle

Posted by Leonardo Uribe <lu...@gmail.com>.
Hi

2010/11/5 David Jencks <da...@yahoo.com>

> I'm trying to understand why the require-bundle header is in the api
> bundle.  This is a pretty bizarre thing to do in what I've seen of osgi.
>
>
Could you be more explicit about this point? I don't see anything bizarre
here.


> I took it out and geronimo-tomcat appears to work OK.  Maybe because this
> is because geronimo has a somewhat extended thread context classloader, but
> maybe not.
>
>
In theory, to make JSF run it is necessary to provide a thread context
classloader. The problem is javax.faces.FactoryFinder requires it to lookup
Factory classes. There is no known valid workaround available.


> I saw some vague claims in the comments to MYFACES-2911 that the api
> classes need to load impl classes, but no details.  Could someone point me
> to the code where this happens?  There must be a better way to do this....
>

In few words, the reasons why Require-Bundle header is ok are:

- javax.faces.FactoryFinder load impl factory classes.
- myfaces-api jar are only tested against myfaces-impl with the same number
and pass TCK test only with this combination. It is not expected people use
myfaces-api 2.0.1 and myfaces-impl 2.0.2 for a web-app for example.

regards,

Leonardo Uribe


>
> thanks
> david jencks
>
>

Re: require-bundle header in api bundle

Posted by Jakob Korherr <ja...@gmail.com>.
Hi David,

Thanks for bringing this up (again)!

Actually I am not that familiar with OSGi and I don't really know why
we have this entry, but I think Leonardo does.

@Leonardo: can you jump in here?

Regards,
Jakob

2010/11/5 David Jencks <da...@yahoo.com>:
> I'm trying to understand why the require-bundle header is in the api bundle.  This is a pretty bizarre thing to do in what I've seen of osgi.
>
> I took it out and geronimo-tomcat appears to work OK.  Maybe because this is because geronimo has a somewhat extended thread context classloader, but maybe not.
>
> I saw some vague claims in the comments to MYFACES-2911 that the api classes need to load impl classes, but no details.  Could someone point me to the code where this happens?  There must be a better way to do this....
>
> thanks
> david jencks
>
>



-- 
Jakob Korherr

blog: http://www.jakobk.com
twitter: http://twitter.com/jakobkorherr
work: http://www.irian.at