Reputation: 1244
I am working on an AddOn Web Application for an existing Enterprise Application deployed on a JBoss 4 AS instance. To keep it easy I am using the Glassfish Application Server delivered in Netbeans. For theprototype, I am packing every library I use into the war file which I want to deploy, also Hibernate and some really basic libraries. But in future I also want to use the server delivered libraries and features like JNDI database connection lookup, session and entity beans and so on.
My Questions:
I have to say, that I am only experienced in developing simple servlets. I know some theoretical stuff about Java EE and EJB and I want to get deeper in this. I do know nothing about implementation specific details, so this is what this question is focused on.
Upvotes: 0
Views: 238
Reputation: 1512
If your application is relatively simple and you stick to core Java EE standards, in theory you should see no major issues. You might have some problems accessing EJBs since there are differences in JNDI naming.
That being said, JBoss 4 is fairly old. It's J2EE 1.4 compliant, and implements the EJB 2.1 specification. New JBoss and GlassFish servers are Java EE 6 compliant and implement the EJB 3.1 specification. EJB3 is much easier to use, but you cannot deploy a 3.x EJB to a 2.x container (the other way around is possible). So you'll have to be careful to stick to what's possible in an EJB2 container. For example, if you want to use an EJB locally (i.e. from another EJB deployed on the same server), under EJB2 you have to define and implement a local interface. Under EJB3 it's enough to annotate the EJB class with @LocalBean
. And don't get me started with all the external descriptors required by EJB2.
A general rule of thumb is to use the same VERSION of the same AS for both development and production. For example, there might be a bug with a certain functionality in aplication server Y version Z, which does not appear in application server A version B. So your application will work in A, but when you deploy it to Y, it will crash, and you'll have hard time debugging it. If you use the same (version of the same) AS, there's a greater chance you'll discover the bug during development.
I once had to transfer a fairly complex application from GlassFish v2 to GlassFish v3, and the process was anything than straightforward.
So, if you have to use JBoss 4 as the target, do all your development under JBoss 4. It will save you a lot of trouble later on. If you can use the latest JBoss 7 as the target, you can develop your application under the latest GlassFish 3.x, and it will most likely work, but I see no good reason for doing this.
Upvotes: 2