You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by ymaraner <tp...@gmail.com> on 2012/07/05 18:15:08 UTC

J2EE 1.4 and EJB2.1 on TomEE+ examples and/or documentation

I have an existing J2EE 1.4 Enterprise Application (w/ ejb2.1, JMS, and WS)
that deploys and runs successfully on WebSphere, WebLogic, and JBoss. I
would like to port it to TomEE+.

I've been scouring the documentation, examples, and internet for information
on how to do that, but what I have found is almost entirely dealing with JEE
6 (ejb 3.1 beans). It appears that there are multiple openejb-jar.xsd files,
but none of them seem to match with the examples on the TomEE page, and none
of them deal with the specific requirements of EJB2.1.

Is there any documentation on the details of TomEE+ specific deployment
descriptors and other configuration necessary to deploy a J2EE 1.4
Enterprise Application to TomEE+? 

Are there any currently maintained tools to generate TomEE+ descriptors
using descriptors for another app server as input?

Thanks,

Tim

--
View this message in context: http://openejb.979440.n4.nabble.com/J2EE-1-4-and-EJB2-1-on-TomEE-examples-and-or-documentation-tp4656065.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: J2EE 1.4 and EJB2.1 on TomEE+ examples and/or documentation

Posted by ymaraner <tp...@gmail.com>.
David, thanks for the quick reply!

It's good to know that the EJB2.1 support is there. We are actually
evaluating both TomEE and GlashFish, so knowing that the GlassFish
deployment descriptors will not only work for TomEE, but are what you use
for your certification, makes me think that what we need to do is create the
GlassFish descriptors so they will be useful regardless of the app server
choice that is eventually made. 

If I package up an EAR for GlashFish, I can deploy it unmodified to TomEE? I
ask that because I still haven't quite figured out how to get Eclipse to
package up an ear or a war (containing EJBs) and deploy it to TomEE. It
seems to automatically recognize and deploy the EJB3 beans from the jars
packaged in the war but not the EJB2.1 ones. I probably don't have it
entirely configured correctly yet.

To improve my understanding of the TomEE descriptors, I have a few
questions.

- First, is there an xsd for the openejb-jar.xml file? The one in the TomEE
source tree seems to be for openejb-jar-1.1 and most of the example files
say they are openejb-jar-2.1. If it is available, where can I get it?

- Based on the CMP2 example that you provided, there are no OpenEJB-specific
deployment descriptors necessary for the cmp mapping or cross referencing
ejb-local-ref with local-jndi-name or to define dependencies like WebLogic,
WebSphere, and JBoss 6.1 require. Is that true? I can get away with just the
ejb-jar.xml file for these?

- What about cross referencing ejb-local-ref with local-jndi-name and other
requirements for EJB2.1 Session Beans?

As for the Web Services, we have a combination of JAX-RPC and JAX-WS. The
RPC services are mostly obsolete and converting any that aren't to WS would
probably be in the plan anyway.

I'll take a look at those two classes that you reference for the conversion
tools and see if it helps me with my understanding and if I can be of any
assistance on completing the one for WebLogic. I'm not promising anything,
but I'll take a look.


Thanks again,

Tim

--
View this message in context: http://openejb.979440.n4.nabble.com/J2EE-1-4-and-EJB2-1-on-TomEE-examples-and-or-documentation-tp4656065p4656070.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: J2EE 1.4 and EJB2.1 on TomEE+ examples and/or documentation

Posted by David Blevins <da...@gmail.com>.
Hi Tim!

On Jul 5, 2012, at 9:15 AM, ymaraner wrote:

> I have an existing J2EE 1.4 Enterprise Application (w/ ejb2.1, JMS, and WS)
> that deploys and runs successfully on WebSphere, WebLogic, and JBoss. I
> would like to port it to TomEE+.

TomEE does support all of EJB 1.1 to 3.1, including CMP2.  The documentation for CMP2 was non-existent.  I've gone ahead and written some up for you:

  http://tomee.apache.org/examples-trunk/simple-cmp2/README.html

Our legacy EJB 2.x support is very stellar as we put a tremendous amount of work ensuring that EJB 2x and EJB 3x use the same runtime code -- so EJB 2x beans continue to get the new features and bug fixes we give to EJB 3x beans, including CMP2 which gets a steady stream of persistence fixes and tuning via OpenJPA.  One of the more amazing features we have that we just have no time to promote.

We don't, however, support JAX-RPC at all.  If the WS you mention is JAX-RPC, the only
route to take would be to upgrade that to JAX-WS.  Or if you were supporting your own WS usage (and not using what was bundled in the server) by putting jars in your WEB-INF/lib dir, that should continue to work.  In which case, you're in luck.

> Are there any currently maintained tools to generate TomEE+ descriptors
> using descriptors for another app server as input?

We do have tools to convert GlassFish or Geronimo descriptors to TomEE descriptors, both include complex things like CMP mappings.

We do this at deploy time automatically when we see GlassFish descriptors in the application.  Under the covers the code is fairly simple: one JAXB tree for the GlassFish descriptors, one JAXB for our descriptors, read both in and a couple pages of "moving data" over code and done.  We actually run the Java EE 6 TCK daily using the GlassFish descriptors, relying on our ability to convert them on-the-fly to TomEE descriptors.

Here is 100% of the logic (not the JAXB trees) for doing the GlassFish to TomEE descriptor conversion:

http://svn.apache.org/repos/asf/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/SunConversion.java

It was always our intent to write the same code for WebSphere, WebLogic and JBoss as well.  We actually do have the JAXB trees for each of those servers already, we simply lack the translation layer.   A WebLogic (WlsConversion) is partially in place, but nowhere near complete:

http://svn.apache.org/repos/asf/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/WlsConversion.java

Note the same `openejb.descriptors.output` property mentioned in the CMP2 doc works for outputting these generated descriptors too.

The moral of the conversion tool story is we're one keenly written class away from X server to TomEE conversion; the framework and even descriptor trees are already there.  We're more than happy to help people write that and we love it when we get to make users into committers on the project.

Hope the above helps!


-David