Link to home
Start Free TrialLog in
Avatar of pavan_immadi

asked on

How to Deploy a WAR file or an EAR on Apache Tomcat ?

Can some body give me the Steps that have to be followed in order to Deploy an application WAR or EAR file. I am new to this technology and I am not sure if we can deploy a EAR file on Apache tomcat Server. Can some body give me details about it ?
Avatar of shinobun

Apache Tomcat [1] is a servlet container.  It's capability is limited to WAR files.
If you want to deploy an EAR file, you will need to get a J2EE container like Apache Geronimo [2], JBoss [3], etc..

Also, you might want to ask in the App Servers TA [4] to get better responses on the subject.

Avatar of pavan_immadi


Hi shinobun
             Are Geronimo and jboss  an open source applications or do we hae to  purchase any license for them ? I was told to install Apache | Tomcat so  thought the one that I have installed is the corect one that is in [1]  version . I am not sure what their requirement is , I am waiting for the requirement from my customer. If it is just a war file then it should be fine , if not I might have to switch to joboss or Geronimo.

Might be the one you are looking for.

Bimal Mankara
Geronimo and JBoss are both open source.  If you don't need full J2EE support (like EJB, JMS, etc.), then Tomcat should be sufficient.
            I appreciate for your suggestions and finally I came to know what the application is , and it is WAR file. So I guess I can run the app on Apache Tomcat Serrvlet container. I am glad that I don't have to re do everything. Now I have deployed the application and I have to configure the DataSource and the JNDI names, Can some one tell me how to configure this in simple words. I know I have to log in to the Tomcat Administration and give all values in the DataSources tab. And store he Driver jar file Ctalina_Home/common/lib, other than thaose changes where else do  have to make necessary changes and what changes am I suposed to do. Please let me know.
            Also the Developer has not given me any details of the JNDI names or URL to the Database Server. Can some one tell me if it is possible configure all the Data source and JNDI details in the WAR file it self  ? Since it is just an WAR file does it really need the JNDI ? If all the above details are configured in the WAR file itself then do we have to clear I am asking this question because this thing is stuck in my mind I am not able to clear it .

            Please clarify my questions.
Thank you.
You might want to take a look at the Apache Tomcat JNDI Datasource HOW-TO document [1].  Basically you add a Resource entry in the server or context xml, and a reference to that in the WAR's web.xml.

Usually, you would set up the URL and such in Tomcat, and the WAR will only need the JNDI name.  That way, you don't need to change the WAR when you just want to change databases.  But in your case, you don't even know the JNDI name...  Is the Developer going to set up the server?  If not, I guess you can just decide on the JNDI name and tell them to use that.

I guess I don't have to Map any Datasource or JDBC driver for this App. Because the customer is already running this Application on JDeveloper and he does not use any JDBC or ODBC drivers in there, but there is file in which they have configured the Database names and instance names to which it has to get connected. When I type the Test login then i am Getting the following error :

HTTP Status 500 -


type Exception report


description The server encountered an internal error () that prevented it from fulfilling this request.


org.apache.jasper.JasperException: Can't find resource for bundle java.util.PropertyResourceBundle, key HTTPServer7

root cause

java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key HTTPServer7

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.

Any cluses why am I getting this error  ? Also in the log files which log file do I have to look at in order to trace the cause for ths problem.
Avatar of shinobun

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
do you want me to post the server properties file ?
First, let's look at line 87 of  We'll see what's happening from there.
There is no such File in the WAR file , but there is Serverproperties.class  file in the location described in the error report.
So how to open the class file ?
You can't open a class file.  It's like a dll, and only contains compiled information that java VM's can read.

You will need to contact the developer and ask what's happening on that line, and what properties file it expects on the server.