[ 
https://issues.apache.org/jira/browse/MYFACES-2290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12770768#action_12770768
 ] 

Felix Röthenbacher commented on MYFACES-2290:
---------------------------------------------

Unfortunately, I won't have the time to provide you with an OSGi runtime 
environment (and this can be a real pain) but I can give you some directions 
how my setup looks like:

- Use fragment bundle for myfaces-api bundle to allow access to myfaces-impl 
and, in my case, also Trinidad. I used the require-bundle directive so search 
for resources can be limited to those bundles

Manifest-Version: 1.0
Built-By: syabru.ch
Bundle-Name: Syabru OSGi org.apache.myfaces.core.api fragment
Fragment-Host: org.apache.myfaces.core.api;bundle-version="1.2.8"
Require-Bundle: org.apache.myfaces.core.impl;bundle-version="1.2.8",
 org.apache.myfaces.trinidad.impl;bundle-version="1.2.12"
Bundle-Version: 0.0.1.SNAPSHOT
Bundle-ManifestVersion: 2
Bundle-SymbolicName: ch.syabru.osgi.org.apache.myfaces.core.api-fragmen
 t

- Setup OSGi runtime environment with Equinox (note: to my knowledge Apache 
Felix doesn't support fragments)
- I used Spring Dynamic Modules for OSGi (http://www.springsource.org/osgi) to 
startup Tomcat as OSGi service and deploy web application bundle


> Add OSGi bundle information and bundle classloader / activator
> --------------------------------------------------------------
>
>                 Key: MYFACES-2290
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2290
>             Project: MyFaces Core
>          Issue Type: New Feature
>          Components: General
>    Affects Versions: 1.2.8-SNAPSHOT
>         Environment: OSGi (Equinox, Apache Felix, ...)
>            Reporter: Felix Röthenbacher
>            Assignee: Leonardo Uribe
>            Priority: Critical
>         Attachments: myfaces-core.diff.txt, myfaces-shared.diff.txt
>
>
> The provided patch will add OSGi information to bundle manifest. A bundle 
> activator class makes the MyFaces framework aware that it is running in a 
> bundle environment. A bundle classloader is used to load classes and 
> resources from the bundle classpath. The patch doesn't require any new 
> runtime dependencies and doesn't affect class loading in a non-OSGi 
> environment. Though, small modifications to classloading were needed. This 
> was mainly replacing Thread.currentThread.getContextClassLoader() with 
> ClassUtils methods.
> To run MyFaces in an OSGi environment both bundles (myfaces-api and 
> myfaces-impl) have to be started in the OSGi container. Additionally, the 
> myfaces-impl bundle has to be made available to myfaces-api. Use a fragment 
> bundle with myfaces-api as Fragment-Host and myfaces-impl as Required-Bundle.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to