Hi Deryck,
As David mentioned, I'm trying to solve similar problem, though I was
less successful. You could read about my trial in mail archive:
http://www.mail-archive.com/[email protected]/msg03187.html
In short: I created plugin from OpenEJB libs too, this plugin has
Eclipse-BuddyPolicy: registered, my main plugin has
META-INF/ejb-jar.xml, main plugin tries to create InitialContext(),
OpenEJB starts loading and crashes with Exceptions.
I would be interested to see your Manifest.mf entries, and the way you
configure and start OpenEJB.
Thanks,
Donatas
David Blevins <[email protected]> rašė:
On Jan 26, 2009, at 7:23 AM, Brown, Deryck wrote:
Hi,
I am trying to configure OpenEJB as part of an Eclipse rich-client
platform (RCP) application that I am developing.
I have managed to package OpenEJB 3.1 as an Eclipse plug-in by
"rebundling" the OpenEJB lib folder as an Eclipse RCP plug-in project.
This is to get round the problem with the javaee-api jar file not being
a valid OSGi bundle, but also to avoid generating a separate plug-in for
every jar file in the OpenEJB server.
The 3.1.1 release will include a javaee-api jar that has the
required OSGi bundle information in it. (Thanks again Oliver
Gunther for that!)
So far, I have managed to get unit tests to work successfully with my
OpenEJB plug-in as a "buddy" of my plug-in that defines the EJBs. I am
running the tests in a fragment of the EJB plug-in. However, this relied
on the test plug-in to configure and start the OpenEJB server, something
I'm not particularly happy with.
I've Cc'ed another user who posted to [email protected] about doing
that same thing. If you could give some details that'd be great.
(or Donatas can ask questions)
Anyway, I'm currently trying to get OpenEJB to start the server when its
plug-in is activated, and then deploy and undeploy applications when
other plug-ins are started and stopped. This would use the OSGi service
framework and the so-called "white-board" model (see [1]).
However, for this to work, I must be able to dynamically deploy an
application on the local server after the server has started (and, for
example, after the test plug-in fragment has properly configured the
test database for my EJBs). This is where I am having problems. I've
spent some time looking through the OpenEJB source to try and work out
how an application is deployed, and I think I want to use the
Deployer.deploy() method from the DeployerEjb class. Alas, I cannot work
out how to get access to this object from within my own code. As far as
I can see, the only examples of using this method directly in the
OpenEJB code rely on doing a JNDI lookup of
"openejb/DeployerBusinessRemote", and this name does not appear to be
bound in a local server.
Can anyone point me towards examples of deploying and undeploying
applications on a local OpenEJB server from within Java code?
You can enable the deployer EJB in an embedded mode by adding this
system property:
openejb.deployments.classpath.filter.systemapps = true
Then you can lookup and use the DeployerEjb to deploy any apps you need.
Let us know how that goes as we have a few users in your same bucket.
-David