Avatar of pavan_immadi
pavan_immadi
 asked on

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

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 ?
Apache Web Server

Avatar of undefined
Last Comment
shinobun

8/22/2022 - Mon
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.

[1] http://tomcat.apache.org/
[2] http://geronimo.apache.org/
[3] http://www.jboss.org/
[4] https://www.experts-exchange.com/Web/Application_Servers/
pavan_immadi

ASKER
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 5.5.1.7 . 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.
               
bimal_linux

http://tomcat.apache.org/tomcat-5.0-doc/deployer-howto.html

Might be the one you are looking for.

Regards,
Bimal Mankara
Your help has saved me hundreds of hours of internet surfing.
fblack61
shinobun

Geronimo and JBoss are both open source.  If you don't need full J2EE support (like EJB, JMS, etc.), then Tomcat should be sufficient.
pavan_immadi

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

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.

[1] http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
pavan_immadi

ASKER
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 database.properties 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

message

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

exception

org.apache.jasper.JasperException: Can't find resource for bundle java.util.PropertyResourceBundle, key HTTPServer7
      org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key HTTPServer7
      java.util.ResourceBundle.getObject(ResourceBundle.java:314)
      java.util.ResourceBundle.getString(ResourceBundle.java:274)
      com.bayer.cropscience.nafta.uscrop.hierarchymaint.ServerProperties.setDataSource(ServerProperties.java:87)
      org.apache.jsp.index_jsp._jspService(index_jsp.java:49)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


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.
ASKER CERTIFIED SOLUTION
shinobun

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
pavan_immadi

ASKER
do you want me to post the server properties file ?
shinobun

First, let's look at line 87 of ServerProperties.java.  We'll see what's happening from there.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
pavan_immadi

ASKER
There is no such File in the WAR file , but there is Serverproperties.class  file in the location described in the error report.
com.bayer.cropscience.nafta.uscrop.hierarchymaint.ServerProperties.setDataSource(ServerProperties.java:87)
So how to open the class file ?
shinobun

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.