Deploy War File in Microsoft IIS 7 - java

I would like to ask how can I deploy a war file to Microsoft IIS 7?
Thanks in advance.

You can't. You need a Java EE Web Container such as Tomcat or JBoss in order to do so. IIS can just act as a front facing proxy for the stuff hosted through the WAR file.
What you probably need is a way to connect IIS and Tomcat together so that requests for any dynamic resources such as JSPs and Servlets can be delegated to Tomcat.
The following link explains how to do so in detail.
http://tomcat.apache.org/connectors-doc/webserver_howto/iis.html

Please read this article: Deploying Java Servlet applications on Windows with IIS The Java is running on Jetty and IIS is used as a proxy, but in this solution all components are fit together to make it look and feel like it is built-in IIS feature of running WAR files.

Related

How to deploy a JSP on to a server other than Tomcat

I am trying to deploy a JSP/servlet onto a server. Not tomcat but on a real web domain. This is my first time doing so and so far I exported it into a war file and placed the file onto the server. Nothing happened which is why I am here. All the google searches seem to concentrate on Tomcat which I have already ran the project on. Advice?
Ok, let's get really basic. You want to see the compiled JSP in a browser, through some public URL, right?
First, find a place to host your application. You can try Digital Ocean (starts at $5/mo), EATJ (free version available), Amazon AWS (free trial available), OpenShift (free gears available), your own computer with dynamic DNS, or many other options available through Google.
Next, you packed your compiled code to a war file. That war file needs to be unpacked (deployed) using some software.
There are numerous ways to handle this (Tomcat, Jetty, Glassfish, etc.). They all have their pros and cons. Pick one and learn the very basics. Tomcat doesn't require a separate web server but you can set one up with it if you like. At this stage, I would keep it simple and not do that yet.
Lastly, set up GoDaddy (or whomever you used to get your URL) to point to the IP address of that server. If your server is running and enough time has passed for the changes to propagate, you should see your page.
There are plenty other J2EE server for example, JBoss and Glassfish. Each one has it's own way to deploy your war files. For example, Glassfish is throught a web administration console (https://docs.oracle.com/cd/E19798-01/821-1757/6nmni99aj/index.html) and in JBoss you need to deploy the war file in a specific directory (http://docs.jboss.org/jbossweb/3.0.x/deployer-howto.html).
It depends on which J2EE server you are using.
Now if you want to get your own server and configure it:
Get the server or VPS
Install JAVA
Install Apache
Install a J2EE server (I prefer glassfish)
Configure glassfish with apache (http://www.codefactorycr.com/glassfish-behind-apache.html) to use apache in front of glassfish
You may want to block the ports 4848 and 8080 used by glassfish
Deploy your webapp
Have fun!!!
PS: I'm assuming you have root access to the server
Easy Apache Tomcat 7 install after,
Run Code via SSH:
/usr/local/cpanel/scripts/addservlets2 --domain=domain.com
For Linux.

Java JVM versus Glassfish

I'm really new to Java and I have a basic question. I'm getting ready to deploy a Java web service that I have created in Netbeans/Glassfish. I used Netbeans because of the development GUI and tools. Of course I also deployed to Netbean's built in GF server because of easy and simplicity. I have a Windows 8 server with IIS that I now need to deploy this to. I was thinking that since Java 1.7 EE was already on my IIS server, than I wouldn't need a "container server" like GF but that doesn't appear to be the case. So, I'm confused. What's the difference between the server that Glassfish creates and the JVM that Java EE creates when it is installed? If I have to install Glassfish on my IIS server, am I going to have competing web services and port conflicts to resolve?
Thank you.
The Java Virtual Machine (JVM) is used to execute any Java program. However, all it does is execute the byte code in a Java binary, for example a Java archive (.jar) file. It does not include implementations of many of the Java EE libraries.
A web application, typically deployed as a web archive (.war) file, usually requires libraries not provided by the JVM. In addition, the standard Java web application architecture means that the entry point for the application is not in the .war file - it is in the web application server, which then calls into the code provided in the .war file.
The web application server, which includes full J2EE containers like Glassfish and also more limited web servers like Tomcat and Jetty, acts as an intermediate layer, running on a JVM and executing the web application provided in the .war file.
Probably the best way to run your application on an IIS server is to set up the IIS server as the front end - so the client facing ports would be under IIS control - and set up the web server as a back end to which IIS forwards the relevant requests. The answers at the following question provide some links that may be useful:
Deploy War File in Microsoft IIS 7

Tomcat as an Enterpise server

It seems that tomcat is a web application server and EAR cannot be deployed in it. Can it be updated to deploy EAR files. If not what could be the alternate server which is easy to configure and deploy?
In Short - NO. Tomcat is not a Java EE compliant server, but just a web server.
Use JBoss/GlassFish/Geronimo, there are a lot more, just google for it :)
Best alternative is Glassfish Application Server, alongwith Netbeans which will be best for practice purpose. Although there are a long list of such server and also that Apache also have one such server.
....
I don't know about Glassfish, but JBoss uses an embedded Tomcat so you might get comfortable with it somewhat easier.

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.

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?

Categories