Migrating from tomcat to websphere - java

At the moment, I'm developing a java web application locally(localhost) on Windows, using Tomcat 8.5 .
Unofortunately, I have no developing enviroment, so I have to do everything locally and then deploy to production via .WAR .
The issue is that the production application server (Linux RedHat) is running on websphere, if I generate the .WAR on tomcat, Will I have any problems to run it on WebSphere? Should I change anything in my code or web xml?
My system does nothing fancy, no hibernate, no spring, just a very classic mvc web application.
Thanks in advance

In general you shouldn't have to make any changes, but there are some differences between the two environments that could cause issues.
IBM provides a tool that will analyze your application and suggest changes that may need to be made. You can find more information here: https://www.ibm.com/developerworks/library/mw-1701-was-migration/index.html

Related

Spring project deploy on real server

I have a Spring MVC project running locally on tomcat right now. What I need to do to be able to run it on my linux server? How can I deploy it? Before I used firezilla(running usual jars) to connect to server using ssh. Please help me by writing easy steps on how to run web application on server, thank you.
There are a lot of answers to this just have to google (i found about 10 in first couple pages that were good).
It all varies based on your environment, build setup etc.
Here is example of deploying with maven to tomcat
http://www.mkyong.com/maven/how-to-deploy-maven-based-war-file-to-tomcat/
and another
http://bitbybitblog.com/deploy-to-tomcat/
Some IDEs also have inbuilt functions that take care of this for you as well.

Tomcat or JBoss server for a Java EE application?

This might be duplicate of this and this question.
I have a java application in which i am using JAX-WS (WEB SERVICES). and many other features in it like apache-commons utils.
My application is swing application, that connects to my server code
and uploads and downloads, and sync files with the server. my
database is mysql.
I have compiled my server code and created a .WAR file. i deployed
that .WAR (containing all the required libraries for my server
side application) file on a JBoss server and its working fine.
Now my Management says me to why use JBoss instead of Tomcat, which
easy to manage and setup on a linux server. actualy they have a
linux server which supports tomcat, but not JBoss. so they said to
me to deploy on Tomcat on Linux Server. I installed and configured
tomcat on my windows and deployed a .WAR file. and also created
virtual directory for my resources its working fine[but not tested
completely]
My Application does not have EJB so I think that Tomcat is good enough.
Please suggest me is it fine to use Tomcat instead of JBoss server,
I am worried if it may get problems in the future, or it might not
support features of my application in future or after complete testing.
JBoss uses Tomcat under the hood to host war applications anyway.
Using Tomcat for you war application instead of JBoss should be perfectly fine.
Any commons-jars that you are using can be downloaded from http://commons.apache.org/. Put them in your lib directory and you should be good to go. Most apache commons libraries should allready be included with Tomcat though, you'll have to check.
PS:
JAX-WS is standard in the latest JDK6 updates. If your using a earlier version of the JDK then just download the JAX-WS jars. The standard reference implementation from Oracle/Sun can be downloaded from here http://jax-ws.java.net/
Do you have EJB? JBoss comes with its implementation of the EJB JSR specification.
For Tomcat, you require plugins like openEJB.
Many application servers use Tomcat internally as its Servlet container. But for compliance to JavaEE standards, most would choose a JBoss application server over Tomcat anyday.
Note that JBoss 7 Application Server Web Profile is certified.
Tomcat functions well as a plain vanilla Servlet container. Many enterprises when using Tomcat, couple it with Proxy and HTTPD servers for security and load balancing reasons.

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

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
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.
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.
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.

Run Tomcat from Java Web Start

Is it possible to distribute Tomcat by Java Web Start and run it from there?
My application shall run within its own Tomcat server on the machine it is deployed on. Can I package Tomcat and the client application into one Java Web Start archive and run the Tomcat server and the client once the user has
downloaded the Java Web Start archive?
You cannot run a full blown Tomcat as it expects a certain layout in the filesystem and scripts and more.
You can however run an embedded web server in an application where you control it completely. I have done that with Jetty. You might find Howto embed Tomcat 6? interesting.
This might be possible if you signed all the jars correctly. But, it seems like this is quite a heavyweight solution. Have you considered doing this with Jetty?

What web server should I use with NetBeans?

I haven't been around Java development for 8 years, but am starting to build a NetBeans Web Application. When I walk through the Web Application wizard, it asks for the server I'm going to be using.
What would be the best and simplest server for me to start using with NetBeans?
Since the NetBeans IDE is a Sun product, I would assume that the Glassfish application server would be a natural fit.
That said, one of the pluses of developing a web application in Java is that the interface for working with the http is standardized (i.e. the Servlet specification), so that you can pick any servlet container you want: be it Glassfish, Tomcat, Jetty or Weblogic. Since it sounds to me that you're experimenting and you want to use something easy to administer, I might go with Glassfish. However, be open to revisit that decision when you need to actually deploy your web application in a production environment. Be sure to check out other options like Tomcat or Jetty.
Unless you are deploying to a full J2EE application server, I would recommend using Tomcat. Tomcat can run as a standalone web/servlet/jsp server and avoids some of the complexities of a full J2EE app server.
The web development bundle for Netbeans will include installers for and automated integration with Glassfish and Tomcat. You will get the "best" experience using Netbeans with those servers.
That said, the workflow in Netbeans can be easily integrated with other application servers. As of 6.1, this includes Sun Java System Application Server 8 and 9, GlassFish v1 and v2, Apache Tomcat 4, 5 and 6, JBoss 4, BEA WebLogic 10, IBM WebSphere 6.0 and 6.1, Sailfin V1. See the Netbeans J2EE Features site for more info.
Glassfish is actually an easy to use app server. I think it's easier for a beginner to use and it's integrated with Netbeans. Setting up database connection caches is easy, for example.
You administer the server through this web page:
http://localhost:4848
(login: admin, password: adminadmin)
Glassfish will run your apps on port 8080.
The Glassfish home page: http://glassfish.dev.java.net (don't really need to read)
For non-Netbeans users there's a QuickStart guide:
http://glassfish.dev.java.net/downloads/quickstart/index.html
Here's a screencast overview:
http://download.java.net/javaee5/screencasts/admin-console/index.html
At some point you will want to learn Tomcat too because it's so prevalent, but Glassfish is a much friendlier start. In fact, it's probably better as a production server too, if you can find an affordable host.

Categories