Are JavaEE5 applications simple portable between particular servers?

I would like to verify whether Enterprise applications with JavaEE5 specifications are really portable between particular application servers. I believe that way could be more direct then for J2EE 1.4 when user should struggle with server specific deployment descriptors. I used simple enterprise applications that are included in NetBeans 5.5 (see File -> Samples -> Enterprise). These applications are developed and tested on Glassfish. Almost all advantages of the new specification are presented in these samples. I decided to migrate these samples on JBoss 4.0.4.
At the beginning, I realized that JBoss supports JavaEE5 specification only for EJB module not for Web and Ent application module. Therefore, no injection in these modules. Ok, I can use old approach with JNDI lookup. In the Glassfish you can use default JNDI name of interface that is fully qualified name of interface. This is very easy, isn't it? However, JBoss doesn't support this since it uses a little bit convention like: name of application/name of bean/interface(loca,remote). It means, all EJB clients should be changed.
I remeber, that mappedName attribute where JNDI name of bean could be used. I know that this is a product specific name but Glassfish use this as JNDI. However, this doesn't work on JBoss since they decided to drop this feature, see link. Also, one entity class uses two relations with EAGER fetch type since the related objects are used outside transaction. I realized that JBoss doean's support this configuration and workaround described here must be used.
I ended with many changes in my samples and tied application with specific server. The portability dropped away in my case. I see as the most important issue with different JNDI names in particular servers. Does JavaEE5 spec resolve this issue? Is there defined default JNDI names for stateless/stateful beans?
Comments:

"However, JBoss doesn't support this since it uses a little bit convention like: name of application/name of bean/interface(loca,remote). It means, all EJB clients should be changed." Why do you need to change any client code, if you code it in a portable way? In a portable app, the client only reference the ejb by its logical name, not the global JNDI name. The logical name and global JNDI name are bound together in vendor-specific deployment plan (e.g., sun-\*.xml, weblogic.xml, jboss.xml, etc). If you choose to lookup by their global JNDI name, then you are accepting the risk that your app is not portable. To make JavaEE apps portable, both appservers and applications need to do their part.

Posted by Cheng Fang on August 31, 2006 at 09:38 AM CEST #

Can you pass the JavaEE5 TCK and not implement the Web/Ent modules ? I believe you could do it for web , but even for Ent ??

Posted by Sameer Tyagi on August 31, 2006 at 09:45 AM CEST #

Java EE 5 applications are portable between Java EE 5 servers. You have confused Java EE 5 and EJB 3. The specs that "make" Java EE 5 work together work together. That is why a server cannot be certified as Java EE 5 without implementing all the specs that are under the Java EE 5 umbrella.

Posted by vince kraemer on August 31, 2006 at 09:50 AM CEST #

Using server specific DD will resolve this issue but I thought that new specifications is about simplification of Enterprise applications and removing difficult xml from development. I understand the names for resources that are related to server like JMS, JDBC and others must be defined in deployment descriptor. However, I feel that specification could define default JNDI names for beans that can be portable across servers.

Posted by PetrB on August 31, 2006 at 10:26 AM CEST #

Not supporting an entity class with two relations with EAGER fetch type is definitely a JBoss limitation. AFAIK, the spec says that EAGER must be supported.

Posted by marina on August 31, 2006 at 02:02 PM CEST #

Post a Comment:
Comments are closed for this entry.
About

pblaha

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
Bookmarks