12

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

john
  • 33,520
  • 12
  • 45
  • 62

3 Answers3

13

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.

duffymo
  • 305,152
  • 44
  • 369
  • 561
2

You can think as Tomcat as a subset of Websphere, so theoretically everything that works on Tomcat will work in Websphere.

But...Deploying in Websphere, in my humble opinion, is a terrible pain, while deploying in Tomcat just works. (And if fails, just delete temporary folders)

Without knowing the technologies you are using, that's all I can say.

Pablo Grisafi
  • 5,039
  • 1
  • 19
  • 29
  • This is exactly my experience. I write spring boot apps and jakartaEE apps and I find tomcat to be the future. Liberty, regardless is it IBM Liberty or open Liberty is horrible to work with. Similar with jakartaEE and spring boot. Spring boot simply works. I can probably finish writing a brand new Spring Boot API by the time I prepare everything needed to start writing it in jakartaEE – pixel Feb 08 '23 at 12:56
1

Depends, what are you trying to deploy?

Tomcat isn't a full EE server--are you trying to deploy an EE app?

If you're just deploying a web app, it's more important to consider which version of the servlet spec/etc. each server implements.

Dave Newton
  • 158,873
  • 26
  • 254
  • 302
  • I would be funneling people from a website into a web app that does credit card processing and e-signatures. That is its sole job. – john Sep 22 '11 at 19:32
  • That doesn't describe its EE-ness or lack thereof; if it's just a web app w/ no EE functionality, it will matter only rarely, assuming you're not doing anything WebFear-specific, and you're targeting a supported servlet spec, and you don't run in to a WebFear-specific bug. – Dave Newton Sep 22 '11 at 19:54
  • But isn't spring but based on jakartaEE, yet it uses Tomcat by default? And it is flawless, and way simpler and easier to use plus at least 20 times faster to rebuild when I change some code. – pixel Feb 08 '23 at 12:51
  • @pixel What? I don’t see how any of that is related (“flawless”… no) or relevant to whether or not Tomcat was/is an app server, especially over a decade ago ‍♂️ – Dave Newton Feb 08 '23 at 13:10