aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes are EJBs portable? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "are EJBs portable?" Watch "are EJBs portable?" New topic
Author

are EJBs portable?

Bret Waldow
Ranch Hand

Joined: Aug 04, 2000
Posts: 59
I mean, is the implementation the same on all servers? Weblogic, WebSphere, JBoss, etc.? Write once, deply anywhere...
I'm just starting to look at EJBs, and if they're server specific, I need to decide who's server to study...
Thanks,
Bret
Vedhas Pitkar
Ranch Hand

Joined: Jan 27, 2001
Posts: 445
Yes they are make EAR once deploy anywhere.If you are short of money then you can try the best free source app server JBoss,or there are others like Blazix,OpenEJB.If you have got moolah then go for WebSphere or WebLogic.
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
Well, One thing is whether the app server is compliant and another is how they implement the specification API's. I'd say the implementation is not the same in all app servers, otherwise there will be no competency. One CMP engine can be better in app server X than app server Y. But, they all must implement and follow the same contract stated in the EJB specification, for example, so if you can migrate your EJB's from app server X to app server Y with minimal problems.
I'd say that if you stick to the specification you shouldn't have problems with portability, as long as the application servers are specifications-compliant.
But, many application servers add extra functionality that is beyond the J2EE specification. For instance, as far as I know, the ejb specification doesn't mandate a single way to generate primary keys. There are many patterns that explains how to generate these keys (UUID), but there are also app servers that provide that functionality. So, if you're using that "extra" functionality and you were to migrate your EAR file to another app server that does not support that extra functionality, you will run into trouble.
Application servers also used proprietary xml configuration file (jboss.xml, weblogic.xml -not sure about this one-), etc. So you will eventually have to do minor changes to your descriptor. It's not as easy as moving the EAR file to another app server.
My $0.02
[ August 11, 2003: Message edited by: Andres Gonzalez ]

I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
One specific problem-cause when migrating J2EE apps can be the classloader hierarchy, which is not dictated by the specifications. If you're using some class visibility hacks, you could be encountering a major refactoring...


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Is there a plan to include automatic primary key generation as a part od future spec?


Groovy
Pho Tek
Ranch Hand

Joined: Nov 05, 2000
Posts: 761

Most IDEs nowadays support auto-generation of deployment descriptors for different servers. If your IDE does not support it; try Xdoclet


Regards,

Pho
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Is there a plan to include automatic primary key generation as a part od future spec?

It is part of the spec. The container is required to be able to generate unique primary keys using an Object (EJB 2.0 spec, 10.8.3).
Or did you mean a standard facility for generating primary keys for the application code's disposal?
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

The second one.
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
All major EJB Containers support automatic primary key generation, however this support is not mandated by the specification. This is probably partially due to the fact that retrieving auto-generated keys was not supported by JDBC before version 3.0. Now that future versions of the J2EE spec will be based on J2SE 1.4 (which contains JDBC 3.0), I would think that support for automatic primary key generation would be made standard.
Unfortunately, it is not a part of EJB 2.1. So the earliest that we would probably see this feature is in EJB 3.0.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
So the earliest that we would probably see this feature is in EJB 3.0.

For the interested, theserverside.com has a thread going on about what should be included in 3.0...
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

EJB 2.1 is not yet out but these guys have started to work on 3.0 spce. Great
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: are EJBs portable?