openejb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Louis MONTEIRO <jean-louis.monte...@atosorigin.com>
Subject Re: For adventurous: first run of OSGified OpenEJB *seems* running fine
Date Thu, 29 Oct 2009 09:56:42 GMT


> 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.


Mime
View raw message