What are the differences when deploying on Tomcat vs. Websphere?

john picture john · Sep 22, 2011 · Viewed 23.8k times · Source

If I were to deploy an application on Tomcat vs. Websphere, what are things that I need to consider?

Do I have to develop my Java code differently if developing in one app server vs another?

Edit:

I will be funneling people from a website into a web app that does credit card processing and e-signatures (cc processing and e-sigs are through separate services). That is its sole job

Answer

duffymo picture duffymo · Sep 22, 2011

You cannot use EJBs on Tomcat (unless you add OpenEJB). If your WebSphere deployment uses EJBs, you'll have to remove them to deploy on Tomcat.

If you use any Java EE features beyond servlet/JSP engine and JNDI naming service you'll have to eliminate them from your app.

Tomcat accepts WAR packages. If you package your app into an EAR on WebSphere, you'll have to change it to WAR for Tomcat.

Both use JNDI for data sources. There might be some nagging differences in naming conventions, but if you stick to the standard they should be portable.

If you use any WebSphere specific code in your app, you'll have to remove it to deploy on Tomcat.

If your app is servlets, JSPs, and JDBC you can deploy on either one without any problems.