You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Jean-Louis MONTEIRO <je...@atosorigin.com> on 2009/10/29 10:56:42 UTC

Re: For adventurous: first run of OSGified OpenEJB *seems* running fine


> First of all, i went to Felix-Karaf 1.0.0 which is a bit for user friendly

I've been wondering what Karaf was having seen it in use in Geronimo
osgification. I'm glad you used it so I'm encourage to do so if it
gets things easier.


Jacek Laskowski wrote:
> 
> Actually, Karaf relies on Felix for its OSGi platform. But it provides a
> set of useful tools and configuration.
> Some details are available here
> http://felix.apache.org/site/apache-felix-karaf.html
> 

> 1. For some strange reasons, installing osgi bundles using Pax mvn url
> handler didn't run fine (not able to find my proxy settings).

Why did you have to use it at all? Was it as a replacement for
installing bundles from maven repos using http?


Jacek Laskowski wrote:
> 
> Absolutely!
> I like the idea to use maven behavior to install bundles.
> I mean osgi:install mvn:<groupId>/<artifactId>/<version> instead of
> specifying a repository with an hard coded URL.
> 


> 2. I played with information from your mail. It was useful but too heavy.

It will get easier when I (or someone else) prepare appropriate config
file and the necessary bundles get installed automatically. Anyway,
I'm all ears to hear how the process can get simpler.


Jacek Laskowski wrote:
> 
> Using features is easier.
> I changed the openejb-core-osgi module to add features
> generation/deployment on maven.
> 

> 3. To eases installation i started changing some stuff either in OpenEJB
> or
> in your OSGI module.
> The result is a set of features. But, i'm facing an issue with
> openejb-loader and openejb-core.
>
> Basically, we have openejb-core depending on openejb-loader.
> And openejb-loader declares a required bundle: openejb-core. I would be
> nice
> to get rid of this dependency.

+1 if it gets the osgification simpler. Having a bundle required is
just a way to link bundles together and they can get installed by not
started. Starting a bundle resolves imports so it's not a cyclic
dependency because only openejb-core has to be started.


Jacek Laskowski wrote:
> 
> I got it working even if i'm not really happy with. IMO, we should review
> loader stuff.
> For example, in the Activator, the loader is used to initialize the
> container whereas OpenEJB.destroy() is directly used to shutdown the
> container.
> 

> With features, you just need to do:
>
> features:addUrl
> mvn:org.apache.openejb/openejb-core-osgi/3.1.2-SNAPSHOT/xml/features
>
> features:list outputs
> karaf@root> features:list
> State         Version          Name                   Repository
> [uninstalled] [5.0-2         ] javaee-api             repo-0
> [uninstalled] [3.1.2-SNAPSHOT] openejb-loader         repo-0
> [uninstalled] [3.1.2-SNAPSHOT] openejb-api            repo-0
> [uninstalled] [3.1.2-SNAPSHOT] openejb-javaagent      repo-0
> [uninstalled] [3.1.2-SNAPSHOT] openejb-jee            repo-0
> [uninstalled] [3.1.2-SNAPSHOT] ejb31-api-experimental repo-0
> [uninstalled] [3.1.2-SNAPSHOT] openejb-core           repo-0
> [uninstalled] [3.1.2-SNAPSHOT] openejb-core-osgi      repo-0
> [uninstalled] [2.5.6.SEC01   ] spring                 karaf-1.0.0
> [uninstalled] [1.2.0         ] spring-dm              karaf-1.0.0
> [uninstalled] [1.0.0         ] wrapper                karaf-1.0.0
> [uninstalled] [1.0.0         ] obr                    karaf-1.0.0
> [uninstalled] [1.0.0         ] http                   karaf-1.0.0
> [uninstalled] [1.0.0         ] webconsole             karaf-1.0.0
> [installed  ] [1.0.0         ] ssh                    karaf-1.0.0
> [installed  ] [1.0.0         ] management             karaf-1.0.0

I don't understand it yet - it looks karaf-specific which I would
avoid unless it's required. Could you explain what it is for?


Jacek Laskowski wrote:
> 
> May be the best, is to try it!
> Basically, a feature is a set of bundles.
> For example, instead of installing all APIs using something like
> # install osgi bundles using mvn url handler
> osgi:install
> mvn:org.apache.geronimo.specs/geronimo-activation_1.1_spec/1.0.2
> osgi:install mvn:org.apache.geronimo.specs/geronimo-javamail_1.4_spec/1.6
> osgi:install
> mvn:org.apache.geronimo.specs/geronimo-annotation_1.0_spec/1.1.1
> osgi:install mvn:org.apache.geronimo.specs/geronimo-ejb_3.0_spec/1.0.1
> osgi:install
> mvn:org.apache.geronimo.specs/geronimo-interceptor_3.0_spec/1.0.1
> osgi:install
> mvn:org.apache.geronimo.specs/geronimo-j2ee-connector_1.5_spec/2.0.0
> osgi:install
> mvn:org.apache.geronimo.specs/geronimo-j2ee-deployment_1.1_spec/1.1
> ...
> 
> you just need to do a features:install javaee-api.
> 
> 

Regarding logging, i had an issue with our log4j usage.
On Karaf, Pax Logging is installed be default so you can use the Log4j
logger in your application, but you cannot use internal APIs (have a look
here  http://lists.ops4j.org/pipermail/general/2009q3/002509.html
http://lists.ops4j.org/pipermail/general/2009q3/002509.html ). So I got a
ClassNotFoundException with org/apache/log4j/Layout.

By the way, I saw your activation code afterward, specially 
env.setProperty("openejb.log.factory",
"org.apache.openejb.util.JuliLogStreamFactory");

But it didn't work for me.
In the org.apache.openejb.util.Logger class, we do
System.getProperty("openejb.log.factory") instead of
SystemInstance.get().getProperty("openejb.log.factory");

I changed some other code to avoid System property usage and now it works
(or it should work) if you provide a embedded.juli.properties in the bundle.

Another solution is to create a conf/ directory in KARAF_HOME
(=OPENEJB_HOME).

Anyway, just for fun :) i change the Log4jLogStreamFactory to be able to use
Log4j with OSGi and PaxLogging.

Jean-Louis
-- 
View this message in context: http://www.nabble.com/For-adventurous%3A-first-run-of-OSGified-OpenEJB-*seems*-running-fine-tp26033567p26110134.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.


Re: For adventurous: first run of OSGified OpenEJB *seems* running fine

Posted by Guillaume Nodet <gn...@gmail.com>.
FWIW, Karaf embeds both equinox and felix.  The default configuraton
uses felix, but the switch is simply to edit the etc/config.properties
file and change the appropriate property to "equinox" and restart.

If you need any help in the Karaf area, let me know, i'd be glad to help.

On Thu, Oct 29, 2009 at 10:56, Jean-Louis MONTEIRO
<je...@atosorigin.com> wrote:
>
>
>> First of all, i went to Felix-Karaf 1.0.0 which is a bit for user friendly
>
> I've been wondering what Karaf was having seen it in use in Geronimo
> osgification. I'm glad you used it so I'm encourage to do so if it
> gets things easier.
>
>
> Jacek Laskowski wrote:
>>
>> Actually, Karaf relies on Felix for its OSGi platform. But it provides a
>> set of useful tools and configuration.
>> Some details are available here
>> http://felix.apache.org/site/apache-felix-karaf.html
>>
>
>> 1. For some strange reasons, installing osgi bundles using Pax mvn url
>> handler didn't run fine (not able to find my proxy settings).
>
> Why did you have to use it at all? Was it as a replacement for
> installing bundles from maven repos using http?
>
>
> Jacek Laskowski wrote:
>>
>> Absolutely!
>> I like the idea to use maven behavior to install bundles.
>> I mean osgi:install mvn:<groupId>/<artifactId>/<version> instead of
>> specifying a repository with an hard coded URL.
>>
>
>
>> 2. I played with information from your mail. It was useful but too heavy.
>
> It will get easier when I (or someone else) prepare appropriate config
> file and the necessary bundles get installed automatically. Anyway,
> I'm all ears to hear how the process can get simpler.
>
>
> Jacek Laskowski wrote:
>>
>> Using features is easier.
>> I changed the openejb-core-osgi module to add features
>> generation/deployment on maven.
>>
>
>> 3. To eases installation i started changing some stuff either in OpenEJB
>> or
>> in your OSGI module.
>> The result is a set of features. But, i'm facing an issue with
>> openejb-loader and openejb-core.
>>
>> Basically, we have openejb-core depending on openejb-loader.
>> And openejb-loader declares a required bundle: openejb-core. I would be
>> nice
>> to get rid of this dependency.
>
> +1 if it gets the osgification simpler. Having a bundle required is
> just a way to link bundles together and they can get installed by not
> started. Starting a bundle resolves imports so it's not a cyclic
> dependency because only openejb-core has to be started.
>
>
> Jacek Laskowski wrote:
>>
>> I got it working even if i'm not really happy with. IMO, we should review
>> loader stuff.
>> For example, in the Activator, the loader is used to initialize the
>> container whereas OpenEJB.destroy() is directly used to shutdown the
>> container.
>>
>
>> With features, you just need to do:
>>
>> features:addUrl
>> mvn:org.apache.openejb/openejb-core-osgi/3.1.2-SNAPSHOT/xml/features
>>
>> features:list outputs
>> karaf@root> features:list
>> State         Version          Name                   Repository
>> [uninstalled] [5.0-2         ] javaee-api             repo-0
>> [uninstalled] [3.1.2-SNAPSHOT] openejb-loader         repo-0
>> [uninstalled] [3.1.2-SNAPSHOT] openejb-api            repo-0
>> [uninstalled] [3.1.2-SNAPSHOT] openejb-javaagent      repo-0
>> [uninstalled] [3.1.2-SNAPSHOT] openejb-jee            repo-0
>> [uninstalled] [3.1.2-SNAPSHOT] ejb31-api-experimental repo-0
>> [uninstalled] [3.1.2-SNAPSHOT] openejb-core           repo-0
>> [uninstalled] [3.1.2-SNAPSHOT] openejb-core-osgi      repo-0
>> [uninstalled] [2.5.6.SEC01   ] spring                 karaf-1.0.0
>> [uninstalled] [1.2.0         ] spring-dm              karaf-1.0.0
>> [uninstalled] [1.0.0         ] wrapper                karaf-1.0.0
>> [uninstalled] [1.0.0         ] obr                    karaf-1.0.0
>> [uninstalled] [1.0.0         ] http                   karaf-1.0.0
>> [uninstalled] [1.0.0         ] webconsole             karaf-1.0.0
>> [installed  ] [1.0.0         ] ssh                    karaf-1.0.0
>> [installed  ] [1.0.0         ] management             karaf-1.0.0
>
> I don't understand it yet - it looks karaf-specific which I would
> avoid unless it's required. Could you explain what it is for?
>
>
> Jacek Laskowski wrote:
>>
>> May be the best, is to try it!
>> Basically, a feature is a set of bundles.
>> For example, instead of installing all APIs using something like
>> # install osgi bundles using mvn url handler
>> osgi:install
>> mvn:org.apache.geronimo.specs/geronimo-activation_1.1_spec/1.0.2
>> osgi:install mvn:org.apache.geronimo.specs/geronimo-javamail_1.4_spec/1.6
>> osgi:install
>> mvn:org.apache.geronimo.specs/geronimo-annotation_1.0_spec/1.1.1
>> osgi:install mvn:org.apache.geronimo.specs/geronimo-ejb_3.0_spec/1.0.1
>> osgi:install
>> mvn:org.apache.geronimo.specs/geronimo-interceptor_3.0_spec/1.0.1
>> osgi:install
>> mvn:org.apache.geronimo.specs/geronimo-j2ee-connector_1.5_spec/2.0.0
>> osgi:install
>> mvn:org.apache.geronimo.specs/geronimo-j2ee-deployment_1.1_spec/1.1
>> ...
>>
>> you just need to do a features:install javaee-api.
>>
>>
>
> Regarding logging, i had an issue with our log4j usage.
> On Karaf, Pax Logging is installed be default so you can use the Log4j
> logger in your application, but you cannot use internal APIs (have a look
> here  http://lists.ops4j.org/pipermail/general/2009q3/002509.html
> http://lists.ops4j.org/pipermail/general/2009q3/002509.html ). So I got a
> ClassNotFoundException with org/apache/log4j/Layout.
>
> By the way, I saw your activation code afterward, specially
> env.setProperty("openejb.log.factory",
> "org.apache.openejb.util.JuliLogStreamFactory");
>
> But it didn't work for me.
> In the org.apache.openejb.util.Logger class, we do
> System.getProperty("openejb.log.factory") instead of
> SystemInstance.get().getProperty("openejb.log.factory");
>
> I changed some other code to avoid System property usage and now it works
> (or it should work) if you provide a embedded.juli.properties in the bundle.
>
> Another solution is to create a conf/ directory in KARAF_HOME
> (=OPENEJB_HOME).
>
> Anyway, just for fun :) i change the Log4jLogStreamFactory to be able to use
> Log4j with OSGi and PaxLogging.
>
> Jean-Louis
> --
> View this message in context: http://www.nabble.com/For-adventurous%3A-first-run-of-OSGified-OpenEJB-*seems*-running-fine-tp26033567p26110134.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: For adventurous: first run of OSGified OpenEJB *seems* running fine

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On Wed, Nov 4, 2009 at 1:10 AM, Jonathan Gallimore
<jo...@gmail.com> wrote:

> The plugin itself listens for EJB bundles like this:
>         ServiceListener sl = new ServiceListener() {
>
>            public void serviceChanged(ServiceEvent ev) {
>                ServiceReference sr = ev.getServiceReference();
>                switch (ev.getType()) {
>
>                case ServiceEvent.REGISTERED:
>                    deployApplication(sr);
>                    break;
>
>                case ServiceEvent.UNREGISTERING:
>                    undeployApplication(sr);
>                    break;
>                }
>            }
>        };
>        // Generate a ServiceEvent for any existing OpenEJbApplication
> services.
>
>        String filter = "(objectclass=" + OpenEjbApplication.class.getName()
> + ")";
>        try {
>            bundleContext.addServiceListener(sl, filter);
>            ServiceReference[] srl =
> bundleContext.getServiceReferences(null, filter);
>            if (srl != null) {
>                for (ServiceReference sr : srl) {
>                    sl.serviceChanged(new
> ServiceEvent(ServiceEvent.REGISTERED, sr));
>                }
>            }
>        } catch (InvalidSyntaxException e) {
>            e.printStackTrace();
>        }
>
> The EJB bundle calls this on startup:
>
>        OpenEjbApplication application = new OpenEjbApplication(bundle);
>        context.registerService(OpenEjbApplication.class.getName(),
> application, null);


That's exactly how I wish it worked. OpenEJB would emit events upon
successful/unsuccessful deployment or any other interesting changes in
its work. Clean as far as OSGi's concerned. I didn't mean to introduce
any osgi changes in the main code before we really settle on it. I
didn't look at the source code of the plugin, but it turns out I'll
have to. Thanks.

Jacek

-- 
Jacek Laskowski
Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl

Re: For adventurous: first run of OSGified OpenEJB *seems* running fine

Posted by Jonathan Gallimore <jo...@gmail.com>.
I've been reading this thread with a lot of interest, this is looking like a
really nice piece of functionality. I've had a bit too much on my plate to
have a proper play around with this functionality but I'm hoping to get into
shortly.

>
>
> The missing pieces are to create a service bundle so JNDI namespace is
> visible to other bundles being ejb clients or exposing ejb interfaces
> as osgi services and finally create a osgified deployer (picks up
> instaled bundles that are ejbs as well, passes them to openejb and
> registers osgi services). Fancy helping out?
>

One thing I did mean to mention here was that in the Eclipse plugin we have
a org.apache.openejb.server plugin, which was contributed a while back by
Deryck Brown, to help build an Eclipse RCP application with OpenEJB embedded
in it. This contribution has some code which listens for certain services
being registered with the OSGi container, and deploying the app with
OpenEJB. The org.apache.openejb.server wraps all of OpenEJB presenting it as
one big bundle, and I've only had it working with Equinox, but I wonder
whether whether this code might be useful or not.

The plugin itself listens for EJB bundles like this:
         ServiceListener sl = new ServiceListener() {

            public void serviceChanged(ServiceEvent ev) {
                ServiceReference sr = ev.getServiceReference();
                switch (ev.getType()) {

                case ServiceEvent.REGISTERED:
                    deployApplication(sr);
                    break;

                case ServiceEvent.UNREGISTERING:
                    undeployApplication(sr);
                    break;
                }
            }
        };

        // Generate a ServiceEvent for any existing OpenEJbApplication
services.

        String filter = "(objectclass=" + OpenEjbApplication.class.getName()
+ ")";
        try {
            bundleContext.addServiceListener(sl, filter);
            ServiceReference[] srl =
bundleContext.getServiceReferences(null, filter);
            if (srl != null) {
                for (ServiceReference sr : srl) {
                    sl.serviceChanged(new
ServiceEvent(ServiceEvent.REGISTERED, sr));
                }
            }
        } catch (InvalidSyntaxException e) {
            e.printStackTrace();
        }

The EJB bundle calls this on startup:

        OpenEjbApplication application = new OpenEjbApplication(bundle);
        context.registerService(OpenEjbApplication.class.getName(),
application, null);


Anyway, I don't know if its any use, but I thought I'd mention it.

Thanks for the work you've done on this - hopefully I'll give it a go some
point this week and give you some feedback.

Jon

Re: For adventurous: first run of OSGified OpenEJB *seems* running fine

Posted by Mohammad Nour El-Din <no...@gmail.com>.
:S, errors again, Headers is attached :(


C:\program-files\felix-framework-2.0.1>%JAVA_HOME%\bin\java -jar
bin\felix.jar "cache\openejb"

Welcome to Felix
================

DEBUG: WIRE: 1.0 -> org.osgi.framework -> 0
DEBUG: WIRE: 1.0 -> org.osgi.service.log -> 2.0
DEBUG: WIRE: 1.0 -> org.osgi.service.url -> 0
DEBUG: WIRE: 2.0 -> org.osgi.framework -> 0
DEBUG: WIRE: 2.0 -> org.osgi.service.packageadmin -> 0
DEBUG: WIRE: 2.0 -> org.osgi.service.startlevel -> 0
DEBUG: DYNAMIC WIRE: 1.0 -> org.apache.felix.shell -> 2.0
DEBUG: WIRE: 3.0 -> org.apache.felix.shell -> 2.0
DEBUG: WIRE: 3.0 -> org.osgi.framework -> 0
-> ERROR: Error starting
file:C:\Users\mnour\.m2\repository\org\apache\openejb\openejb-core\3.1.2-SNAPSHOT\openejb-core-3.1.2-SNAPSHOT.jar
(org.osgi.framework.BundleException: Unresolved constraint in bundle
org
.apache.openejb.loader [25]: package;
(&(package=javax.transaction)(version>=5.0.0)))
org.osgi.framework.BundleException: Unresolved constraint in bundle
org.apache.openejb.loader [25]: package;
(&(package=javax.transaction)(version>=5.0.0))
        at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3263)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1597)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1077)
        at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
        at java.lang.Thread.run(Thread.java:619)
ps
START LEVEL 1
   ID   State         Level  Name
[   0] [Active     ] [    0] System Bundle (2.0.1)
[   1] [Active     ] [    1] Apache Felix Bundle Repository (1.4.2)
[   2] [Active     ] [    1] Apache Felix Shell Service (1.4.1)
[   3] [Active     ] [    1] Apache Felix Shell TUI (1.4.1)
[   5] [Installed  ] [    1] Apache OpenEJB :: Container :: Core
(3.1.2.SNAPSHOT)
[   6] [Installed  ] [    1] geronimo-annotation_1.0_spec (1.1.1)
[   8] [Installed  ] [    1] geronimo-jta_1.1_spec (1.1.1)
[   9] [Installed  ] [    1] geronimo-interceptor_3.0_spec (1.0.1)
[  10] [Installed  ] [    1] geronimo-javamail_1.4_spec (1.6)
[  11] [Installed  ] [    1] geronimo-j2ee-management_1.1_spec (1.0.1)
[  12] [Installed  ] [    1] geronimo-jpa_3.0_spec (1.1.1)
[  13] [Installed  ] [    1] geronimo-j2ee-connector_1.5_spec (2.0.0)
[  14] [Installed  ] [    1] J2EE JACC 1.1 (1.0.2)
[  15] [Installed  ] [    1] Apache ServiceMix Bundles: wsdl4j-1.6.1 (1.6.1.1)
[  16] [Installed  ] [    1] pluginName (1.0.0.v20080604-1500)
[  17] [Installed  ] [    1] Apache Jakarta Commons Lang (2.4.0.v20081016-1030)
[  18] [Installed  ] [    1] Apache Commons Logging Plug-in
(1.1.1.v200904062255)
[  19] [Installed  ] [    1] Geronimo TxManager :: Connector (2.1.3)
[  20] [Installed  ] [    1] Geronimo TxManager :: Transaction (2.1.3)
[  22] [Installed  ] [    1] Apache OpenEJB :: Container :: API (3.1.2.SNAPSHOT)
[  23] [Installed  ] [    1] Apache OpenEJB :: Container :: Java Agent
(3.1.2.SNAPSHOT)
[  24] [Installed  ] [    1] Apache OpenEJB :: Container :: Java EE
(3.1.2.SNAPSHOT)
[  25] [Installed  ] [    1] Apache OpenEJB :: Container :: Loader
(3.1.2.SNAPSHOT)
[  26] [Installed  ] [    1] Apache XBean :: ASM shaded (repackaged) (3.6)
[  27] [Installed  ] [    1] Apache XBean :: Finder shaded (repackaged) (3.6)
[  29] [Installed  ] [    1] Apache XBean :: Naming (3.6)
[  30] [Installed  ] [    1] Apache XBean :: Reflect (3.6)
[  31] [Installed  ] [    1] OPS4J Pax Logging - API (1.4)
[  32] [Installed  ] [    1] EJB 3.1 (1.0.0.EA1-SNAPSHOT)
-> inspect package requirement 25
org.apache.openejb.loader [25] imports packages:
------------------------------------------------
Nothing
-> inspect package requirement 5
org.apache.openejb.core [5] imports packages:
---------------------------------------------
Nothing
-> inspect package capability 25
org.apache.openejb.loader [25] exports packages:
------------------------------------------------
Nothing
-> inspect package capability 5
org.apache.openejb.core [5] exports packages:
---------------------------------------------
Nothing
->


On Mon, Nov 2, 2009 at 12:48 AM, Mohammad Nour El-Din
<no...@gmail.com> wrote:
> np :), thanks for the help.
>
> On Mon, Nov 2, 2009 at 12:46 AM, Jacek Laskowski <ja...@laskowski.net.pl> wrote:
>> On Sun, Nov 1, 2009 at 10:31 PM, Mohammad Nour El-Din
>> <no...@gmail.com> wrote:
>>
>>> ERROR: Error starting
>>> file:C:\Users\mnour\.m2\repository\org\apache\openejb\openejb-core\3.1.2-SNAPSHOT\openejb-core-3.1.2-SNAPSHOT.jar
>>> (org.osgi.framework.BundleException: Unresolved constraint in bundle
>>> org.apache.openejb.core [5]: package; (&(package=javax.ejb)(version>=3.1.0)))
>>> org.osgi.framework.BundleException: Unresolved constraint in bundle
>>> org.apache.openejb.core [5]: package;
>>> (&(package=javax.ejb)(version>=3.1.0))
>> ...
>>> [   7] [Installed  ] [    1] geronimo-ejb_3.0_spec (1.0.1)
>>
>> Uninstall this one (uninstall 7) and install
>> file:C:\.m2\org\apache\geronimo\specs\geronimo-ejb_3.1_spec\1.0.0-EA1-SNAPSHOT\geronimo-ejb_3.1_spec-1.0.0-EA1-SNAPSHOT.jar.
>> You'll have to build it from the sources at
>> http://svn.apache.org/repos/asf/geronimo/specs/trunk/geronimo-ejb_3.1_spec.
>>
>> It all was not necessary at the time I had described the steps, but
>> time passed and some changes were introduced for openejb-core which
>> made quite a bit difference in the way how OpenEJB osgified works now.
>> That's why you're facing the issues. Sorry.
>>
>> Jacek
>>
>> --
>> Jacek Laskowski
>> Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl
>>
>
>
>
> --
> Thanks
> - Mohammad Nour
> - LinkedIn: http://www.linkedin.com/in/mnour
> ----
> "Life is like riding a bicycle. To keep your balance you must keep moving"
> - Albert Einstein
>
> "Writing clean code is what you must do in order to call yourself a
> professional. There is no reasonable excuse for doing anything less
> than your best."
> - Clean Code: A Handbook of Agile Software Craftsmanship
>



-- 
Thanks
- Mohammad Nour
- LinkedIn: http://www.linkedin.com/in/mnour
----
"Life is like riding a bicycle. To keep your balance you must keep moving"
- Albert Einstein

"Writing clean code is what you must do in order to call yourself a
professional. There is no reasonable excuse for doing anything less
than your best."
- Clean Code: A Handbook of Agile Software Craftsmanship

Re: For adventurous: first run of OSGified OpenEJB *seems* running fine

Posted by Mohammad Nour El-Din <no...@gmail.com>.
np :), thanks for the help.

On Mon, Nov 2, 2009 at 12:46 AM, Jacek Laskowski <ja...@laskowski.net.pl> wrote:
> On Sun, Nov 1, 2009 at 10:31 PM, Mohammad Nour El-Din
> <no...@gmail.com> wrote:
>
>> ERROR: Error starting
>> file:C:\Users\mnour\.m2\repository\org\apache\openejb\openejb-core\3.1.2-SNAPSHOT\openejb-core-3.1.2-SNAPSHOT.jar
>> (org.osgi.framework.BundleException: Unresolved constraint in bundle
>> org.apache.openejb.core [5]: package; (&(package=javax.ejb)(version>=3.1.0)))
>> org.osgi.framework.BundleException: Unresolved constraint in bundle
>> org.apache.openejb.core [5]: package;
>> (&(package=javax.ejb)(version>=3.1.0))
> ...
>> [   7] [Installed  ] [    1] geronimo-ejb_3.0_spec (1.0.1)
>
> Uninstall this one (uninstall 7) and install
> file:C:\.m2\org\apache\geronimo\specs\geronimo-ejb_3.1_spec\1.0.0-EA1-SNAPSHOT\geronimo-ejb_3.1_spec-1.0.0-EA1-SNAPSHOT.jar.
> You'll have to build it from the sources at
> http://svn.apache.org/repos/asf/geronimo/specs/trunk/geronimo-ejb_3.1_spec.
>
> It all was not necessary at the time I had described the steps, but
> time passed and some changes were introduced for openejb-core which
> made quite a bit difference in the way how OpenEJB osgified works now.
> That's why you're facing the issues. Sorry.
>
> Jacek
>
> --
> Jacek Laskowski
> Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl
>



-- 
Thanks
- Mohammad Nour
- LinkedIn: http://www.linkedin.com/in/mnour
----
"Life is like riding a bicycle. To keep your balance you must keep moving"
- Albert Einstein

"Writing clean code is what you must do in order to call yourself a
professional. There is no reasonable excuse for doing anything less
than your best."
- Clean Code: A Handbook of Agile Software Craftsmanship

Re: For adventurous: first run of OSGified OpenEJB *seems* running fine

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On Sun, Nov 1, 2009 at 10:31 PM, Mohammad Nour El-Din
<no...@gmail.com> wrote:

> ERROR: Error starting
> file:C:\Users\mnour\.m2\repository\org\apache\openejb\openejb-core\3.1.2-SNAPSHOT\openejb-core-3.1.2-SNAPSHOT.jar
> (org.osgi.framework.BundleException: Unresolved constraint in bundle
> org.apache.openejb.core [5]: package; (&(package=javax.ejb)(version>=3.1.0)))
> org.osgi.framework.BundleException: Unresolved constraint in bundle
> org.apache.openejb.core [5]: package;
> (&(package=javax.ejb)(version>=3.1.0))
...
> [   7] [Installed  ] [    1] geronimo-ejb_3.0_spec (1.0.1)

Uninstall this one (uninstall 7) and install
file:C:\.m2\org\apache\geronimo\specs\geronimo-ejb_3.1_spec\1.0.0-EA1-SNAPSHOT\geronimo-ejb_3.1_spec-1.0.0-EA1-SNAPSHOT.jar.
You'll have to build it from the sources at
http://svn.apache.org/repos/asf/geronimo/specs/trunk/geronimo-ejb_3.1_spec.

It all was not necessary at the time I had described the steps, but
time passed and some changes were introduced for openejb-core which
made quite a bit difference in the way how OpenEJB osgified works now.
That's why you're facing the issues. Sorry.

Jacek

-- 
Jacek Laskowski
Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl

Re: For adventurous: first run of OSGified OpenEJB *seems* running fine

Posted by Mohammad Nour El-Din <no...@gmail.com>.
Hey Jacek...

   I gave a shot tonight and I got this error, pleas help :(, I also
attached the headers.

Welcome to Felix
================

DEBUG: WIRE: 2.0 -> org.osgi.framework -> 0
DEBUG: WIRE: 2.0 -> org.osgi.service.packageadmin -> 0
DEBUG: WIRE: 2.0 -> org.osgi.service.startlevel -> 0
DEBUG: WIRE: 1.0 -> org.osgi.framework -> 0
DEBUG: WIRE: 1.0 -> org.osgi.service.log -> 2.0
DEBUG: WIRE: 1.0 -> org.osgi.service.url -> 0
DEBUG: DYNAMIC WIRE: 1.0 -> org.apache.felix.shell -> 2.0
DEBUG: WIRE: 3.0 -> org.apache.felix.shell -> 2.0
DEBUG: WIRE: 3.0 -> org.osgi.framework -> 0
ERROR: Error starting
file:C:\Users\mnour\.m2\repository\org\apache\openejb\openejb-core\3.1.2-SNAPSHOT\openejb-core-3.1.2-SNAPSHOT.jar
(org.osgi.framework.BundleException: Unresolved constraint in bundle
org.ap
ache.openejb.core [5]: package; (&(package=javax.ejb)(version>=3.1.0)))
org.osgi.framework.BundleException: Unresolved constraint in bundle
org.apache.openejb.core [5]: package;
(&(package=javax.ejb)(version>=3.1.0))
->      at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3263)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1597)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1077)
        at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
        at java.lang.Thread.run(Thread.java:619)
inspect package cpability 5
Invalid argument: cpability
-> inspect package capability 5
org.apache.openejb.core [5] exports packages:
---------------------------------------------
Nothing
-> inspect package requirement 5
org.apache.openejb.core [5] imports packages:
---------------------------------------------
Nothing
-> ps
START LEVEL 1
   ID   State         Level  Name
[   0] [Active     ] [    0] System Bundle (2.0.1)
[   1] [Active     ] [    1] Apache Felix Bundle Repository (1.4.2)
[   2] [Active     ] [    1] Apache Felix Shell Service (1.4.1)
[   3] [Active     ] [    1] Apache Felix Shell TUI (1.4.1)
[   5] [Installed  ] [    1] Apache OpenEJB :: Container :: Core
(3.1.2.SNAPSHOT)
[   6] [Installed  ] [    1] geronimo-annotation_1.0_spec (1.1.1)
[   7] [Installed  ] [    1] geronimo-ejb_3.0_spec (1.0.1)
[   8] [Installed  ] [    1] geronimo-jta_1.1_spec (1.1.1)
[   9] [Installed  ] [    1] geronimo-interceptor_3.0_spec (1.0.1)
[  10] [Installed  ] [    1] geronimo-javamail_1.4_spec (1.6)
[  11] [Installed  ] [    1] geronimo-j2ee-management_1.1_spec (1.0.1)
[  12] [Installed  ] [    1] geronimo-jpa_3.0_spec (1.1.1)
[  13] [Installed  ] [    1] geronimo-j2ee-connector_1.5_spec (2.0.0)
[  14] [Installed  ] [    1] J2EE JACC 1.1 (1.0.2)
[  15] [Installed  ] [    1] Apache ServiceMix Bundles: wsdl4j-1.6.1 (1.6.1.1)
[  16] [Installed  ] [    1] pluginName (1.0.0.v20080604-1500)
[  17] [Installed  ] [    1] Apache Jakarta Commons Lang (2.4.0.v20081016-1030)
[  18] [Installed  ] [    1] Apache Commons Logging Plug-in
(1.1.1.v200904062255)
[  19] [Installed  ] [    1] Geronimo TxManager :: Connector (2.1.3)
[  20] [Installed  ] [    1] Geronimo TxManager :: Transaction (2.1.3)
[  22] [Installed  ] [    1] Apache OpenEJB :: Container :: API (3.1.2.SNAPSHOT)
[  23] [Installed  ] [    1] Apache OpenEJB :: Container :: Java Agent
(3.1.2.SNAPSHOT)
[  24] [Installed  ] [    1] Apache OpenEJB :: Container :: Java EE
(3.1.2.SNAPSHOT)
[  25] [Installed  ] [    1] Apache OpenEJB :: Container :: Loader
(3.1.2.SNAPSHOT)
[  26] [Installed  ] [    1] Apache XBean :: ASM shaded (repackaged) (3.6)
[  27] [Installed  ] [    1] Apache XBean :: Finder shaded (repackaged) (3.6)
[  29] [Installed  ] [    1] Apache XBean :: Naming (3.6)
[  30] [Installed  ] [    1] Apache XBean :: Reflect (3.6)
[  31] [Installed  ] [    1] OPS4J Pax Logging - API (1.4)

On Thu, Oct 29, 2009 at 9:36 PM, Jacek Laskowski <ja...@laskowski.net.pl> wrote:
> On Thu, Oct 29, 2009 at 6:15 PM, Quintin Beukes <qu...@skywalk.co.za> wrote:
>> How much of the actual OpenEJB code changes to do a shift like this (to
>> OSGi)?
>
> Almost nothing. The goal was to make as less changes as possible and
> introduce some to make openejb more modular. The bundles are in fact
> the maven modules themselves. Just add/remove imports/exports and it
> begun working with not much hassle on my part. I was really surprised
> when openejb booted up in osgi.
>
> OSGi is just an enhanced classloader platform with a notion of
> services. Each bundle is to provide exports for the other bundles
> which import them. That's the way class visibility is handled. The
> other part of OSGi is the service layer. That's exactly how EJB3
> works. You expose a business intf and that's what you see from a
> client's perspective - no real implementation. In OSGi you register a
> service in the service registry with a set of interfaces backed by an
> implementation. When a bundle is started its activator is fired that's
> in turn registers itself as a service provider or a service consumer.
> Throw some listeners into it and that's what OSGi is all about. Easy
> :)
>
> Jacek
>
> --
> Jacek Laskowski
> Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl
>



-- 
Thanks
- Mohammad Nour
- LinkedIn: http://www.linkedin.com/in/mnour
----
"Life is like riding a bicycle. To keep your balance you must keep moving"
- Albert Einstein

"Writing clean code is what you must do in order to call yourself a
professional. There is no reasonable excuse for doing anything less
than your best."
- Clean Code: A Handbook of Agile Software Craftsmanship

Re: For adventurous: first run of OSGified OpenEJB *seems* running fine

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On Thu, Oct 29, 2009 at 6:15 PM, Quintin Beukes <qu...@skywalk.co.za> wrote:
> How much of the actual OpenEJB code changes to do a shift like this (to
> OSGi)?

Almost nothing. The goal was to make as less changes as possible and
introduce some to make openejb more modular. The bundles are in fact
the maven modules themselves. Just add/remove imports/exports and it
begun working with not much hassle on my part. I was really surprised
when openejb booted up in osgi.

OSGi is just an enhanced classloader platform with a notion of
services. Each bundle is to provide exports for the other bundles
which import them. That's the way class visibility is handled. The
other part of OSGi is the service layer. That's exactly how EJB3
works. You expose a business intf and that's what you see from a
client's perspective - no real implementation. In OSGi you register a
service in the service registry with a set of interfaces backed by an
implementation. When a bundle is started its activator is fired that's
in turn registers itself as a service provider or a service consumer.
Throw some listeners into it and that's what OSGi is all about. Easy
:)

Jacek

-- 
Jacek Laskowski
Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl

Re: For adventurous: first run of OSGified OpenEJB *seems* running fine

Posted by Quintin Beukes <qu...@skywalk.co.za>.
How much of the actual OpenEJB code changes to do a shift like this (to
OSGi)?

Quintin Beukes


On Thu, Oct 29, 2009 at 12:33 PM, Jean-Louis MONTEIRO <
jean-louis.monteiro@atosorigin.com> wrote:

>
> Guillaume,
>
> Have a look here.
>
> http://svn.apache.org/repos/asf/openejb/trunk/sandbox/openejb-osgi/openejb-core-osgi/src/main/filtered-resources/features.xml
>
> http://svn.apache.org/repos/asf/openejb/trunk/sandbox/openejb-osgi/openejb-core-osgi/src/main/filtered-resources/features.xml
>
> Jean-Louis
>
>
> gnodet wrote:
> >
> > Btw, I was going to have a look at the features descriptor but could
> > not find it in svn ...  Has it been checked in already ?
> >
> > On Thu, Oct 29, 2009 at 10:56, Jean-Louis MONTEIRO
> > <je...@atosorigin.com> wrote:
> >>
> >>
> >>> First of all, i went to Felix-Karaf 1.0.0 which is a bit for user
> >>> friendly
> >>
> >> I've been wondering what Karaf was having seen it in use in Geronimo
> >> osgification. I'm glad you used it so I'm encourage to do so if it
> >> gets things easier.
> >>
> >>
> >> Jacek Laskowski wrote:
> >>>
> >>> Actually, Karaf relies on Felix for its OSGi platform. But it provides
> a
> >>> set of useful tools and configuration.
> >>> Some details are available here
> >>> http://felix.apache.org/site/apache-felix-karaf.html
> >>>
> >>
> >>> 1. For some strange reasons, installing osgi bundles using Pax mvn url
> >>> handler didn't run fine (not able to find my proxy settings).
> >>
> >> Why did you have to use it at all? Was it as a replacement for
> >> installing bundles from maven repos using http?
> >>
> >>
> >> Jacek Laskowski wrote:
> >>>
> >>> Absolutely!
> >>> I like the idea to use maven behavior to install bundles.
> >>> I mean osgi:install mvn:<groupId>/<artifactId>/<version> instead of
> >>> specifying a repository with an hard coded URL.
> >>>
> >>
> >>
> >>> 2. I played with information from your mail. It was useful but too
> >>> heavy.
> >>
> >> It will get easier when I (or someone else) prepare appropriate config
> >> file and the necessary bundles get installed automatically. Anyway,
> >> I'm all ears to hear how the process can get simpler.
> >>
> >>
> >> Jacek Laskowski wrote:
> >>>
> >>> Using features is easier.
> >>> I changed the openejb-core-osgi module to add features
> >>> generation/deployment on maven.
> >>>
> >>
> >>> 3. To eases installation i started changing some stuff either in
> OpenEJB
> >>> or
> >>> in your OSGI module.
> >>> The result is a set of features. But, i'm facing an issue with
> >>> openejb-loader and openejb-core.
> >>>
> >>> Basically, we have openejb-core depending on openejb-loader.
> >>> And openejb-loader declares a required bundle: openejb-core. I would be
> >>> nice
> >>> to get rid of this dependency.
> >>
> >> +1 if it gets the osgification simpler. Having a bundle required is
> >> just a way to link bundles together and they can get installed by not
> >> started. Starting a bundle resolves imports so it's not a cyclic
> >> dependency because only openejb-core has to be started.
> >>
> >>
> >> Jacek Laskowski wrote:
> >>>
> >>> I got it working even if i'm not really happy with. IMO, we should
> >>> review
> >>> loader stuff.
> >>> For example, in the Activator, the loader is used to initialize the
> >>> container whereas OpenEJB.destroy() is directly used to shutdown the
> >>> container.
> >>>
> >>
> >>> With features, you just need to do:
> >>>
> >>> features:addUrl
> >>> mvn:org.apache.openejb/openejb-core-osgi/3.1.2-SNAPSHOT/xml/features
> >>>
> >>> features:list outputs
> >>> karaf@root> features:list
> >>> State         Version          Name                   Repository
> >>> [uninstalled] [5.0-2         ] javaee-api             repo-0
> >>> [uninstalled] [3.1.2-SNAPSHOT] openejb-loader         repo-0
> >>> [uninstalled] [3.1.2-SNAPSHOT] openejb-api            repo-0
> >>> [uninstalled] [3.1.2-SNAPSHOT] openejb-javaagent      repo-0
> >>> [uninstalled] [3.1.2-SNAPSHOT] openejb-jee            repo-0
> >>> [uninstalled] [3.1.2-SNAPSHOT] ejb31-api-experimental repo-0
> >>> [uninstalled] [3.1.2-SNAPSHOT] openejb-core           repo-0
> >>> [uninstalled] [3.1.2-SNAPSHOT] openejb-core-osgi      repo-0
> >>> [uninstalled] [2.5.6.SEC01   ] spring                 karaf-1.0.0
> >>> [uninstalled] [1.2.0         ] spring-dm              karaf-1.0.0
> >>> [uninstalled] [1.0.0         ] wrapper                karaf-1.0.0
> >>> [uninstalled] [1.0.0         ] obr                    karaf-1.0.0
> >>> [uninstalled] [1.0.0         ] http                   karaf-1.0.0
> >>> [uninstalled] [1.0.0         ] webconsole             karaf-1.0.0
> >>> [installed  ] [1.0.0         ] ssh                    karaf-1.0.0
> >>> [installed  ] [1.0.0         ] management             karaf-1.0.0
> >>
> >> I don't understand it yet - it looks karaf-specific which I would
> >> avoid unless it's required. Could you explain what it is for?
> >>
> >>
> >> Jacek Laskowski wrote:
> >>>
> >>> May be the best, is to try it!
> >>> Basically, a feature is a set of bundles.
> >>> For example, instead of installing all APIs using something like
> >>> # install osgi bundles using mvn url handler
> >>> osgi:install
> >>> mvn:org.apache.geronimo.specs/geronimo-activation_1.1_spec/1.0.2
> >>> osgi:install
> >>> mvn:org.apache.geronimo.specs/geronimo-javamail_1.4_spec/1.6
> >>> osgi:install
> >>> mvn:org.apache.geronimo.specs/geronimo-annotation_1.0_spec/1.1.1
> >>> osgi:install mvn:org.apache.geronimo.specs/geronimo-ejb_3.0_spec/1.0.1
> >>> osgi:install
> >>> mvn:org.apache.geronimo.specs/geronimo-interceptor_3.0_spec/1.0.1
> >>> osgi:install
> >>> mvn:org.apache.geronimo.specs/geronimo-j2ee-connector_1.5_spec/2.0.0
> >>> osgi:install
> >>> mvn:org.apache.geronimo.specs/geronimo-j2ee-deployment_1.1_spec/1.1
> >>> ...
> >>>
> >>> you just need to do a features:install javaee-api.
> >>>
> >>>
> >>
> >> Regarding logging, i had an issue with our log4j usage.
> >> On Karaf, Pax Logging is installed be default so you can use the Log4j
> >> logger in your application, but you cannot use internal APIs (have a
> look
> >> here  http://lists.ops4j.org/pipermail/general/2009q3/002509.html
> >> http://lists.ops4j.org/pipermail/general/2009q3/002509.html ). So I got
> a
> >> ClassNotFoundException with org/apache/log4j/Layout.
> >>
> >> By the way, I saw your activation code afterward, specially
> >> env.setProperty("openejb.log.factory",
> >> "org.apache.openejb.util.JuliLogStreamFactory");
> >>
> >> But it didn't work for me.
> >> In the org.apache.openejb.util.Logger class, we do
> >> System.getProperty("openejb.log.factory") instead of
> >> SystemInstance.get().getProperty("openejb.log.factory");
> >>
> >> I changed some other code to avoid System property usage and now it
> works
> >> (or it should work) if you provide a embedded.juli.properties in the
> >> bundle.
> >>
> >> Another solution is to create a conf/ directory in KARAF_HOME
> >> (=OPENEJB_HOME).
> >>
> >> Anyway, just for fun :) i change the Log4jLogStreamFactory to be able to
> >> use
> >> Log4j with OSGi and PaxLogging.
> >>
> >> Jean-Louis
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/For-adventurous%3A-first-run-of-OSGified-OpenEJB-*seems*-running-fine-tp26033567p26110134.html
> >> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> >
> > --
> > Cheers,
> > Guillaume Nodet
> > ------------------------
> > Blog: http://gnodet.blogspot.com/
> > ------------------------
> > Open Source SOA
> > http://fusesource.com
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/For-adventurous%3A-first-run-of-OSGified-OpenEJB-*seems*-running-fine-tp26033567p26110631.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>
>

Re: For adventurous: first run of OSGified OpenEJB *seems* running fine

Posted by Jean-Louis MONTEIRO <je...@atosorigin.com>.
Guillaume,

Have a look here.
http://svn.apache.org/repos/asf/openejb/trunk/sandbox/openejb-osgi/openejb-core-osgi/src/main/filtered-resources/features.xml
http://svn.apache.org/repos/asf/openejb/trunk/sandbox/openejb-osgi/openejb-core-osgi/src/main/filtered-resources/features.xml 

Jean-Louis


gnodet wrote:
> 
> Btw, I was going to have a look at the features descriptor but could
> not find it in svn ...  Has it been checked in already ?
> 
> On Thu, Oct 29, 2009 at 10:56, Jean-Louis MONTEIRO
> <je...@atosorigin.com> wrote:
>>
>>
>>> First of all, i went to Felix-Karaf 1.0.0 which is a bit for user
>>> friendly
>>
>> I've been wondering what Karaf was having seen it in use in Geronimo
>> osgification. I'm glad you used it so I'm encourage to do so if it
>> gets things easier.
>>
>>
>> Jacek Laskowski wrote:
>>>
>>> Actually, Karaf relies on Felix for its OSGi platform. But it provides a
>>> set of useful tools and configuration.
>>> Some details are available here
>>> http://felix.apache.org/site/apache-felix-karaf.html
>>>
>>
>>> 1. For some strange reasons, installing osgi bundles using Pax mvn url
>>> handler didn't run fine (not able to find my proxy settings).
>>
>> Why did you have to use it at all? Was it as a replacement for
>> installing bundles from maven repos using http?
>>
>>
>> Jacek Laskowski wrote:
>>>
>>> Absolutely!
>>> I like the idea to use maven behavior to install bundles.
>>> I mean osgi:install mvn:<groupId>/<artifactId>/<version> instead of
>>> specifying a repository with an hard coded URL.
>>>
>>
>>
>>> 2. I played with information from your mail. It was useful but too
>>> heavy.
>>
>> It will get easier when I (or someone else) prepare appropriate config
>> file and the necessary bundles get installed automatically. Anyway,
>> I'm all ears to hear how the process can get simpler.
>>
>>
>> Jacek Laskowski wrote:
>>>
>>> Using features is easier.
>>> I changed the openejb-core-osgi module to add features
>>> generation/deployment on maven.
>>>
>>
>>> 3. To eases installation i started changing some stuff either in OpenEJB
>>> or
>>> in your OSGI module.
>>> The result is a set of features. But, i'm facing an issue with
>>> openejb-loader and openejb-core.
>>>
>>> Basically, we have openejb-core depending on openejb-loader.
>>> And openejb-loader declares a required bundle: openejb-core. I would be
>>> nice
>>> to get rid of this dependency.
>>
>> +1 if it gets the osgification simpler. Having a bundle required is
>> just a way to link bundles together and they can get installed by not
>> started. Starting a bundle resolves imports so it's not a cyclic
>> dependency because only openejb-core has to be started.
>>
>>
>> Jacek Laskowski wrote:
>>>
>>> I got it working even if i'm not really happy with. IMO, we should
>>> review
>>> loader stuff.
>>> For example, in the Activator, the loader is used to initialize the
>>> container whereas OpenEJB.destroy() is directly used to shutdown the
>>> container.
>>>
>>
>>> With features, you just need to do:
>>>
>>> features:addUrl
>>> mvn:org.apache.openejb/openejb-core-osgi/3.1.2-SNAPSHOT/xml/features
>>>
>>> features:list outputs
>>> karaf@root> features:list
>>> State         Version          Name                   Repository
>>> [uninstalled] [5.0-2         ] javaee-api             repo-0
>>> [uninstalled] [3.1.2-SNAPSHOT] openejb-loader         repo-0
>>> [uninstalled] [3.1.2-SNAPSHOT] openejb-api            repo-0
>>> [uninstalled] [3.1.2-SNAPSHOT] openejb-javaagent      repo-0
>>> [uninstalled] [3.1.2-SNAPSHOT] openejb-jee            repo-0
>>> [uninstalled] [3.1.2-SNAPSHOT] ejb31-api-experimental repo-0
>>> [uninstalled] [3.1.2-SNAPSHOT] openejb-core           repo-0
>>> [uninstalled] [3.1.2-SNAPSHOT] openejb-core-osgi      repo-0
>>> [uninstalled] [2.5.6.SEC01   ] spring                 karaf-1.0.0
>>> [uninstalled] [1.2.0         ] spring-dm              karaf-1.0.0
>>> [uninstalled] [1.0.0         ] wrapper                karaf-1.0.0
>>> [uninstalled] [1.0.0         ] obr                    karaf-1.0.0
>>> [uninstalled] [1.0.0         ] http                   karaf-1.0.0
>>> [uninstalled] [1.0.0         ] webconsole             karaf-1.0.0
>>> [installed  ] [1.0.0         ] ssh                    karaf-1.0.0
>>> [installed  ] [1.0.0         ] management             karaf-1.0.0
>>
>> I don't understand it yet - it looks karaf-specific which I would
>> avoid unless it's required. Could you explain what it is for?
>>
>>
>> Jacek Laskowski wrote:
>>>
>>> May be the best, is to try it!
>>> Basically, a feature is a set of bundles.
>>> For example, instead of installing all APIs using something like
>>> # install osgi bundles using mvn url handler
>>> osgi:install
>>> mvn:org.apache.geronimo.specs/geronimo-activation_1.1_spec/1.0.2
>>> osgi:install
>>> mvn:org.apache.geronimo.specs/geronimo-javamail_1.4_spec/1.6
>>> osgi:install
>>> mvn:org.apache.geronimo.specs/geronimo-annotation_1.0_spec/1.1.1
>>> osgi:install mvn:org.apache.geronimo.specs/geronimo-ejb_3.0_spec/1.0.1
>>> osgi:install
>>> mvn:org.apache.geronimo.specs/geronimo-interceptor_3.0_spec/1.0.1
>>> osgi:install
>>> mvn:org.apache.geronimo.specs/geronimo-j2ee-connector_1.5_spec/2.0.0
>>> osgi:install
>>> mvn:org.apache.geronimo.specs/geronimo-j2ee-deployment_1.1_spec/1.1
>>> ...
>>>
>>> you just need to do a features:install javaee-api.
>>>
>>>
>>
>> Regarding logging, i had an issue with our log4j usage.
>> On Karaf, Pax Logging is installed be default so you can use the Log4j
>> logger in your application, but you cannot use internal APIs (have a look
>> here  http://lists.ops4j.org/pipermail/general/2009q3/002509.html
>> http://lists.ops4j.org/pipermail/general/2009q3/002509.html ). So I got a
>> ClassNotFoundException with org/apache/log4j/Layout.
>>
>> By the way, I saw your activation code afterward, specially
>> env.setProperty("openejb.log.factory",
>> "org.apache.openejb.util.JuliLogStreamFactory");
>>
>> But it didn't work for me.
>> In the org.apache.openejb.util.Logger class, we do
>> System.getProperty("openejb.log.factory") instead of
>> SystemInstance.get().getProperty("openejb.log.factory");
>>
>> I changed some other code to avoid System property usage and now it works
>> (or it should work) if you provide a embedded.juli.properties in the
>> bundle.
>>
>> Another solution is to create a conf/ directory in KARAF_HOME
>> (=OPENEJB_HOME).
>>
>> Anyway, just for fun :) i change the Log4jLogStreamFactory to be able to
>> use
>> Log4j with OSGi and PaxLogging.
>>
>> Jean-Louis
>> --
>> View this message in context:
>> http://www.nabble.com/For-adventurous%3A-first-run-of-OSGified-OpenEJB-*seems*-running-fine-tp26033567p26110134.html
>> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
> 
> 

-- 
View this message in context: http://www.nabble.com/For-adventurous%3A-first-run-of-OSGified-OpenEJB-*seems*-running-fine-tp26033567p26110631.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.


Re: For adventurous: first run of OSGified OpenEJB *seems* running fine

Posted by Guillaume Nodet <gn...@gmail.com>.
Btw, I was going to have a look at the features descriptor but could
not find it in svn ...  Has it been checked in already ?

On Thu, Oct 29, 2009 at 10:56, Jean-Louis MONTEIRO
<je...@atosorigin.com> wrote:
>
>
>> First of all, i went to Felix-Karaf 1.0.0 which is a bit for user friendly
>
> I've been wondering what Karaf was having seen it in use in Geronimo
> osgification. I'm glad you used it so I'm encourage to do so if it
> gets things easier.
>
>
> Jacek Laskowski wrote:
>>
>> Actually, Karaf relies on Felix for its OSGi platform. But it provides a
>> set of useful tools and configuration.
>> Some details are available here
>> http://felix.apache.org/site/apache-felix-karaf.html
>>
>
>> 1. For some strange reasons, installing osgi bundles using Pax mvn url
>> handler didn't run fine (not able to find my proxy settings).
>
> Why did you have to use it at all? Was it as a replacement for
> installing bundles from maven repos using http?
>
>
> Jacek Laskowski wrote:
>>
>> Absolutely!
>> I like the idea to use maven behavior to install bundles.
>> I mean osgi:install mvn:<groupId>/<artifactId>/<version> instead of
>> specifying a repository with an hard coded URL.
>>
>
>
>> 2. I played with information from your mail. It was useful but too heavy.
>
> It will get easier when I (or someone else) prepare appropriate config
> file and the necessary bundles get installed automatically. Anyway,
> I'm all ears to hear how the process can get simpler.
>
>
> Jacek Laskowski wrote:
>>
>> Using features is easier.
>> I changed the openejb-core-osgi module to add features
>> generation/deployment on maven.
>>
>
>> 3. To eases installation i started changing some stuff either in OpenEJB
>> or
>> in your OSGI module.
>> The result is a set of features. But, i'm facing an issue with
>> openejb-loader and openejb-core.
>>
>> Basically, we have openejb-core depending on openejb-loader.
>> And openejb-loader declares a required bundle: openejb-core. I would be
>> nice
>> to get rid of this dependency.
>
> +1 if it gets the osgification simpler. Having a bundle required is
> just a way to link bundles together and they can get installed by not
> started. Starting a bundle resolves imports so it's not a cyclic
> dependency because only openejb-core has to be started.
>
>
> Jacek Laskowski wrote:
>>
>> I got it working even if i'm not really happy with. IMO, we should review
>> loader stuff.
>> For example, in the Activator, the loader is used to initialize the
>> container whereas OpenEJB.destroy() is directly used to shutdown the
>> container.
>>
>
>> With features, you just need to do:
>>
>> features:addUrl
>> mvn:org.apache.openejb/openejb-core-osgi/3.1.2-SNAPSHOT/xml/features
>>
>> features:list outputs
>> karaf@root> features:list
>> State         Version          Name                   Repository
>> [uninstalled] [5.0-2         ] javaee-api             repo-0
>> [uninstalled] [3.1.2-SNAPSHOT] openejb-loader         repo-0
>> [uninstalled] [3.1.2-SNAPSHOT] openejb-api            repo-0
>> [uninstalled] [3.1.2-SNAPSHOT] openejb-javaagent      repo-0
>> [uninstalled] [3.1.2-SNAPSHOT] openejb-jee            repo-0
>> [uninstalled] [3.1.2-SNAPSHOT] ejb31-api-experimental repo-0
>> [uninstalled] [3.1.2-SNAPSHOT] openejb-core           repo-0
>> [uninstalled] [3.1.2-SNAPSHOT] openejb-core-osgi      repo-0
>> [uninstalled] [2.5.6.SEC01   ] spring                 karaf-1.0.0
>> [uninstalled] [1.2.0         ] spring-dm              karaf-1.0.0
>> [uninstalled] [1.0.0         ] wrapper                karaf-1.0.0
>> [uninstalled] [1.0.0         ] obr                    karaf-1.0.0
>> [uninstalled] [1.0.0         ] http                   karaf-1.0.0
>> [uninstalled] [1.0.0         ] webconsole             karaf-1.0.0
>> [installed  ] [1.0.0         ] ssh                    karaf-1.0.0
>> [installed  ] [1.0.0         ] management             karaf-1.0.0
>
> I don't understand it yet - it looks karaf-specific which I would
> avoid unless it's required. Could you explain what it is for?
>
>
> Jacek Laskowski wrote:
>>
>> May be the best, is to try it!
>> Basically, a feature is a set of bundles.
>> For example, instead of installing all APIs using something like
>> # install osgi bundles using mvn url handler
>> osgi:install
>> mvn:org.apache.geronimo.specs/geronimo-activation_1.1_spec/1.0.2
>> osgi:install mvn:org.apache.geronimo.specs/geronimo-javamail_1.4_spec/1.6
>> osgi:install
>> mvn:org.apache.geronimo.specs/geronimo-annotation_1.0_spec/1.1.1
>> osgi:install mvn:org.apache.geronimo.specs/geronimo-ejb_3.0_spec/1.0.1
>> osgi:install
>> mvn:org.apache.geronimo.specs/geronimo-interceptor_3.0_spec/1.0.1
>> osgi:install
>> mvn:org.apache.geronimo.specs/geronimo-j2ee-connector_1.5_spec/2.0.0
>> osgi:install
>> mvn:org.apache.geronimo.specs/geronimo-j2ee-deployment_1.1_spec/1.1
>> ...
>>
>> you just need to do a features:install javaee-api.
>>
>>
>
> Regarding logging, i had an issue with our log4j usage.
> On Karaf, Pax Logging is installed be default so you can use the Log4j
> logger in your application, but you cannot use internal APIs (have a look
> here  http://lists.ops4j.org/pipermail/general/2009q3/002509.html
> http://lists.ops4j.org/pipermail/general/2009q3/002509.html ). So I got a
> ClassNotFoundException with org/apache/log4j/Layout.
>
> By the way, I saw your activation code afterward, specially
> env.setProperty("openejb.log.factory",
> "org.apache.openejb.util.JuliLogStreamFactory");
>
> But it didn't work for me.
> In the org.apache.openejb.util.Logger class, we do
> System.getProperty("openejb.log.factory") instead of
> SystemInstance.get().getProperty("openejb.log.factory");
>
> I changed some other code to avoid System property usage and now it works
> (or it should work) if you provide a embedded.juli.properties in the bundle.
>
> Another solution is to create a conf/ directory in KARAF_HOME
> (=OPENEJB_HOME).
>
> Anyway, just for fun :) i change the Log4jLogStreamFactory to be able to use
> Log4j with OSGi and PaxLogging.
>
> Jean-Louis
> --
> View this message in context: http://www.nabble.com/For-adventurous%3A-first-run-of-OSGified-OpenEJB-*seems*-running-fine-tp26033567p26110134.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com