tomcat interview questions
Top tomcat frequently asked interview questions
I was trying to add Tomcat 7 in my Eclipse in Ubuntu. When I click "Add new server" in Eclipse and select "Tomcat v7.0 Server", the field "Server Name" is blank and I cannot type in anything in that textbox as shown below:
What I did before is I deleted a Tomcat 7 server from Eclipse and I was trying to reinstall Tomcat 7. But it doesn't allow me to type anything in that textbox and I cannot proceed to the "Next" button. My environment is Ubuntu Linux and Eclipse for JavaEE.
Source: (StackOverflow)
I have copied the sample.war
file into the webapps
directory of Tomcat, and I can access localhost:8080
.
Now how will Tomcat deploy it, I mean do I need to open it in browser? How can I access the application?
Source: (StackOverflow)
I'm getting the following error when I try to run a simple JSP program on Tomcat in Eclipse.
Several ports (8005, 8080, 8009) required by Tomcat v6.0 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).
How is this caused and how can I solve it?
Source: (StackOverflow)
What are the best practices of creating war files (using eclipse) to run on tomcat? tutorials, links, examples are highly appreciated.
Source: (StackOverflow)
I am getting following error, when I run the demo JSF application on the console
[SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:JSFTut' did not find a matching property.
Source: (StackOverflow)
Looking for way how to configure port in Spring boot app:
@Controller
@EnableAutoConfiguration
public class SampleController {
@RequestMapping("/")
@ResponseBody
String home() {
return "Hello World!";
}
public static void main(String[] args) throws Exception {
SpringApplication.run(SampleController.class, args);
}
}
That is all sources :)
Source: (StackOverflow)
I have tomcat 5.5 installed, running and verifiable at http://localhost:8080/. The Tomcat menu option appears in the Eclipse menu bar and I can start and stop Tomcat from there. In Eclipse, it does not show as a Server Runtime Environment in Window - Preferences - Server - Runtime Environments, nor does it appear in the list of environments that can be added when I click the "Add" button. All I see is the J2EE Runtime Library.
Edit:
Running on Windows XP.
Eclipse version is 3.5.1
Source: (StackOverflow)
What are the advantages and disadvantages of using mod_jk
and mod_proxy
for fronting a tomcat instance with apache?
I've been using mod_jk in production for years but I've heard that it's "the old way" of fronting tomcat. Should I consider changing? Would there be any benefits?
Source: (StackOverflow)
How can I strip out extra whitespace from jsp pages' output? Is there a switch I can flip on my web.xml? Is there a Tomcat specific setting?
Source: (StackOverflow)
When I start Tomcat I get the following error:
Jun 10, 2010 5:17:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Jun 10, 2010 5:17:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/mywebapplication] startup failed due to previous errors
It seems odd that the logs for Tomcat would not include a stack trace. Does somebody have a suggestion for how to increase the logging in Tomcat to get stack traces for errors like this?
Source: (StackOverflow)
What is the difference in terms of functionality between the Apache HTTP Server and Apache Tomcat?
I know that Tomcat is written in Java and the HTTP Server is in C, but other than that I do not really know how they are distinguished. Do they have different functionality?
Source: (StackOverflow)
I need to get UTF-8 working in my Java webapp (servlets + JSP, no framework used) to support äöå
etc. for regular Finnish text and Cyrillic alphabets like ЦжФ
for special cases.
My setup is the following:
- Development environment: Windows XP
- Production environment: Debian
Database used: MySQL 5.x
Users mainly use Firefox2 but also Opera 9.x, FF3, IE7 and Google Chrome are used to access the site.
How to achieve this?
Source: (StackOverflow)
I am starting to look into Enterprise Java and the book I am following mentions that it will use JBoss. Netbeans ships with Glassfish. I have used Tomcat in the past.
What are the differences between these three programs?
Source: (StackOverflow)
I'm working on my usual projects on Eclipse, it's a J2EE application, made with Spring, Hibernate and so on. I'm using Tomcat 7 for this (no particular reason, I don't exploit any new feature, I just wanted to try that). Every time I debug my application, it happens that Eclipse debugger pops out like it has reached a breakpoint, but it is not the case, in fact it stops on a Java source file that is ThreadPoolExecutor
. There is no stack trace on the console, it just stops. Then if I click on resume it goes on and the app works perfectly. This is what shows in the debugger window:
Daemon Thread ["http-bio-8080"-exec-2] (Suspended (exception RuntimeException))
ThreadPoolExecutor$Worker.run() line: 912
TaskThread(Thread).run() line: 619
I really can't explain this, because I'm not using ThreadPoolExecutor
at all. Must be something from Tomcat, Hibernate or Spring. It's very annoying because I always have to resume during debugging.
Any clues?
Source: (StackOverflow)