Re: OpenEJB and OSGi

2009-07-02 Thread Jonathan Gallimore
Hi Deryck,

I was just about to type something up about OSGi when I found your e-mail -
sorry I missed it, I was on holiday and forgot to reply when I got back.

Thanks for getting back to me on this. I have been playing around with this
some more, and I've managed to get around using the FileLocator API I think,
by grabbing what we need from the bundle and creating a temporary jar and
deploying that. If I then temporarily comment out the Variables code, I now
have something that starts in both Equinox and Felix.

I think the variable expansion code is definitely nice to have - I'll see if
I can refactor it so that if the variables bundle is available then we use,
otherwise we try and carry on without it. I'll try wrapping it in a
syncronized block too, and see if that sorts out the exception I was having.

I'm also going to see if I can add something to start the various daemons
that you get in "remotable" mode, it seems that xbean-finder can't find the
OpenEJB service classes inside an OSGi bundle, so you need to create these
manually at the moment. I might see if I can patch xbean-finder, or if I
can't, add some code to start these service manually in the
org.apache.openejb.server bundle.

As OSGi support has been discussed a few times now, and we have a pretty
good OSGi bundle now, I think it would be quite nice to make these
improvements, extend our support to other OSGi containers, and add to our
documentation (I'm thinking of a screencast demonstrating all of this in
Eclipse).

Anyone have any thoughts on any of this?

Jon

On Thu, Jun 11, 2009 at 9:01 AM, Brown, Deryck wrote:

> Hi Jonathan,
>
> Sorry for not responding sooner. This is what happens when you have
> email rules to put postings in a separate folder, and only scan them
> briefly...
>
> On the issues you encountered:
>
> Does the ConcurrentModificationException go away if you wrap the body of
> addPropertyVariables in a "synchronized (properties) {...}" block?
>
> The effect of not adding the System properties to the variables will
> simply prevent variable expansion of these property names in OpenEJB
> properties. So no "${user.home}" in your database URL for example.
>
> I agree that the use of FileLocator is an unfortunate feature of getting
> Eclipse plug-ins to work with OpenEJB. An alternative would require
> OpenEJB to understand the "bundle:" URI protocol at a much deeper level
> (I'm sure I've seen previous posts on this subject), but I'm not sure
> how you can avoid mapping URIs to real files/paths at some point in the
> process of deploying an application.
>
> The code that requires org.eclipse.core.variables just relates to my
> need to expand property values with references to values such as
> "${user.home}". It would be possible but tedious to implement variable
> expansion in the plug-in directly (I think I had a version that did this
> originally), but why keep re-inventing the wheel?
>
> We could probably refactor the code so that org.eclipse.core.variables
> was optional, and the plug-in only loads it when the application
> actively uses variable expansion because properties contain embedded
> references.
>
> Regards,
> Deryck
>
> -Original Message-
> From: Jonathan Gallimore [mailto:jonathan.gallim...@gmail.com]
> Sent: 10 May 2009 14:34
> To: users@openejb.apache.org
> Subject: Re: OpenEJB and OSGi
>
> ...
>
> A couple of issues I noticed when putting this together:
>
> * I encountered a ConcurrentModificationException caused by adding
> System.getProperties() to a IStringVariableManager, commenting out line
> 44:
> addPropertyVariables(System.getProperties()); in OpenEjbPlugin resolved
> this, and everything seemed to work, but I don't know what the effect of
> this will be - Deryck, do you have any thoughts on this?
>
> * We make a fair bit of use org.eclipse.core.runtime.FileLocator which
> converts URLs of resources in OSGi bundles to URLs on the file system -
> I think I'm right in thinking that this is an Equinox / Eclipse specific
> thing and probably won't work in other OSGi implementations. I think it
> would be nice if we can find a way of not requiring
> org.eclipse.core.runtime or org.eclipse.core.variables.
>
> Jon
>


RE: OpenEJB and OSGi

2009-06-11 Thread Brown, Deryck
Hi Jonathan,

Sorry for not responding sooner. This is what happens when you have
email rules to put postings in a separate folder, and only scan them
briefly... 

On the issues you encountered:

Does the ConcurrentModificationException go away if you wrap the body of
addPropertyVariables in a "synchronized (properties) {...}" block?

The effect of not adding the System properties to the variables will
simply prevent variable expansion of these property names in OpenEJB
properties. So no "${user.home}" in your database URL for example.

I agree that the use of FileLocator is an unfortunate feature of getting
Eclipse plug-ins to work with OpenEJB. An alternative would require
OpenEJB to understand the "bundle:" URI protocol at a much deeper level
(I'm sure I've seen previous posts on this subject), but I'm not sure
how you can avoid mapping URIs to real files/paths at some point in the
process of deploying an application.

The code that requires org.eclipse.core.variables just relates to my
need to expand property values with references to values such as
"${user.home}". It would be possible but tedious to implement variable
expansion in the plug-in directly (I think I had a version that did this
originally), but why keep re-inventing the wheel?

We could probably refactor the code so that org.eclipse.core.variables
was optional, and the plug-in only loads it when the application
actively uses variable expansion because properties contain embedded
references.

Regards,
Deryck

-Original Message-
From: Jonathan Gallimore [mailto:jonathan.gallim...@gmail.com] 
Sent: 10 May 2009 14:34
To: users@openejb.apache.org
Subject: Re: OpenEJB and OSGi

...

A couple of issues I noticed when putting this together:

* I encountered a ConcurrentModificationException caused by adding
System.getProperties() to a IStringVariableManager, commenting out line
44:
addPropertyVariables(System.getProperties()); in OpenEjbPlugin resolved
this, and everything seemed to work, but I don't know what the effect of
this will be - Deryck, do you have any thoughts on this?

* We make a fair bit of use org.eclipse.core.runtime.FileLocator which
converts URLs of resources in OSGi bundles to URLs on the file system -
I think I'm right in thinking that this is an Equinox / Eclipse specific
thing and probably won't work in other OSGi implementations. I think it
would be nice if we can find a way of not requiring
org.eclipse.core.runtime or org.eclipse.core.variables.

Jon


Re: OpenEJB and OSGi

2009-05-19 Thread Gauthier Libéral
;> sample
>> > Equinox directory with the bundles needed for OpenEJB, and added some
>> > basic
>> > instructions to the Wiki. The sample zip is available from
>> >
>> http://people.apache.org/~jgallimore/openejb-osgi.zip<http://people.apache.org/%7Ejgallimore/openejb-osgi.zip>and
>> the source code
>> > is
>> > available from
>> http://people.apache.org/~jgallimore/projects.zip<http://people.apache.org/%7Ejgallimore/projects.zip>
>> >
>> > The page I added to the Wiki is here:
>> > http://cwiki.apache.org/confluence/x/qMkB - please let me know if you
>> have
>> > any comments.
>> >
>> > To build the projects I pointed you at, you'll need to run Maven at the
>> > openejb-eclipse-plugin level the first time, this will go an download
>> the
>> > necessary Eclipse projects and add these to your local Maven
>> repository.
>> >
>> > Issuing the following at the openejb-eclipse-plugin level should work
>> and
>> > do
>> > what you're after:
>> >
>> > mvn -Dassemble clean install eclipse:clean eclipse:eclipse
>> >
>> > See here:
>> > http://cwiki.apache.org/confluence/display/OPENEJB/Building+from+source
>> > for
>> > more details. If you do encounter any issues with building the plugin,
>> > please do post and let us know.
>> >
>> > A couple of issues I noticed when putting this together:
>> >
>> > * I encountered a ConcurrentModificationException caused by adding
>> > System.getProperties() to a IStringVariableManager, commenting out line
>> > 44:
>> > addPropertyVariables(System.getProperties()); in OpenEjbPlugin resolved
>> > this, and everything seemed to work, but I don't know what the effect
>> of
>> > this will be - Deryck, do you have any thoughts on this?
>> >
>> > * We make a fair bit of use org.eclipse.core.runtime.FileLocator which
>> > converts URLs of resources in OSGi bundles to URLs on the file system -
>> I
>> > think I'm right in thinking that this is an Equinox / Eclipse specific
>> > thing
>> > and probably won't work in other OSGi implementations. I think it would
>> be
>> > nice if we can find a way of not requiring org.eclipse.core.runtime or
>> > org.eclipse.core.variables.
>> >
>> > Jon
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/OpenEJB-and-OSGi-tp23423565p23480595.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/OpenEJB-and-OSGi-tp23423565p23617331.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Re: OpenEJB and OSGi

2009-05-13 Thread Jonathan Gallimore
 and add these to your local Maven repository.
> >
> > Issuing the following at the openejb-eclipse-plugin level should work and
> > do
> > what you're after:
> >
> > mvn -Dassemble clean install eclipse:clean eclipse:eclipse
> >
> > See here:
> > http://cwiki.apache.org/confluence/display/OPENEJB/Building+from+source
> > for
> > more details. If you do encounter any issues with building the plugin,
> > please do post and let us know.
> >
> > A couple of issues I noticed when putting this together:
> >
> > * I encountered a ConcurrentModificationException caused by adding
> > System.getProperties() to a IStringVariableManager, commenting out line
> > 44:
> > addPropertyVariables(System.getProperties()); in OpenEjbPlugin resolved
> > this, and everything seemed to work, but I don't know what the effect of
> > this will be - Deryck, do you have any thoughts on this?
> >
> > * We make a fair bit of use org.eclipse.core.runtime.FileLocator which
> > converts URLs of resources in OSGi bundles to URLs on the file system - I
> > think I'm right in thinking that this is an Equinox / Eclipse specific
> > thing
> > and probably won't work in other OSGi implementations. I think it would
> be
> > nice if we can find a way of not requiring org.eclipse.core.runtime or
> > org.eclipse.core.variables.
> >
> > Jon
> >
>
> --
> View this message in context:
> http://www.nabble.com/OpenEJB-and-OSGi-tp23423565p23480595.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
>


Re: OpenEJB and OSGi

2009-05-11 Thread Gauthier Libéral
; 
> * We make a fair bit of use org.eclipse.core.runtime.FileLocator which
> converts URLs of resources in OSGi bundles to URLs on the file system - I
> think I'm right in thinking that this is an Equinox / Eclipse specific
> thing
> and probably won't work in other OSGi implementations. I think it would be
> nice if we can find a way of not requiring org.eclipse.core.runtime or
> org.eclipse.core.variables.
> 
> Jon
> 

-- 
View this message in context: 
http://www.nabble.com/OpenEJB-and-OSGi-tp23423565p23480595.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Re: OpenEJB and OSGi

2009-05-10 Thread Jacek Laskowski
On Sun, May 10, 2009 at 3:34 PM, Jonathan Gallimore
 wrote:

> Sorry for the delay. I've had a bit of a play around and created a sample
> Equinox directory with the bundles needed for OpenEJB, and added some basic
> instructions to the Wiki. The sample zip is available from
> http://people.apache.org/~jgallimore/openejb-osgi.zip and the source code is
> available from http://people.apache.org/~jgallimore/projects.zip

Do I need Eclipse to import the project and build the openejb.server
bundle? I've got the latest stable Equinox 3.4.3 and downloaded the
sources but couldn't find the necessary bundle(s) in their binary
form. I looked at the sources and I liked the "The white-board model"
approach. I have read about it before, but have never tried it out
myself so I'm really happy to see it in OpenEJB (even though it's
currently tied to Equinox). Congrats to all the people involved. Very
appreciated.

Jacek

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


Re: OpenEJB and OSGi

2009-05-10 Thread Jonathan Gallimore
Hi

Sorry for the delay. I've had a bit of a play around and created a sample
Equinox directory with the bundles needed for OpenEJB, and added some basic
instructions to the Wiki. The sample zip is available from
http://people.apache.org/~jgallimore/openejb-osgi.zip and the source code is
available from http://people.apache.org/~jgallimore/projects.zip

The page I added to the Wiki is here:
http://cwiki.apache.org/confluence/x/qMkB - please let me know if you have
any comments.

To build the projects I pointed you at, you'll need to run Maven at the
openejb-eclipse-plugin level the first time, this will go an download the
necessary Eclipse projects and add these to your local Maven repository.

Issuing the following at the openejb-eclipse-plugin level should work and do
what you're after:

mvn -Dassemble clean install eclipse:clean eclipse:eclipse

See here:
http://cwiki.apache.org/confluence/display/OPENEJB/Building+from+source for
more details. If you do encounter any issues with building the plugin,
please do post and let us know.

A couple of issues I noticed when putting this together:

* I encountered a ConcurrentModificationException caused by adding
System.getProperties() to a IStringVariableManager, commenting out line 44:
addPropertyVariables(System.getProperties()); in OpenEjbPlugin resolved
this, and everything seemed to work, but I don't know what the effect of
this will be - Deryck, do you have any thoughts on this?

* We make a fair bit of use org.eclipse.core.runtime.FileLocator which
converts URLs of resources in OSGi bundles to URLs on the file system - I
think I'm right in thinking that this is an Equinox / Eclipse specific thing
and probably won't work in other OSGi implementations. I think it would be
nice if we can find a way of not requiring org.eclipse.core.runtime or
org.eclipse.core.variables.

Jon

2009/5/9 Gauthier Libéral 

>
> Hi,
>
> I'm a beginner concerning the use of Maven but I don't understand why the
> first link provided by Jonathan (SVN) is unbuildable by my own maven due to
> an eclipse error (seems I've not eclipse:eclipse). I think that I will wait
> for your tutorial.
>
> I don't understand why using RCP is useful, why do not run OpenEJB in just
> only Equinox ? If I'm not mad, RCP apps used some graphical technologies
> like SWT so why use RCP-based apps on the server-side ?
>
> Thanks a lot for these anwers.
>
> ---
> Gauthier Libéral
>
>
> Jonathan Gallimore-2 wrote:
> >
> > Thanks for your reply Deryck - sorry I haven't replied to this thread
> > sooner. I agree, I think the work Deryck has done will do what you're
> > after,
> > and it works really well. As promised yesterday I'm going to try and
> write
> > a
> > tutorial on this functionality today - I'll post it up when its done :)
> >
> > Jon
> >
> > On Fri, May 8, 2009 at 10:24 AM, Brown, Deryck
> > wrote:
> >
> >> Hi,
> >>
> >> In fact the example code that Jonathan provided the links for does
> >> exactly
> >> this. I know, I wrote it!
> >>
> >> The setup I use in my own application has OpenEJB in one plug-in running
> >> as
> >> an OSGi service listener that watches for services that belong to the
> >> OpenEjbApplication class to be deployed. It then invokes the OpenEJB
> >> deployment code to start the application running. Your application
> plugin
> >> must include a plug-in activator that registers a new OpenEjbApplication
> >> service. When the plug-in is deactivated, the service is automatically
> >> stopped by the platform, and the OpenEJB server undeploys the
> >> application.
> >>
> >> The plugins at the moment are running on the Eclipse 3.4.2 RCP platform.
> >> This may cause some problems with running on (just) Equinox as the
> >> current
> >> code may be using some non-OSGi APIs (to load properties from files and
> >> allow for variable expansion within property values).
> >>
> >> I have used this to deploy an application that contains stateless
> session
> >> beans and entity beans that use an Apache Derby database and Hibernate
> >> for
> >> the persistence. (I've since moved Hibernate into its own plugin so I
> can
> >> share the Hibernate instance between OpenEJB and EMF/Teneo.)
> >>
> >> See the original description of this code at:
> >>
> >>
> >>
> http://www.nabble.com/Dynamically-deploying-to-an-embedded-OpenEJB-server-within-an-Eclipse-RCP-application-tt21667308.html#a21827389
> >>
> >> Regards,
> >> Deryck
> >>
> >> --
> >

Re: OpenEJB and OSGi

2009-05-09 Thread Gauthier Libéral

Hi,

I'm a beginner concerning the use of Maven but I don't understand why the
first link provided by Jonathan (SVN) is unbuildable by my own maven due to
an eclipse error (seems I've not eclipse:eclipse). I think that I will wait
for your tutorial.

I don't understand why using RCP is useful, why do not run OpenEJB in just
only Equinox ? If I'm not mad, RCP apps used some graphical technologies
like SWT so why use RCP-based apps on the server-side ?

Thanks a lot for these anwers.

---
Gauthier Libéral


Jonathan Gallimore-2 wrote:
> 
> Thanks for your reply Deryck - sorry I haven't replied to this thread
> sooner. I agree, I think the work Deryck has done will do what you're
> after,
> and it works really well. As promised yesterday I'm going to try and write
> a
> tutorial on this functionality today - I'll post it up when its done :)
> 
> Jon
> 
> On Fri, May 8, 2009 at 10:24 AM, Brown, Deryck
> wrote:
> 
>> Hi,
>>
>> In fact the example code that Jonathan provided the links for does
>> exactly
>> this. I know, I wrote it!
>>
>> The setup I use in my own application has OpenEJB in one plug-in running
>> as
>> an OSGi service listener that watches for services that belong to the
>> OpenEjbApplication class to be deployed. It then invokes the OpenEJB
>> deployment code to start the application running. Your application plugin
>> must include a plug-in activator that registers a new OpenEjbApplication
>> service. When the plug-in is deactivated, the service is automatically
>> stopped by the platform, and the OpenEJB server undeploys the
>> application.
>>
>> The plugins at the moment are running on the Eclipse 3.4.2 RCP platform.
>> This may cause some problems with running on (just) Equinox as the
>> current
>> code may be using some non-OSGi APIs (to load properties from files and
>> allow for variable expansion within property values).
>>
>> I have used this to deploy an application that contains stateless session
>> beans and entity beans that use an Apache Derby database and Hibernate
>> for
>> the persistence. (I've since moved Hibernate into its own plugin so I can
>> share the Hibernate instance between OpenEJB and EMF/Teneo.)
>>
>> See the original description of this code at:
>>
>>
>> http://www.nabble.com/Dynamically-deploying-to-an-embedded-OpenEJB-server-within-an-Eclipse-RCP-application-tt21667308.html#a21827389
>>
>> Regards,
>> Deryck
>>
>> --
>> Dr Deryck F Brown
>> Software Engineer
>> Ziebel UK Ltd
>> Unit A, Broadfold Road,
>> Bridge of Don,
>> Aberdeen AB23 8EE
>>
>> Tel: 01224 227227 (X143)
>> Fax: 01224 703146
>> Skype: ziebel-deryckb
>> Web: www.ziebel.biz
>>
>> -Original Message-
>> From: Gauthier Libéral [mailto:liberal.gauth...@gmail.com]
>> Sent: 08 May 2009 09:48
>> To: users@openejb.apache.org
>> Subject: Re: OpenEJB and OSGi
>>
>>
>> Hi,
>>
>> I would like to have OpenEJB running as an equinox bundle and then would
>> like to run my EJB-Jar in Equinox too (one bundle per EJB).
>>
>> When you said "You don't expect EJBs will be deployed as OSGi bundles, do
>> you?" is it a warning for not doing that thing ?
>>
>> Sorry for my english expression, I'm french.
>>
>> Thanks for your answers.
>>
>> ---
>> Gauthier
>>
>>
>> Jacek Laskowski wrote:
>> >
>> > 2009/5/7 Gauthier Libéral :
>> >
>> >> I would like to run OpenEJB on Equinox Framework
>> >
>> > Could you explain a bit more on what exactly you'd expect from OpenEJB
>> > to be run on OSGi runtime? You don't expect EJBs will be deployed as
>> > OSGi bundles, do you?
>> >
>> > Jacek
>> >
>> > --
>> > Jacek Laskowski
>> > Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/OpenEJB-and-OSGi-tp23423565p23442299.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>>
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com
>> Version: 8.5.325 / Virus Database: 270.12.19/2099 - Release Date:
>> 05/07/09
>> 18:05:00
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/OpenEJB-and-OSGi-tp23423565p23458482.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Re: OpenEJB and OSGi

2009-05-09 Thread Gauthier Libéral

Hi,

It's important to me to do this because we actually use some home-made stuff
for deploying EJB and our goal is to simplify the deployment/undeployment of
EJB. Moreover, we would like to allow communications between OpenEJB and
other OSGi apps.

That's all folks (too much Looney Tunes for me, sorry)

--
Gauthier Libéral


Jacek Laskowski wrote:
> 
> 2009/5/8 Gauthier Libéral :
> 
>> I would like to have OpenEJB running as an equinox bundle and then would
>> like to run my EJB-Jar in Equinox too (one bundle per EJB).
>>
>> When you said "You don't expect EJBs will be deployed as OSGi bundles, do
>> you?" is it a warning for not doing that thing ?
> 
> Ah, that's exactly what I thought you're after :) It's been a while
> when I looked at OpenEJB's OSGi part, but only OSGi metadata existed -
> no such an deployment functionality like OpenEJB getting notified when
> an EJB as an OSGi bundle gets deployed. It is not *yet* here. Dunno
> when it's available.
> 
> Why is that important for you? I do know it would make your
> application modular, but wonder if there's something more beside this
> (which is certainly quite enough to introduce the feature in the app).
> 
> Jacek
> 
> -- 
> Jacek Laskowski
> Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl
> 
> 

-- 
View this message in context: 
http://www.nabble.com/OpenEJB-and-OSGi-tp23423565p23458407.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Re: OpenEJB and OSGi

2009-05-08 Thread Jacek Laskowski
On Fri, May 8, 2009 at 11:24 AM, Brown, Deryck  wrote:

> In fact the example code that Jonathan provided the links for does exactly 
> this. I know, I wrote it!

Awesome! Thanks for sharing it (and appologize for my ignorance to
read all the emails in my email backlog to find it out sooner).

> The setup I use in my own application has OpenEJB in one plug-in running as 
> an OSGi service listener that watches for services that belong to the 
> OpenEjbApplication class to be deployed. It then invokes the OpenEJB 
> deployment code to start the application running. Your application plugin 
> must include a plug-in activator that registers a new OpenEjbApplication 
> service. When the plug-in is deactivated, the service is automatically 
> stopped by the platform, and the OpenEJB server undeploys the application.
>
> The plugins at the moment are running on the Eclipse 3.4.2 RCP platform. This 
> may cause some problems with running on (just) Equinox as the current code 
> may be using some non-OSGi APIs (to load properties from files and allow for 
> variable expansion within property values).

If it really works now with some Eclipse-specific APIs I'd like to
move the code to become more OSGi provider-agnostic if you don't mind.
I'd like to get it merged into our sources so people can use it
(rather than keep asking about it).

> http://www.nabble.com/Dynamically-deploying-to-an-embedded-OpenEJB-server-within-an-Eclipse-RCP-application-tt21667308.html#a21827389

Showed up as the first in my TODO list for this weekend. Thanks again
for your efforts (if that's what it really claims it is I owe you a
beer or even two :))

Jacek

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


Re: OpenEJB and OSGi

2009-05-08 Thread Jonathan Gallimore
Thanks for your reply Deryck - sorry I haven't replied to this thread
sooner. I agree, I think the work Deryck has done will do what you're after,
and it works really well. As promised yesterday I'm going to try and write a
tutorial on this functionality today - I'll post it up when its done :)

Jon

On Fri, May 8, 2009 at 10:24 AM, Brown, Deryck wrote:

> Hi,
>
> In fact the example code that Jonathan provided the links for does exactly
> this. I know, I wrote it!
>
> The setup I use in my own application has OpenEJB in one plug-in running as
> an OSGi service listener that watches for services that belong to the
> OpenEjbApplication class to be deployed. It then invokes the OpenEJB
> deployment code to start the application running. Your application plugin
> must include a plug-in activator that registers a new OpenEjbApplication
> service. When the plug-in is deactivated, the service is automatically
> stopped by the platform, and the OpenEJB server undeploys the application.
>
> The plugins at the moment are running on the Eclipse 3.4.2 RCP platform.
> This may cause some problems with running on (just) Equinox as the current
> code may be using some non-OSGi APIs (to load properties from files and
> allow for variable expansion within property values).
>
> I have used this to deploy an application that contains stateless session
> beans and entity beans that use an Apache Derby database and Hibernate for
> the persistence. (I've since moved Hibernate into its own plugin so I can
> share the Hibernate instance between OpenEJB and EMF/Teneo.)
>
> See the original description of this code at:
>
>
> http://www.nabble.com/Dynamically-deploying-to-an-embedded-OpenEJB-server-within-an-Eclipse-RCP-application-tt21667308.html#a21827389
>
> Regards,
> Deryck
>
> --
> Dr Deryck F Brown
> Software Engineer
> Ziebel UK Ltd
> Unit A, Broadfold Road,
> Bridge of Don,
> Aberdeen AB23 8EE
>
> Tel: 01224 227227 (X143)
> Fax: 01224 703146
> Skype: ziebel-deryckb
> Web: www.ziebel.biz
>
> -Original Message-
> From: Gauthier Libéral [mailto:liberal.gauth...@gmail.com]
> Sent: 08 May 2009 09:48
> To: users@openejb.apache.org
> Subject: Re: OpenEJB and OSGi
>
>
> Hi,
>
> I would like to have OpenEJB running as an equinox bundle and then would
> like to run my EJB-Jar in Equinox too (one bundle per EJB).
>
> When you said "You don't expect EJBs will be deployed as OSGi bundles, do
> you?" is it a warning for not doing that thing ?
>
> Sorry for my english expression, I'm french.
>
> Thanks for your answers.
>
> ---
> Gauthier
>
>
> Jacek Laskowski wrote:
> >
> > 2009/5/7 Gauthier Libéral :
> >
> >> I would like to run OpenEJB on Equinox Framework
> >
> > Could you explain a bit more on what exactly you'd expect from OpenEJB
> > to be run on OSGi runtime? You don't expect EJBs will be deployed as
> > OSGi bundles, do you?
> >
> > Jacek
> >
> > --
> > Jacek Laskowski
> > Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/OpenEJB-and-OSGi-tp23423565p23442299.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.325 / Virus Database: 270.12.19/2099 - Release Date: 05/07/09
> 18:05:00
>


RE: OpenEJB and OSGi

2009-05-08 Thread Brown, Deryck
Hi,

In fact the example code that Jonathan provided the links for does exactly 
this. I know, I wrote it!

The setup I use in my own application has OpenEJB in one plug-in running as an 
OSGi service listener that watches for services that belong to the 
OpenEjbApplication class to be deployed. It then invokes the OpenEJB deployment 
code to start the application running. Your application plugin must include a 
plug-in activator that registers a new OpenEjbApplication service. When the 
plug-in is deactivated, the service is automatically stopped by the platform, 
and the OpenEJB server undeploys the application.

The plugins at the moment are running on the Eclipse 3.4.2 RCP platform. This 
may cause some problems with running on (just) Equinox as the current code may 
be using some non-OSGi APIs (to load properties from files and allow for 
variable expansion within property values). 

I have used this to deploy an application that contains stateless session beans 
and entity beans that use an Apache Derby database and Hibernate for the 
persistence. (I've since moved Hibernate into its own plugin so I can share the 
Hibernate instance between OpenEJB and EMF/Teneo.)

See the original description of this code at:

http://www.nabble.com/Dynamically-deploying-to-an-embedded-OpenEJB-server-within-an-Eclipse-RCP-application-tt21667308.html#a21827389

Regards,
Deryck

--
Dr Deryck F Brown
Software Engineer
Ziebel UK Ltd
Unit A, Broadfold Road,
Bridge of Don,
Aberdeen AB23 8EE
 
Tel: 01224 227227 (X143)
Fax: 01224 703146
Skype: ziebel-deryckb
Web: www.ziebel.biz 

-Original Message-
From: Gauthier Libéral [mailto:liberal.gauth...@gmail.com] 
Sent: 08 May 2009 09:48
To: users@openejb.apache.org
Subject: Re: OpenEJB and OSGi


Hi,

I would like to have OpenEJB running as an equinox bundle and then would like 
to run my EJB-Jar in Equinox too (one bundle per EJB).

When you said "You don't expect EJBs will be deployed as OSGi bundles, do you?" 
is it a warning for not doing that thing ?

Sorry for my english expression, I'm french.

Thanks for your answers.

---
Gauthier


Jacek Laskowski wrote:
> 
> 2009/5/7 Gauthier Libéral :
> 
>> I would like to run OpenEJB on Equinox Framework
> 
> Could you explain a bit more on what exactly you'd expect from OpenEJB 
> to be run on OSGi runtime? You don't expect EJBs will be deployed as 
> OSGi bundles, do you?
> 
> Jacek
> 
> --
> Jacek Laskowski
> Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl
> 
> 

--
View this message in context: 
http://www.nabble.com/OpenEJB-and-OSGi-tp23423565p23442299.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.325 / Virus Database: 270.12.19/2099 - Release Date: 05/07/09 
18:05:00


Re: OpenEJB and OSGi

2009-05-08 Thread Jacek Laskowski
2009/5/8 Gauthier Libéral :

> I would like to have OpenEJB running as an equinox bundle and then would
> like to run my EJB-Jar in Equinox too (one bundle per EJB).
>
> When you said "You don't expect EJBs will be deployed as OSGi bundles, do
> you?" is it a warning for not doing that thing ?

Ah, that's exactly what I thought you're after :) It's been a while
when I looked at OpenEJB's OSGi part, but only OSGi metadata existed -
no such an deployment functionality like OpenEJB getting notified when
an EJB as an OSGi bundle gets deployed. It is not *yet* here. Dunno
when it's available.

Why is that important for you? I do know it would make your
application modular, but wonder if there's something more beside this
(which is certainly quite enough to introduce the feature in the app).

Jacek

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


Re: OpenEJB and OSGi

2009-05-08 Thread Gauthier Libéral

Hi,

I would like to have OpenEJB running as an equinox bundle and then would
like to run my EJB-Jar in Equinox too (one bundle per EJB).

When you said "You don't expect EJBs will be deployed as OSGi bundles, do
you?" is it a warning for not doing that thing ?

Sorry for my english expression, I'm french.

Thanks for your answers.

---
Gauthier


Jacek Laskowski wrote:
> 
> 2009/5/7 Gauthier Libéral :
> 
>> I would like to run OpenEJB on Equinox Framework
> 
> Could you explain a bit more on what exactly you'd expect from OpenEJB
> to be run on OSGi runtime? You don't expect EJBs will be deployed as
> OSGi bundles, do you?
> 
> Jacek
> 
> -- 
> Jacek Laskowski
> Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl
> 
> 

-- 
View this message in context: 
http://www.nabble.com/OpenEJB-and-OSGi-tp23423565p23442299.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Re: OpenEJB and OSGi

2009-05-07 Thread Jacek Laskowski
2009/5/7 Gauthier Libéral :

> I would like to run OpenEJB on Equinox Framework

Could you explain a bit more on what exactly you'd expect from OpenEJB
to be run on OSGi runtime? You don't expect EJBs will be deployed as
OSGi bundles, do you?

Jacek

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


Re: OpenEJB and OSGi

2009-05-07 Thread Gauthier Libéral

Thanks you very much, it will be very usefull for me and for other people who
want to do the same thing.

---
Gauthier



Jonathan Gallimore-2 wrote:
> 
> We've got an OSGi bundle that might do what you want - have a look at the
> org.apache.openejb.server, echo.stateless.bean and echo.stateless.client
> in
> https://svn.apache.org/repos/asf/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/
> 
> I might have a bit of spare time tomorrow, so I'll try to whip up some
> better documentation on the wiki and/or a blog entry on this.
> 
> Jon
> 
> 2009/5/7 Gauthier Libéral 
> 
>>
>> Hi,
>>
>> I would like to run OpenEJB on Equinox Framework but I can't find the
>> right
>> way.
>> But I know it's possible because of this news on the OpenEJB website
>> http://openejb.apache.org/2008/02/06/openejb-30-beta-2-released.html
>> there
>> .
>>
>> So, can you help me to find the right way ?
>>
>> Thanks.
>> ---
>> Best Regards
>> Gauthier
>>
>> --
>> View this message in context:
>> http://www.nabble.com/OpenEJB-and-OSGi-tp23423565p23423565.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/OpenEJB-and-OSGi-tp23423565p23424623.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Re: OpenEJB and OSGi

2009-05-07 Thread Jonathan Gallimore
We've got an OSGi bundle that might do what you want - have a look at the
org.apache.openejb.server, echo.stateless.bean and echo.stateless.client in
https://svn.apache.org/repos/asf/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/

I might have a bit of spare time tomorrow, so I'll try to whip up some
better documentation on the wiki and/or a blog entry on this.

Jon

2009/5/7 Gauthier Libéral 

>
> Hi,
>
> I would like to run OpenEJB on Equinox Framework but I can't find the right
> way.
> But I know it's possible because of this news on the OpenEJB website
> http://openejb.apache.org/2008/02/06/openejb-30-beta-2-released.html there
> .
>
> So, can you help me to find the right way ?
>
> Thanks.
> ---
> Best Regards
> Gauthier
>
> --
> View this message in context:
> http://www.nabble.com/OpenEJB-and-OSGi-tp23423565p23423565.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>


OpenEJB and OSGi

2009-05-07 Thread Gauthier Libéral

Hi,

I would like to run OpenEJB on Equinox Framework but I can't find the right
way.
But I know it's possible because of this news on the OpenEJB website 
http://openejb.apache.org/2008/02/06/openejb-30-beta-2-released.html there .

So, can you help me to find the right way ?

Thanks.
---
Best Regards
Gauthier

-- 
View this message in context: 
http://www.nabble.com/OpenEJB-and-OSGi-tp23423565p23423565.html
Sent from the OpenEJB User mailing list archive at Nabble.com.